google-api-client 0.11.2 → 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -1
  3. data/README.md +6 -0
  4. data/api_names.yaml +1 -0
  5. data/generated/google/apis/acceleratedmobilepageurl_v1/classes.rb +38 -38
  6. data/generated/google/apis/acceleratedmobilepageurl_v1/representations.rb +13 -13
  7. data/generated/google/apis/acceleratedmobilepageurl_v1/service.rb +10 -10
  8. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  9. data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +201 -201
  10. data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +46 -46
  11. data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +119 -119
  12. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  13. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +52 -9
  14. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +9 -0
  15. data/generated/google/apis/adsense_v1_4.rb +1 -1
  16. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  17. data/generated/google/apis/analyticsreporting_v4/classes.rb +926 -926
  18. data/generated/google/apis/analyticsreporting_v4/representations.rb +149 -149
  19. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  20. data/generated/google/apis/androidenterprise_v1/classes.rb +18 -11
  21. data/generated/google/apis/androidenterprise_v1/representations.rb +1 -0
  22. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  23. data/generated/google/apis/appengine_v1.rb +1 -1
  24. data/generated/google/apis/appengine_v1/classes.rb +1487 -1487
  25. data/generated/google/apis/appengine_v1/representations.rb +229 -229
  26. data/generated/google/apis/appengine_v1/service.rb +188 -188
  27. data/generated/google/apis/appstate_v1.rb +1 -1
  28. data/generated/google/apis/bigquery_v2.rb +1 -1
  29. data/generated/google/apis/bigquery_v2/classes.rb +15 -10
  30. data/generated/google/apis/calendar_v3.rb +1 -1
  31. data/generated/google/apis/calendar_v3/service.rb +10 -4
  32. data/generated/google/apis/classroom_v1.rb +26 -17
  33. data/generated/google/apis/classroom_v1/classes.rb +990 -990
  34. data/generated/google/apis/classroom_v1/representations.rb +239 -239
  35. data/generated/google/apis/classroom_v1/service.rb +853 -853
  36. data/generated/google/apis/cloudbilling_v1.rb +1 -1
  37. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  38. data/generated/google/apis/cloudbuild_v1/classes.rb +627 -627
  39. data/generated/google/apis/cloudbuild_v1/representations.rb +116 -116
  40. data/generated/google/apis/cloudbuild_v1/service.rb +162 -157
  41. data/generated/google/apis/clouddebugger_v2/classes.rb +258 -258
  42. data/generated/google/apis/clouddebugger_v2/representations.rb +80 -80
  43. data/generated/google/apis/clouddebugger_v2/service.rb +163 -163
  44. data/generated/google/apis/clouderrorreporting_v1beta1.rb +3 -4
  45. data/generated/google/apis/clouderrorreporting_v1beta1/classes.rb +202 -167
  46. data/generated/google/apis/clouderrorreporting_v1beta1/representations.rb +53 -37
  47. data/generated/google/apis/clouderrorreporting_v1beta1/service.rb +50 -51
  48. data/generated/google/apis/cloudfunctions_v1.rb +1 -1
  49. data/generated/google/apis/cloudkms_v1.rb +1 -1
  50. data/generated/google/apis/cloudkms_v1/classes.rb +628 -622
  51. data/generated/google/apis/cloudkms_v1/representations.rb +134 -133
  52. data/generated/google/apis/cloudkms_v1/service.rb +190 -190
  53. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  54. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +835 -835
  55. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +138 -138
  56. data/generated/google/apis/cloudresourcemanager_v1/service.rb +474 -474
  57. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  58. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +386 -386
  59. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +75 -75
  60. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +64 -64
  61. data/generated/google/apis/cloudtrace_v1.rb +4 -4
  62. data/generated/google/apis/cloudtrace_v1/classes.rb +114 -114
  63. data/generated/google/apis/cloudtrace_v1/representations.rb +23 -23
  64. data/generated/google/apis/cloudtrace_v1/service.rb +14 -14
  65. data/generated/google/apis/compute_beta.rb +1 -1
  66. data/generated/google/apis/compute_beta/classes.rb +66 -25
  67. data/generated/google/apis/compute_beta/representations.rb +16 -0
  68. data/generated/google/apis/compute_beta/service.rb +85 -3
  69. data/generated/google/apis/compute_v1.rb +1 -1
  70. data/generated/google/apis/compute_v1/classes.rb +375 -24
  71. data/generated/google/apis/compute_v1/representations.rb +155 -0
  72. data/generated/google/apis/compute_v1/service.rb +481 -3
  73. data/generated/google/apis/container_v1.rb +1 -1
  74. data/generated/google/apis/container_v1/classes.rb +301 -301
  75. data/generated/google/apis/container_v1/representations.rb +59 -59
  76. data/generated/google/apis/container_v1/service.rb +178 -178
  77. data/generated/google/apis/content_v2.rb +1 -1
  78. data/generated/google/apis/content_v2/classes.rb +37 -2
  79. data/generated/google/apis/content_v2/representations.rb +15 -0
  80. data/generated/google/apis/content_v2/service.rb +58 -3
  81. data/generated/google/apis/dataflow_v1b3.rb +4 -1
  82. data/generated/google/apis/dataflow_v1b3/classes.rb +3514 -3279
  83. data/generated/google/apis/dataflow_v1b3/representations.rb +530 -440
  84. data/generated/google/apis/dataflow_v1b3/service.rb +378 -137
  85. data/generated/google/apis/dataproc_v1.rb +1 -1
  86. data/generated/google/apis/dataproc_v1/classes.rb +446 -446
  87. data/generated/google/apis/dataproc_v1/representations.rb +96 -96
  88. data/generated/google/apis/dataproc_v1/service.rb +302 -302
  89. data/generated/google/apis/datastore_v1.rb +1 -1
  90. data/generated/google/apis/datastore_v1/classes.rb +370 -374
  91. data/generated/google/apis/datastore_v1/representations.rb +120 -120
  92. data/generated/google/apis/datastore_v1/service.rb +62 -62
  93. data/generated/google/apis/dns_v1.rb +1 -1
  94. data/generated/google/apis/dns_v2beta1.rb +1 -1
  95. data/generated/google/apis/doubleclickbidmanager_v1.rb +3 -0
  96. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  97. data/generated/google/apis/drive_v2.rb +1 -1
  98. data/generated/google/apis/drive_v2/classes.rb +24 -21
  99. data/generated/google/apis/drive_v3.rb +1 -1
  100. data/generated/google/apis/drive_v3/classes.rb +24 -22
  101. data/generated/google/apis/firebasedynamiclinks_v1.rb +1 -1
  102. data/generated/google/apis/firebasedynamiclinks_v1/classes.rb +148 -149
  103. data/generated/google/apis/firebasedynamiclinks_v1/representations.rb +42 -42
  104. data/generated/google/apis/firebaserules_v1/classes.rb +71 -71
  105. data/generated/google/apis/firebaserules_v1/representations.rb +22 -22
  106. data/generated/google/apis/firebaserules_v1/service.rb +68 -68
  107. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  108. data/generated/google/apis/games_management_v1management.rb +1 -1
  109. data/generated/google/apis/games_v1.rb +1 -1
  110. data/generated/google/apis/genomics_v1.rb +1 -1
  111. data/generated/google/apis/genomics_v1/classes.rb +2348 -2348
  112. data/generated/google/apis/genomics_v1/representations.rb +430 -430
  113. data/generated/google/apis/genomics_v1/service.rb +1159 -1159
  114. data/generated/google/apis/gmail_v1.rb +1 -1
  115. data/generated/google/apis/gmail_v1/service.rb +2 -2
  116. data/generated/google/apis/iam_v1.rb +1 -1
  117. data/generated/google/apis/iam_v1/classes.rb +305 -298
  118. data/generated/google/apis/iam_v1/representations.rb +97 -96
  119. data/generated/google/apis/iam_v1/service.rb +86 -86
  120. data/generated/google/apis/kgsearch_v1/classes.rb +6 -6
  121. data/generated/google/apis/kgsearch_v1/representations.rb +1 -1
  122. data/generated/google/apis/kgsearch_v1/service.rb +10 -10
  123. data/generated/google/apis/language_v1.rb +4 -4
  124. data/generated/google/apis/language_v1/classes.rb +452 -452
  125. data/generated/google/apis/language_v1/representations.rb +93 -93
  126. data/generated/google/apis/language_v1/service.rb +48 -48
  127. data/generated/google/apis/language_v1beta1.rb +4 -4
  128. data/generated/google/apis/language_v1beta1/classes.rb +84 -84
  129. data/generated/google/apis/language_v1beta1/representations.rb +22 -22
  130. data/generated/google/apis/language_v1beta1/service.rb +3 -3
  131. data/generated/google/apis/logging_v2.rb +1 -1
  132. data/generated/google/apis/logging_v2/classes.rb +884 -873
  133. data/generated/google/apis/logging_v2/representations.rb +167 -166
  134. data/generated/google/apis/logging_v2/service.rb +430 -430
  135. data/generated/google/apis/logging_v2beta1.rb +1 -1
  136. data/generated/google/apis/logging_v2beta1/classes.rb +550 -539
  137. data/generated/google/apis/logging_v2beta1/representations.rb +124 -123
  138. data/generated/google/apis/logging_v2beta1/service.rb +292 -292
  139. data/generated/google/apis/manufacturers_v1/classes.rb +322 -322
  140. data/generated/google/apis/manufacturers_v1/representations.rb +66 -66
  141. data/generated/google/apis/ml_v1.rb +1 -1
  142. data/generated/google/apis/ml_v1/classes.rb +501 -494
  143. data/generated/google/apis/ml_v1/representations.rb +92 -91
  144. data/generated/google/apis/ml_v1/service.rb +190 -190
  145. data/generated/google/apis/monitoring_v3.rb +1 -1
  146. data/generated/google/apis/monitoring_v3/classes.rb +878 -878
  147. data/generated/google/apis/monitoring_v3/representations.rb +176 -176
  148. data/generated/google/apis/monitoring_v3/service.rb +223 -262
  149. data/generated/google/apis/oauth2_v2.rb +1 -1
  150. data/generated/google/apis/partners_v2.rb +1 -1
  151. data/generated/google/apis/partners_v2/classes.rb +1506 -1506
  152. data/generated/google/apis/partners_v2/representations.rb +370 -370
  153. data/generated/google/apis/partners_v2/service.rb +393 -393
  154. data/generated/google/apis/people_v1.rb +13 -13
  155. data/generated/google/apis/people_v1/classes.rb +597 -594
  156. data/generated/google/apis/people_v1/representations.rb +121 -121
  157. data/generated/google/apis/people_v1/service.rb +39 -48
  158. data/generated/google/apis/plus_domains_v1.rb +1 -1
  159. data/generated/google/apis/plus_v1.rb +1 -1
  160. data/generated/google/apis/proximitybeacon_v1beta1.rb +1 -1
  161. data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +323 -327
  162. data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +100 -100
  163. data/generated/google/apis/proximitybeacon_v1beta1/service.rb +184 -184
  164. data/generated/google/apis/pubsub_v1.rb +1 -1
  165. data/generated/google/apis/pubsub_v1/classes.rb +178 -178
  166. data/generated/google/apis/pubsub_v1/representations.rb +55 -55
  167. data/generated/google/apis/pubsub_v1/service.rb +357 -357
  168. data/generated/google/apis/runtimeconfig_v1.rb +1 -1
  169. data/generated/google/apis/runtimeconfig_v1/classes.rb +20 -20
  170. data/generated/google/apis/runtimeconfig_v1/representations.rb +2 -2
  171. data/generated/google/apis/runtimeconfig_v1/service.rb +12 -7
  172. data/generated/google/apis/script_v1.rb +16 -16
  173. data/generated/google/apis/script_v1/classes.rb +113 -113
  174. data/generated/google/apis/script_v1/representations.rb +28 -28
  175. data/generated/google/apis/script_v1/service.rb +4 -4
  176. data/generated/google/apis/searchconsole_v1.rb +1 -1
  177. data/generated/google/apis/searchconsole_v1/classes.rb +84 -84
  178. data/generated/google/apis/searchconsole_v1/representations.rb +32 -32
  179. data/generated/google/apis/searchconsole_v1/service.rb +6 -6
  180. data/generated/google/apis/servicecontrol_v1.rb +4 -4
  181. data/generated/google/apis/servicecontrol_v1/classes.rb +1146 -1145
  182. data/generated/google/apis/servicecontrol_v1/representations.rb +203 -203
  183. data/generated/google/apis/servicecontrol_v1/service.rb +57 -57
  184. data/generated/google/apis/servicemanagement_v1.rb +4 -4
  185. data/generated/google/apis/servicemanagement_v1/classes.rb +3486 -3360
  186. data/generated/google/apis/servicemanagement_v1/representations.rb +342 -329
  187. data/generated/google/apis/servicemanagement_v1/service.rb +260 -250
  188. data/generated/google/apis/serviceuser_v1.rb +1 -1
  189. data/generated/google/apis/serviceuser_v1/classes.rb +2716 -2596
  190. data/generated/google/apis/serviceuser_v1/representations.rb +391 -379
  191. data/generated/google/apis/serviceuser_v1/service.rb +16 -16
  192. data/generated/google/apis/sheets_v4.rb +1 -1
  193. data/generated/google/apis/sheets_v4/classes.rb +4255 -4252
  194. data/generated/google/apis/sheets_v4/representations.rb +548 -548
  195. data/generated/google/apis/sheets_v4/service.rb +170 -170
  196. data/generated/google/apis/slides_v1.rb +4 -4
  197. data/generated/google/apis/slides_v1/classes.rb +2945 -2916
  198. data/generated/google/apis/slides_v1/representations.rb +700 -697
  199. data/generated/google/apis/slides_v1/service.rb +44 -44
  200. data/generated/google/apis/sourcerepo_v1.rb +2 -2
  201. data/generated/google/apis/sourcerepo_v1/classes.rb +419 -410
  202. data/generated/google/apis/sourcerepo_v1/representations.rb +88 -87
  203. data/generated/google/apis/sourcerepo_v1/service.rb +67 -58
  204. data/generated/google/apis/spanner_v1/classes.rb +2187 -2187
  205. data/generated/google/apis/spanner_v1/representations.rb +323 -323
  206. data/generated/google/apis/spanner_v1/service.rb +383 -383
  207. data/generated/google/apis/speech_v1beta1.rb +1 -1
  208. data/generated/google/apis/speech_v1beta1/classes.rb +226 -226
  209. data/generated/google/apis/speech_v1beta1/representations.rb +44 -44
  210. data/generated/google/apis/speech_v1beta1/service.rb +37 -32
  211. data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
  212. data/generated/google/apis/sqladmin_v1beta4/classes.rb +10 -28
  213. data/generated/google/apis/sqladmin_v1beta4/representations.rb +2 -16
  214. data/generated/google/apis/sqladmin_v1beta4/service.rb +1 -1
  215. data/generated/google/apis/storage_v1.rb +1 -1
  216. data/generated/google/apis/storage_v1/classes.rb +26 -0
  217. data/generated/google/apis/storage_v1/representations.rb +15 -0
  218. data/generated/google/apis/storage_v1/service.rb +168 -42
  219. data/generated/google/apis/storagetransfer_v1.rb +1 -1
  220. data/generated/google/apis/storagetransfer_v1/classes.rb +218 -218
  221. data/generated/google/apis/storagetransfer_v1/representations.rb +47 -47
  222. data/generated/google/apis/storagetransfer_v1/service.rb +68 -68
  223. data/generated/google/apis/toolresults_v1beta3.rb +1 -1
  224. data/generated/google/apis/toolresults_v1beta3/classes.rb +7 -4
  225. data/generated/google/apis/toolresults_v1beta3/service.rb +9 -8
  226. data/generated/google/apis/translate_v2.rb +11 -4
  227. data/generated/google/apis/translate_v2/classes.rb +140 -37
  228. data/generated/google/apis/translate_v2/representations.rb +62 -15
  229. data/generated/google/apis/translate_v2/service.rb +119 -66
  230. data/generated/google/apis/vision_v1.rb +1 -1
  231. data/generated/google/apis/vision_v1/classes.rb +1265 -1273
  232. data/generated/google/apis/vision_v1/representations.rb +202 -202
  233. data/generated/google/apis/vision_v1/service.rb +4 -4
  234. data/generated/google/apis/webmasters_v3.rb +1 -1
  235. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  236. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  237. data/generated/google/apis/youtube_partner_v1/classes.rb +2 -1
  238. data/generated/google/apis/youtubereporting_v1.rb +1 -1
  239. data/generated/google/apis/youtubereporting_v1/classes.rb +91 -91
  240. data/generated/google/apis/youtubereporting_v1/representations.rb +25 -25
  241. data/generated/google/apis/youtubereporting_v1/service.rb +94 -94
  242. data/lib/google/apis/core/api_command.rb +43 -10
  243. data/lib/google/apis/core/json_representation.rb +1 -1
  244. data/lib/google/apis/options.rb +6 -2
  245. data/lib/google/apis/version.rb +1 -1
  246. metadata +3 -3
@@ -58,11 +58,11 @@ module Google
58
58
  # * `ALREADY_EXISTS` if an invitation for the specified user and course
59
59
  # already exists.
60
60
  # @param [Google::Apis::ClassroomV1::Invitation] invitation_object
61
+ # @param [String] fields
62
+ # Selector specifying which fields to include in a partial response.
61
63
  # @param [String] quota_user
62
64
  # Available to use for quota purposes for server-side applications. Can be any
63
65
  # arbitrary string assigned to a user, but should not exceed 40 characters.
64
- # @param [String] fields
65
- # Selector specifying which fields to include in a partial response.
66
66
  # @param [Google::Apis::RequestOptions] options
67
67
  # Request-specific options
68
68
  #
@@ -75,14 +75,89 @@ module Google
75
75
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
76
76
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
77
77
  # @raise [Google::Apis::AuthorizationError] Authorization is required
78
- def create_invitation(invitation_object = nil, quota_user: nil, fields: nil, options: nil, &block)
78
+ def create_invitation(invitation_object = nil, fields: nil, quota_user: nil, options: nil, &block)
79
79
  command = make_simple_command(:post, 'v1/invitations', options)
80
80
  command.request_representation = Google::Apis::ClassroomV1::Invitation::Representation
81
81
  command.request_object = invitation_object
82
82
  command.response_representation = Google::Apis::ClassroomV1::Invitation::Representation
83
83
  command.response_class = Google::Apis::ClassroomV1::Invitation
84
+ command.query['fields'] = fields unless fields.nil?
85
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
86
+ execute_or_queue_command(command, &block)
87
+ end
88
+
89
+ # Accepts an invitation, removing it and adding the invited user to the
90
+ # teachers or students (as appropriate) of the specified course. Only the
91
+ # invited user may accept an invitation.
92
+ # This method returns the following error codes:
93
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to accept the
94
+ # requested invitation or for access errors.
95
+ # * `FAILED_PRECONDITION` for the following request errors:
96
+ # * CourseMemberLimitReached
97
+ # * CourseNotModifiable
98
+ # * CourseTeacherLimitReached
99
+ # * UserGroupsMembershipLimitReached
100
+ # * `NOT_FOUND` if no invitation exists with the requested ID.
101
+ # @param [String] id
102
+ # Identifier of the invitation to accept.
103
+ # @param [String] fields
104
+ # Selector specifying which fields to include in a partial response.
105
+ # @param [String] quota_user
106
+ # Available to use for quota purposes for server-side applications. Can be any
107
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
108
+ # @param [Google::Apis::RequestOptions] options
109
+ # Request-specific options
110
+ #
111
+ # @yield [result, err] Result & error if block supplied
112
+ # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
113
+ # @yieldparam err [StandardError] error object if request failed
114
+ #
115
+ # @return [Google::Apis::ClassroomV1::Empty]
116
+ #
117
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
118
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
119
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
120
+ def accept_invitation(id, fields: nil, quota_user: nil, options: nil, &block)
121
+ command = make_simple_command(:post, 'v1/invitations/{id}:accept', options)
122
+ command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
123
+ command.response_class = Google::Apis::ClassroomV1::Empty
124
+ command.params['id'] = id unless id.nil?
125
+ command.query['fields'] = fields unless fields.nil?
84
126
  command.query['quotaUser'] = quota_user unless quota_user.nil?
127
+ execute_or_queue_command(command, &block)
128
+ end
129
+
130
+ # Deletes an invitation.
131
+ # This method returns the following error codes:
132
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to delete the
133
+ # requested invitation or for access errors.
134
+ # * `NOT_FOUND` if no invitation exists with the requested ID.
135
+ # @param [String] id
136
+ # Identifier of the invitation to delete.
137
+ # @param [String] fields
138
+ # Selector specifying which fields to include in a partial response.
139
+ # @param [String] quota_user
140
+ # Available to use for quota purposes for server-side applications. Can be any
141
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
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::ClassroomV1::Empty] parsed result object
147
+ # @yieldparam err [StandardError] error object if request failed
148
+ #
149
+ # @return [Google::Apis::ClassroomV1::Empty]
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 delete_invitation(id, fields: nil, quota_user: nil, options: nil, &block)
155
+ command = make_simple_command(:delete, 'v1/invitations/{id}', options)
156
+ command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
157
+ command.response_class = Google::Apis::ClassroomV1::Empty
158
+ command.params['id'] = id unless id.nil?
85
159
  command.query['fields'] = fields unless fields.nil?
160
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
86
161
  execute_or_queue_command(command, &block)
87
162
  end
88
163
 
@@ -93,11 +168,11 @@ module Google
93
168
  # * `NOT_FOUND` if no invitation exists with the requested ID.
94
169
  # @param [String] id
95
170
  # Identifier of the invitation to return.
171
+ # @param [String] fields
172
+ # Selector specifying which fields to include in a partial response.
96
173
  # @param [String] quota_user
97
174
  # Available to use for quota purposes for server-side applications. Can be any
98
175
  # arbitrary string assigned to a user, but should not exceed 40 characters.
99
- # @param [String] fields
100
- # Selector specifying which fields to include in a partial response.
101
176
  # @param [Google::Apis::RequestOptions] options
102
177
  # Request-specific options
103
178
  #
@@ -110,13 +185,13 @@ module Google
110
185
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
111
186
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
112
187
  # @raise [Google::Apis::AuthorizationError] Authorization is required
113
- def get_invitation(id, quota_user: nil, fields: nil, options: nil, &block)
188
+ def get_invitation(id, fields: nil, quota_user: nil, options: nil, &block)
114
189
  command = make_simple_command(:get, 'v1/invitations/{id}', options)
115
190
  command.response_representation = Google::Apis::ClassroomV1::Invitation::Representation
116
191
  command.response_class = Google::Apis::ClassroomV1::Invitation
117
192
  command.params['id'] = id unless id.nil?
118
- command.query['quotaUser'] = quota_user unless quota_user.nil?
119
193
  command.query['fields'] = fields unless fields.nil?
194
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
120
195
  execute_or_queue_command(command, &block)
121
196
  end
122
197
 
@@ -129,9 +204,6 @@ module Google
129
204
  # @param [String] course_id
130
205
  # Restricts returned invitations to those for a course with the specified
131
206
  # identifier.
132
- # @param [Fixnum] page_size
133
- # Maximum number of items to return. Zero means no maximum.
134
- # The server may return fewer than the specified number of results.
135
207
  # @param [String] user_id
136
208
  # Restricts returned invitations to those for a specific user. The identifier
137
209
  # can be one of the following:
@@ -145,11 +217,14 @@ module Google
145
217
  # that the subsequent page of results should be returned.
146
218
  # The list request must be
147
219
  # otherwise identical to the one that resulted in this token.
220
+ # @param [Fixnum] page_size
221
+ # Maximum number of items to return. Zero means no maximum.
222
+ # The server may return fewer than the specified number of results.
223
+ # @param [String] fields
224
+ # Selector specifying which fields to include in a partial response.
148
225
  # @param [String] quota_user
149
226
  # Available to use for quota purposes for server-side applications. Can be any
150
227
  # arbitrary string assigned to a user, but should not exceed 40 characters.
151
- # @param [String] fields
152
- # Selector specifying which fields to include in a partial response.
153
228
  # @param [Google::Apis::RequestOptions] options
154
229
  # Request-specific options
155
230
  #
@@ -162,72 +237,33 @@ module Google
162
237
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
163
238
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
164
239
  # @raise [Google::Apis::AuthorizationError] Authorization is required
165
- def list_invitations(course_id: nil, page_size: nil, user_id: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
240
+ def list_invitations(course_id: nil, user_id: nil, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
166
241
  command = make_simple_command(:get, 'v1/invitations', options)
167
242
  command.response_representation = Google::Apis::ClassroomV1::ListInvitationsResponse::Representation
168
243
  command.response_class = Google::Apis::ClassroomV1::ListInvitationsResponse
169
244
  command.query['courseId'] = course_id unless course_id.nil?
170
- command.query['pageSize'] = page_size unless page_size.nil?
171
245
  command.query['userId'] = user_id unless user_id.nil?
172
246
  command.query['pageToken'] = page_token unless page_token.nil?
173
- command.query['quotaUser'] = quota_user unless quota_user.nil?
247
+ command.query['pageSize'] = page_size unless page_size.nil?
174
248
  command.query['fields'] = fields unless fields.nil?
249
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
175
250
  execute_or_queue_command(command, &block)
176
251
  end
177
252
 
178
- # Deletes an invitation.
253
+ # Deletes a course.
179
254
  # This method returns the following error codes:
180
255
  # * `PERMISSION_DENIED` if the requesting user is not permitted to delete the
181
- # requested invitation or for access errors.
182
- # * `NOT_FOUND` if no invitation exists with the requested ID.
256
+ # requested course or for access errors.
257
+ # * `NOT_FOUND` if no course exists with the requested ID.
183
258
  # @param [String] id
184
- # Identifier of the invitation to delete.
185
- # @param [String] quota_user
186
- # Available to use for quota purposes for server-side applications. Can be any
187
- # arbitrary string assigned to a user, but should not exceed 40 characters.
259
+ # Identifier of the course to delete.
260
+ # This identifier can be either the Classroom-assigned identifier or an
261
+ # alias.
188
262
  # @param [String] fields
189
263
  # Selector specifying which fields to include in a partial response.
190
- # @param [Google::Apis::RequestOptions] options
191
- # Request-specific options
192
- #
193
- # @yield [result, err] Result & error if block supplied
194
- # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
195
- # @yieldparam err [StandardError] error object if request failed
196
- #
197
- # @return [Google::Apis::ClassroomV1::Empty]
198
- #
199
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
200
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
201
- # @raise [Google::Apis::AuthorizationError] Authorization is required
202
- def delete_invitation(id, quota_user: nil, fields: nil, options: nil, &block)
203
- command = make_simple_command(:delete, 'v1/invitations/{id}', options)
204
- command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
205
- command.response_class = Google::Apis::ClassroomV1::Empty
206
- command.params['id'] = id unless id.nil?
207
- command.query['quotaUser'] = quota_user unless quota_user.nil?
208
- command.query['fields'] = fields unless fields.nil?
209
- execute_or_queue_command(command, &block)
210
- end
211
-
212
- # Accepts an invitation, removing it and adding the invited user to the
213
- # teachers or students (as appropriate) of the specified course. Only the
214
- # invited user may accept an invitation.
215
- # This method returns the following error codes:
216
- # * `PERMISSION_DENIED` if the requesting user is not permitted to accept the
217
- # requested invitation or for access errors.
218
- # * `FAILED_PRECONDITION` for the following request errors:
219
- # * CourseMemberLimitReached
220
- # * CourseNotModifiable
221
- # * CourseTeacherLimitReached
222
- # * UserGroupsMembershipLimitReached
223
- # * `NOT_FOUND` if no invitation exists with the requested ID.
224
- # @param [String] id
225
- # Identifier of the invitation to accept.
226
264
  # @param [String] quota_user
227
265
  # Available to use for quota purposes for server-side applications. Can be any
228
266
  # arbitrary string assigned to a user, but should not exceed 40 characters.
229
- # @param [String] fields
230
- # Selector specifying which fields to include in a partial response.
231
267
  # @param [Google::Apis::RequestOptions] options
232
268
  # Request-specific options
233
269
  #
@@ -240,13 +276,13 @@ module Google
240
276
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
241
277
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
242
278
  # @raise [Google::Apis::AuthorizationError] Authorization is required
243
- def accept_invitation(id, quota_user: nil, fields: nil, options: nil, &block)
244
- command = make_simple_command(:post, 'v1/invitations/{id}:accept', options)
279
+ def delete_course(id, fields: nil, quota_user: nil, options: nil, &block)
280
+ command = make_simple_command(:delete, 'v1/courses/{id}', options)
245
281
  command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
246
282
  command.response_class = Google::Apis::ClassroomV1::Empty
247
283
  command.params['id'] = id unless id.nil?
248
- command.query['quotaUser'] = quota_user unless quota_user.nil?
249
284
  command.query['fields'] = fields unless fields.nil?
285
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
250
286
  execute_or_queue_command(command, &block)
251
287
  end
252
288
 
@@ -256,19 +292,6 @@ module Google
256
292
  # * `PERMISSION_DENIED` for access errors.
257
293
  # * `INVALID_ARGUMENT` if the query argument is malformed.
258
294
  # * `NOT_FOUND` if any users specified in the query arguments do not exist.
259
- # @param [Array<String>, String] course_states
260
- # Restricts returned courses to those in one of the specified states
261
- # The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED.
262
- # @param [Fixnum] page_size
263
- # Maximum number of items to return. Zero or unspecified indicates that the
264
- # server may assign a maximum.
265
- # The server may return fewer than the specified number of results.
266
- # @param [String] teacher_id
267
- # Restricts returned courses to those having a teacher with the specified
268
- # identifier. The identifier can be one of the following:
269
- # * the numeric identifier for the user
270
- # * the email address of the user
271
- # * the string literal `"me"`, indicating the requesting user
272
295
  # @param [String] student_id
273
296
  # Restricts returned courses to those having a student with the specified
274
297
  # identifier. The identifier can be one of the following:
@@ -282,11 +305,24 @@ module Google
282
305
  # indicating that the subsequent page of results should be returned.
283
306
  # The list request must be
284
307
  # otherwise identical to the one that resulted in this token.
308
+ # @param [Fixnum] page_size
309
+ # Maximum number of items to return. Zero or unspecified indicates that the
310
+ # server may assign a maximum.
311
+ # The server may return fewer than the specified number of results.
312
+ # @param [String] teacher_id
313
+ # Restricts returned courses to those having a teacher with the specified
314
+ # identifier. The identifier can be one of the following:
315
+ # * the numeric identifier for the user
316
+ # * the email address of the user
317
+ # * the string literal `"me"`, indicating the requesting user
318
+ # @param [Array<String>, String] course_states
319
+ # Restricts returned courses to those in one of the specified states
320
+ # The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED.
321
+ # @param [String] fields
322
+ # Selector specifying which fields to include in a partial response.
285
323
  # @param [String] quota_user
286
324
  # Available to use for quota purposes for server-side applications. Can be any
287
325
  # arbitrary string assigned to a user, but should not exceed 40 characters.
288
- # @param [String] fields
289
- # Selector specifying which fields to include in a partial response.
290
326
  # @param [Google::Apis::RequestOptions] options
291
327
  # Request-specific options
292
328
  #
@@ -299,53 +335,17 @@ module Google
299
335
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
300
336
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
301
337
  # @raise [Google::Apis::AuthorizationError] Authorization is required
302
- def list_courses(course_states: nil, page_size: nil, teacher_id: nil, student_id: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
338
+ def list_courses(student_id: nil, page_token: nil, page_size: nil, teacher_id: nil, course_states: nil, fields: nil, quota_user: nil, options: nil, &block)
303
339
  command = make_simple_command(:get, 'v1/courses', options)
304
340
  command.response_representation = Google::Apis::ClassroomV1::ListCoursesResponse::Representation
305
341
  command.response_class = Google::Apis::ClassroomV1::ListCoursesResponse
306
- command.query['courseStates'] = course_states unless course_states.nil?
307
- command.query['pageSize'] = page_size unless page_size.nil?
308
- command.query['teacherId'] = teacher_id unless teacher_id.nil?
309
342
  command.query['studentId'] = student_id unless student_id.nil?
310
343
  command.query['pageToken'] = page_token unless page_token.nil?
311
- command.query['quotaUser'] = quota_user unless quota_user.nil?
344
+ command.query['pageSize'] = page_size unless page_size.nil?
345
+ command.query['teacherId'] = teacher_id unless teacher_id.nil?
346
+ command.query['courseStates'] = course_states unless course_states.nil?
312
347
  command.query['fields'] = fields unless fields.nil?
313
- execute_or_queue_command(command, &block)
314
- end
315
-
316
- # Returns a course.
317
- # This method returns the following error codes:
318
- # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
319
- # requested course or for access errors.
320
- # * `NOT_FOUND` if no course exists with the requested ID.
321
- # @param [String] id
322
- # Identifier of the course to return.
323
- # This identifier can be either the Classroom-assigned identifier or an
324
- # alias.
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
- # @param [String] fields
329
- # Selector specifying which fields to include in a partial response.
330
- # @param [Google::Apis::RequestOptions] options
331
- # Request-specific options
332
- #
333
- # @yield [result, err] Result & error if block supplied
334
- # @yieldparam result [Google::Apis::ClassroomV1::Course] parsed result object
335
- # @yieldparam err [StandardError] error object if request failed
336
- #
337
- # @return [Google::Apis::ClassroomV1::Course]
338
- #
339
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
340
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
341
- # @raise [Google::Apis::AuthorizationError] Authorization is required
342
- def get_course(id, quota_user: nil, fields: nil, options: nil, &block)
343
- command = make_simple_command(:get, 'v1/courses/{id}', options)
344
- command.response_representation = Google::Apis::ClassroomV1::Course::Representation
345
- command.response_class = Google::Apis::ClassroomV1::Course
346
- command.params['id'] = id unless id.nil?
347
348
  command.query['quotaUser'] = quota_user unless quota_user.nil?
348
- command.query['fields'] = fields unless fields.nil?
349
349
  execute_or_queue_command(command, &block)
350
350
  end
351
351
 
@@ -362,11 +362,11 @@ module Google
362
362
  # * `ALREADY_EXISTS` if an alias was specified in the `id` and
363
363
  # already exists.
364
364
  # @param [Google::Apis::ClassroomV1::Course] course_object
365
+ # @param [String] fields
366
+ # Selector specifying which fields to include in a partial response.
365
367
  # @param [String] quota_user
366
368
  # Available to use for quota purposes for server-side applications. Can be any
367
369
  # arbitrary string assigned to a user, but should not exceed 40 characters.
368
- # @param [String] fields
369
- # Selector specifying which fields to include in a partial response.
370
370
  # @param [Google::Apis::RequestOptions] options
371
371
  # Request-specific options
372
372
  #
@@ -379,22 +379,24 @@ module Google
379
379
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
380
380
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
381
381
  # @raise [Google::Apis::AuthorizationError] Authorization is required
382
- def create_course(course_object = nil, quota_user: nil, fields: nil, options: nil, &block)
382
+ def create_course(course_object = nil, fields: nil, quota_user: nil, options: nil, &block)
383
383
  command = make_simple_command(:post, 'v1/courses', options)
384
384
  command.request_representation = Google::Apis::ClassroomV1::Course::Representation
385
385
  command.request_object = course_object
386
386
  command.response_representation = Google::Apis::ClassroomV1::Course::Representation
387
387
  command.response_class = Google::Apis::ClassroomV1::Course
388
- command.query['quotaUser'] = quota_user unless quota_user.nil?
389
388
  command.query['fields'] = fields unless fields.nil?
389
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
390
390
  execute_or_queue_command(command, &block)
391
391
  end
392
392
 
393
- # Updates a course.
393
+ # Updates one or more fields in a course.
394
394
  # This method returns the following error codes:
395
395
  # * `PERMISSION_DENIED` if the requesting user is not permitted to modify the
396
396
  # requested course or for access errors.
397
397
  # * `NOT_FOUND` if no course exists with the requested ID.
398
+ # * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or
399
+ # if no update mask is supplied.
398
400
  # * `FAILED_PRECONDITION` for the following request errors:
399
401
  # * CourseNotModifiable
400
402
  # @param [String] id
@@ -402,11 +404,23 @@ module Google
402
404
  # This identifier can be either the Classroom-assigned identifier or an
403
405
  # alias.
404
406
  # @param [Google::Apis::ClassroomV1::Course] course_object
407
+ # @param [String] update_mask
408
+ # Mask that identifies which fields on the course to update.
409
+ # This field is required to do an update. The update will fail if invalid
410
+ # fields are specified. The following fields are valid:
411
+ # * `name`
412
+ # * `section`
413
+ # * `descriptionHeading`
414
+ # * `description`
415
+ # * `room`
416
+ # * `courseState`
417
+ # When set in a query parameter, this field should be specified as
418
+ # `updateMask=<field1>,<field2>,...`
419
+ # @param [String] fields
420
+ # Selector specifying which fields to include in a partial response.
405
421
  # @param [String] quota_user
406
422
  # Available to use for quota purposes for server-side applications. Can be any
407
423
  # arbitrary string assigned to a user, but should not exceed 40 characters.
408
- # @param [String] fields
409
- # Selector specifying which fields to include in a partial response.
410
424
  # @param [Google::Apis::RequestOptions] options
411
425
  # Request-specific options
412
426
  #
@@ -419,49 +433,33 @@ module Google
419
433
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
420
434
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
421
435
  # @raise [Google::Apis::AuthorizationError] Authorization is required
422
- def update_course(id, course_object = nil, quota_user: nil, fields: nil, options: nil, &block)
423
- command = make_simple_command(:put, 'v1/courses/{id}', options)
436
+ def patch_course(id, course_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
437
+ command = make_simple_command(:patch, 'v1/courses/{id}', options)
424
438
  command.request_representation = Google::Apis::ClassroomV1::Course::Representation
425
439
  command.request_object = course_object
426
440
  command.response_representation = Google::Apis::ClassroomV1::Course::Representation
427
441
  command.response_class = Google::Apis::ClassroomV1::Course
428
442
  command.params['id'] = id unless id.nil?
429
- command.query['quotaUser'] = quota_user unless quota_user.nil?
443
+ command.query['updateMask'] = update_mask unless update_mask.nil?
430
444
  command.query['fields'] = fields unless fields.nil?
445
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
431
446
  execute_or_queue_command(command, &block)
432
447
  end
433
448
 
434
- # Updates one or more fields in a course.
449
+ # Returns a course.
435
450
  # This method returns the following error codes:
436
- # * `PERMISSION_DENIED` if the requesting user is not permitted to modify the
451
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
437
452
  # requested course or for access errors.
438
453
  # * `NOT_FOUND` if no course exists with the requested ID.
439
- # * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or
440
- # if no update mask is supplied.
441
- # * `FAILED_PRECONDITION` for the following request errors:
442
- # * CourseNotModifiable
443
454
  # @param [String] id
444
- # Identifier of the course to update.
455
+ # Identifier of the course to return.
445
456
  # This identifier can be either the Classroom-assigned identifier or an
446
457
  # alias.
447
- # @param [Google::Apis::ClassroomV1::Course] course_object
448
- # @param [String] update_mask
449
- # Mask that identifies which fields on the course to update.
450
- # This field is required to do an update. The update will fail if invalid
451
- # fields are specified. The following fields are valid:
452
- # * `name`
453
- # * `section`
454
- # * `descriptionHeading`
455
- # * `description`
456
- # * `room`
457
- # * `courseState`
458
- # When set in a query parameter, this field should be specified as
459
- # `updateMask=<field1>,<field2>,...`
458
+ # @param [String] fields
459
+ # Selector specifying which fields to include in a partial response.
460
460
  # @param [String] quota_user
461
461
  # Available to use for quota purposes for server-side applications. Can be any
462
462
  # arbitrary string assigned to a user, but should not exceed 40 characters.
463
- # @param [String] fields
464
- # Selector specifying which fields to include in a partial response.
465
463
  # @param [Google::Apis::RequestOptions] options
466
464
  # Request-specific options
467
465
  #
@@ -474,372 +472,281 @@ module Google
474
472
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
475
473
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
476
474
  # @raise [Google::Apis::AuthorizationError] Authorization is required
477
- def patch_course(id, course_object = nil, update_mask: nil, quota_user: nil, fields: nil, options: nil, &block)
478
- command = make_simple_command(:patch, 'v1/courses/{id}', options)
479
- command.request_representation = Google::Apis::ClassroomV1::Course::Representation
480
- command.request_object = course_object
475
+ def get_course(id, fields: nil, quota_user: nil, options: nil, &block)
476
+ command = make_simple_command(:get, 'v1/courses/{id}', options)
481
477
  command.response_representation = Google::Apis::ClassroomV1::Course::Representation
482
478
  command.response_class = Google::Apis::ClassroomV1::Course
483
479
  command.params['id'] = id unless id.nil?
484
- command.query['updateMask'] = update_mask unless update_mask.nil?
485
- command.query['quotaUser'] = quota_user unless quota_user.nil?
486
480
  command.query['fields'] = fields unless fields.nil?
481
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
487
482
  execute_or_queue_command(command, &block)
488
483
  end
489
484
 
490
- # Deletes a course.
485
+ # Updates a course.
491
486
  # This method returns the following error codes:
492
- # * `PERMISSION_DENIED` if the requesting user is not permitted to delete the
487
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to modify the
493
488
  # requested course or for access errors.
494
489
  # * `NOT_FOUND` if no course exists with the requested ID.
490
+ # * `FAILED_PRECONDITION` for the following request errors:
491
+ # * CourseNotModifiable
495
492
  # @param [String] id
496
- # Identifier of the course to delete.
493
+ # Identifier of the course to update.
497
494
  # This identifier can be either the Classroom-assigned identifier or an
498
495
  # alias.
496
+ # @param [Google::Apis::ClassroomV1::Course] course_object
497
+ # @param [String] fields
498
+ # Selector specifying which fields to include in a partial response.
499
499
  # @param [String] quota_user
500
500
  # Available to use for quota purposes for server-side applications. Can be any
501
501
  # arbitrary string assigned to a user, but should not exceed 40 characters.
502
- # @param [String] fields
503
- # Selector specifying which fields to include in a partial response.
504
502
  # @param [Google::Apis::RequestOptions] options
505
503
  # Request-specific options
506
504
  #
507
505
  # @yield [result, err] Result & error if block supplied
508
- # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
506
+ # @yieldparam result [Google::Apis::ClassroomV1::Course] parsed result object
509
507
  # @yieldparam err [StandardError] error object if request failed
510
508
  #
511
- # @return [Google::Apis::ClassroomV1::Empty]
509
+ # @return [Google::Apis::ClassroomV1::Course]
512
510
  #
513
511
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
514
512
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
515
513
  # @raise [Google::Apis::AuthorizationError] Authorization is required
516
- def delete_course(id, quota_user: nil, fields: nil, options: nil, &block)
517
- command = make_simple_command(:delete, 'v1/courses/{id}', options)
518
- command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
519
- command.response_class = Google::Apis::ClassroomV1::Empty
514
+ def update_course(id, course_object = nil, fields: nil, quota_user: nil, options: nil, &block)
515
+ command = make_simple_command(:put, 'v1/courses/{id}', options)
516
+ command.request_representation = Google::Apis::ClassroomV1::Course::Representation
517
+ command.request_object = course_object
518
+ command.response_representation = Google::Apis::ClassroomV1::Course::Representation
519
+ command.response_class = Google::Apis::ClassroomV1::Course
520
520
  command.params['id'] = id unless id.nil?
521
- command.query['quotaUser'] = quota_user unless quota_user.nil?
522
521
  command.query['fields'] = fields unless fields.nil?
522
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
523
523
  execute_or_queue_command(command, &block)
524
524
  end
525
525
 
526
- # Creates a teacher of a course.
526
+ # Deletes an alias of a course.
527
527
  # This method returns the following error codes:
528
- # * `PERMISSION_DENIED` if the requesting user is not permitted to create
529
- # teachers in this course or for access errors.
530
- # * `NOT_FOUND` if the requested course ID does not exist.
531
- # * `FAILED_PRECONDITION` if the requested user's account is disabled,
532
- # for the following request errors:
533
- # * CourseMemberLimitReached
534
- # * CourseNotModifiable
535
- # * CourseTeacherLimitReached
536
- # * UserGroupsMembershipLimitReached
537
- # * `ALREADY_EXISTS` if the user is already a teacher or student in the
538
- # course.
528
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to remove the
529
+ # alias or for access errors.
530
+ # * `NOT_FOUND` if the alias does not exist.
531
+ # * `FAILED_PRECONDITION` if the alias requested does not make sense for the
532
+ # requesting user or course (for example, if a user not in a domain
533
+ # attempts to delete a domain-scoped alias).
539
534
  # @param [String] course_id
540
- # Identifier of the course.
535
+ # Identifier of the course whose alias should be deleted.
541
536
  # This identifier can be either the Classroom-assigned identifier or an
542
537
  # alias.
543
- # @param [Google::Apis::ClassroomV1::Teacher] teacher_object
538
+ # @param [String] alias_
539
+ # Alias to delete.
540
+ # This may not be the Classroom-assigned identifier.
541
+ # @param [String] fields
542
+ # Selector specifying which fields to include in a partial response.
544
543
  # @param [String] quota_user
545
544
  # Available to use for quota purposes for server-side applications. Can be any
546
545
  # arbitrary string assigned to a user, but should not exceed 40 characters.
547
- # @param [String] fields
548
- # Selector specifying which fields to include in a partial response.
549
546
  # @param [Google::Apis::RequestOptions] options
550
547
  # Request-specific options
551
548
  #
552
549
  # @yield [result, err] Result & error if block supplied
553
- # @yieldparam result [Google::Apis::ClassroomV1::Teacher] parsed result object
550
+ # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
554
551
  # @yieldparam err [StandardError] error object if request failed
555
552
  #
556
- # @return [Google::Apis::ClassroomV1::Teacher]
553
+ # @return [Google::Apis::ClassroomV1::Empty]
557
554
  #
558
555
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
559
556
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
560
557
  # @raise [Google::Apis::AuthorizationError] Authorization is required
561
- def create_course_teacher(course_id, teacher_object = nil, quota_user: nil, fields: nil, options: nil, &block)
562
- command = make_simple_command(:post, 'v1/courses/{courseId}/teachers', options)
563
- command.request_representation = Google::Apis::ClassroomV1::Teacher::Representation
564
- command.request_object = teacher_object
565
- command.response_representation = Google::Apis::ClassroomV1::Teacher::Representation
566
- command.response_class = Google::Apis::ClassroomV1::Teacher
558
+ def delete_course_alias(course_id, alias_, fields: nil, quota_user: nil, options: nil, &block)
559
+ command = make_simple_command(:delete, 'v1/courses/{courseId}/aliases/{alias}', options)
560
+ command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
561
+ command.response_class = Google::Apis::ClassroomV1::Empty
567
562
  command.params['courseId'] = course_id unless course_id.nil?
568
- command.query['quotaUser'] = quota_user unless quota_user.nil?
563
+ command.params['alias'] = alias_ unless alias_.nil?
569
564
  command.query['fields'] = fields unless fields.nil?
565
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
570
566
  execute_or_queue_command(command, &block)
571
567
  end
572
568
 
573
- # Returns a teacher of a course.
569
+ # Returns a list of aliases for a course.
574
570
  # This method returns the following error codes:
575
- # * `PERMISSION_DENIED` if the requesting user is not permitted to view
576
- # teachers of this course or for access errors.
577
- # * `NOT_FOUND` if no teacher of this course has the requested ID or if the
578
- # course does not exist.
571
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
572
+ # course or for access errors.
573
+ # * `NOT_FOUND` if the course does not exist.
579
574
  # @param [String] course_id
580
- # Identifier of the course.
575
+ # The identifier of the course.
581
576
  # This identifier can be either the Classroom-assigned identifier or an
582
577
  # alias.
583
- # @param [String] user_id
584
- # Identifier of the teacher to return. The identifier can be one of the
585
- # following:
586
- # * the numeric identifier for the user
587
- # * the email address of the user
588
- # * the string literal `"me"`, indicating the requesting user
578
+ # @param [String] page_token
579
+ # nextPageToken
580
+ # value returned from a previous
581
+ # list call,
582
+ # indicating that the subsequent page of results should be returned.
583
+ # The list request
584
+ # must be otherwise identical to the one that resulted in this token.
585
+ # @param [Fixnum] page_size
586
+ # Maximum number of items to return. Zero or unspecified indicates that the
587
+ # server may assign a maximum.
588
+ # The server may return fewer than the specified number of results.
589
+ # @param [String] fields
590
+ # Selector specifying which fields to include in a partial response.
589
591
  # @param [String] quota_user
590
592
  # Available to use for quota purposes for server-side applications. Can be any
591
593
  # arbitrary string assigned to a user, but should not exceed 40 characters.
592
- # @param [String] fields
593
- # Selector specifying which fields to include in a partial response.
594
594
  # @param [Google::Apis::RequestOptions] options
595
595
  # Request-specific options
596
596
  #
597
597
  # @yield [result, err] Result & error if block supplied
598
- # @yieldparam result [Google::Apis::ClassroomV1::Teacher] parsed result object
598
+ # @yieldparam result [Google::Apis::ClassroomV1::ListCourseAliasesResponse] parsed result object
599
599
  # @yieldparam err [StandardError] error object if request failed
600
600
  #
601
- # @return [Google::Apis::ClassroomV1::Teacher]
601
+ # @return [Google::Apis::ClassroomV1::ListCourseAliasesResponse]
602
602
  #
603
603
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
604
604
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
605
605
  # @raise [Google::Apis::AuthorizationError] Authorization is required
606
- def get_course_teacher(course_id, user_id, quota_user: nil, fields: nil, options: nil, &block)
607
- command = make_simple_command(:get, 'v1/courses/{courseId}/teachers/{userId}', options)
608
- command.response_representation = Google::Apis::ClassroomV1::Teacher::Representation
609
- command.response_class = Google::Apis::ClassroomV1::Teacher
606
+ def list_course_aliases(course_id, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
607
+ command = make_simple_command(:get, 'v1/courses/{courseId}/aliases', options)
608
+ command.response_representation = Google::Apis::ClassroomV1::ListCourseAliasesResponse::Representation
609
+ command.response_class = Google::Apis::ClassroomV1::ListCourseAliasesResponse
610
610
  command.params['courseId'] = course_id unless course_id.nil?
611
- command.params['userId'] = user_id unless user_id.nil?
612
- command.query['quotaUser'] = quota_user unless quota_user.nil?
611
+ command.query['pageToken'] = page_token unless page_token.nil?
612
+ command.query['pageSize'] = page_size unless page_size.nil?
613
613
  command.query['fields'] = fields unless fields.nil?
614
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
614
615
  execute_or_queue_command(command, &block)
615
616
  end
616
617
 
617
- # Returns a list of teachers of this course that the requester
618
- # is permitted to view.
618
+ # Creates an alias for a course.
619
619
  # This method returns the following error codes:
620
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to create the
621
+ # alias or for access errors.
620
622
  # * `NOT_FOUND` if the course does not exist.
621
- # * `PERMISSION_DENIED` for access errors.
623
+ # * `ALREADY_EXISTS` if the alias already exists.
624
+ # * `FAILED_PRECONDITION` if the alias requested does not make sense for the
625
+ # requesting user or course (for example, if a user not in a domain
626
+ # attempts to access a domain-scoped alias).
622
627
  # @param [String] course_id
623
- # Identifier of the course.
628
+ # Identifier of the course to alias.
624
629
  # This identifier can be either the Classroom-assigned identifier or an
625
630
  # alias.
626
- # @param [Fixnum] page_size
627
- # Maximum number of items to return. Zero means no maximum.
628
- # The server may return fewer than the specified number of results.
629
- # @param [String] page_token
630
- # nextPageToken
631
- # value returned from a previous
632
- # list call, indicating that
633
- # the subsequent page of results should be returned.
634
- # The list request must be
635
- # otherwise identical to the one that resulted in this token.
631
+ # @param [Google::Apis::ClassroomV1::CourseAlias] course_alias_object
632
+ # @param [String] fields
633
+ # Selector specifying which fields to include in a partial response.
636
634
  # @param [String] quota_user
637
635
  # Available to use for quota purposes for server-side applications. Can be any
638
636
  # arbitrary string assigned to a user, but should not exceed 40 characters.
639
- # @param [String] fields
640
- # Selector specifying which fields to include in a partial response.
641
637
  # @param [Google::Apis::RequestOptions] options
642
638
  # Request-specific options
643
639
  #
644
640
  # @yield [result, err] Result & error if block supplied
645
- # @yieldparam result [Google::Apis::ClassroomV1::ListTeachersResponse] parsed result object
641
+ # @yieldparam result [Google::Apis::ClassroomV1::CourseAlias] parsed result object
646
642
  # @yieldparam err [StandardError] error object if request failed
647
643
  #
648
- # @return [Google::Apis::ClassroomV1::ListTeachersResponse]
644
+ # @return [Google::Apis::ClassroomV1::CourseAlias]
649
645
  #
650
646
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
651
647
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
652
648
  # @raise [Google::Apis::AuthorizationError] Authorization is required
653
- def list_course_teachers(course_id, page_size: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
654
- command = make_simple_command(:get, 'v1/courses/{courseId}/teachers', options)
655
- command.response_representation = Google::Apis::ClassroomV1::ListTeachersResponse::Representation
656
- command.response_class = Google::Apis::ClassroomV1::ListTeachersResponse
649
+ def create_course_alias(course_id, course_alias_object = nil, fields: nil, quota_user: nil, options: nil, &block)
650
+ command = make_simple_command(:post, 'v1/courses/{courseId}/aliases', options)
651
+ command.request_representation = Google::Apis::ClassroomV1::CourseAlias::Representation
652
+ command.request_object = course_alias_object
653
+ command.response_representation = Google::Apis::ClassroomV1::CourseAlias::Representation
654
+ command.response_class = Google::Apis::ClassroomV1::CourseAlias
657
655
  command.params['courseId'] = course_id unless course_id.nil?
658
- command.query['pageSize'] = page_size unless page_size.nil?
659
- command.query['pageToken'] = page_token unless page_token.nil?
660
- command.query['quotaUser'] = quota_user unless quota_user.nil?
661
656
  command.query['fields'] = fields unless fields.nil?
657
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
662
658
  execute_or_queue_command(command, &block)
663
659
  end
664
660
 
665
- # Deletes a teacher of a course.
661
+ # Returns a student of a course.
666
662
  # This method returns the following error codes:
667
- # * `PERMISSION_DENIED` if the requesting user is not permitted to delete
668
- # teachers of this course or for access errors.
669
- # * `NOT_FOUND` if no teacher of this course has the requested ID or if the
663
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to view
664
+ # students of this course or for access errors.
665
+ # * `NOT_FOUND` if no student of this course has the requested ID or if the
670
666
  # course does not exist.
671
- # * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher
672
- # of this course.
673
667
  # @param [String] course_id
674
668
  # Identifier of the course.
675
669
  # This identifier can be either the Classroom-assigned identifier or an
676
670
  # alias.
677
671
  # @param [String] user_id
678
- # Identifier of the teacher to delete. The identifier can be one of the
672
+ # Identifier of the student to return. The identifier can be one of the
679
673
  # following:
680
674
  # * the numeric identifier for the user
681
675
  # * the email address of the user
682
676
  # * the string literal `"me"`, indicating the requesting user
677
+ # @param [String] fields
678
+ # Selector specifying which fields to include in a partial response.
683
679
  # @param [String] quota_user
684
680
  # Available to use for quota purposes for server-side applications. Can be any
685
681
  # arbitrary string assigned to a user, but should not exceed 40 characters.
686
- # @param [String] fields
687
- # Selector specifying which fields to include in a partial response.
688
682
  # @param [Google::Apis::RequestOptions] options
689
683
  # Request-specific options
690
684
  #
691
685
  # @yield [result, err] Result & error if block supplied
692
- # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
686
+ # @yieldparam result [Google::Apis::ClassroomV1::Student] parsed result object
693
687
  # @yieldparam err [StandardError] error object if request failed
694
688
  #
695
- # @return [Google::Apis::ClassroomV1::Empty]
689
+ # @return [Google::Apis::ClassroomV1::Student]
696
690
  #
697
691
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
698
692
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
699
693
  # @raise [Google::Apis::AuthorizationError] Authorization is required
700
- def delete_course_teacher(course_id, user_id, quota_user: nil, fields: nil, options: nil, &block)
701
- command = make_simple_command(:delete, 'v1/courses/{courseId}/teachers/{userId}', options)
702
- command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
703
- command.response_class = Google::Apis::ClassroomV1::Empty
694
+ def get_course_student(course_id, user_id, fields: nil, quota_user: nil, options: nil, &block)
695
+ command = make_simple_command(:get, 'v1/courses/{courseId}/students/{userId}', options)
696
+ command.response_representation = Google::Apis::ClassroomV1::Student::Representation
697
+ command.response_class = Google::Apis::ClassroomV1::Student
704
698
  command.params['courseId'] = course_id unless course_id.nil?
705
699
  command.params['userId'] = user_id unless user_id.nil?
706
- command.query['quotaUser'] = quota_user unless quota_user.nil?
707
700
  command.query['fields'] = fields unless fields.nil?
701
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
708
702
  execute_or_queue_command(command, &block)
709
703
  end
710
704
 
711
- # Creates an alias for a course.
705
+ # Returns a list of students of this course that the requester
706
+ # is permitted to view.
712
707
  # This method returns the following error codes:
713
- # * `PERMISSION_DENIED` if the requesting user is not permitted to create the
714
- # alias or for access errors.
715
708
  # * `NOT_FOUND` if the course does not exist.
716
- # * `ALREADY_EXISTS` if the alias already exists.
717
- # * `FAILED_PRECONDITION` if the alias requested does not make sense for the
718
- # requesting user or course (for example, if a user not in a domain
719
- # attempts to access a domain-scoped alias).
709
+ # * `PERMISSION_DENIED` for access errors.
720
710
  # @param [String] course_id
721
- # Identifier of the course to alias.
711
+ # Identifier of the course.
722
712
  # This identifier can be either the Classroom-assigned identifier or an
723
713
  # alias.
724
- # @param [Google::Apis::ClassroomV1::CourseAlias] course_alias_object
714
+ # @param [String] page_token
715
+ # nextPageToken
716
+ # value returned from a previous
717
+ # list call, indicating that
718
+ # the subsequent page of results should be returned.
719
+ # The list request must be
720
+ # otherwise identical to the one that resulted in this token.
721
+ # @param [Fixnum] page_size
722
+ # Maximum number of items to return. Zero means no maximum.
723
+ # The server may return fewer than the specified number of results.
724
+ # @param [String] fields
725
+ # Selector specifying which fields to include in a partial response.
725
726
  # @param [String] quota_user
726
727
  # Available to use for quota purposes for server-side applications. Can be any
727
728
  # arbitrary string assigned to a user, but should not exceed 40 characters.
728
- # @param [String] fields
729
- # Selector specifying which fields to include in a partial response.
730
729
  # @param [Google::Apis::RequestOptions] options
731
730
  # Request-specific options
732
731
  #
733
732
  # @yield [result, err] Result & error if block supplied
734
- # @yieldparam result [Google::Apis::ClassroomV1::CourseAlias] parsed result object
733
+ # @yieldparam result [Google::Apis::ClassroomV1::ListStudentsResponse] parsed result object
735
734
  # @yieldparam err [StandardError] error object if request failed
736
735
  #
737
- # @return [Google::Apis::ClassroomV1::CourseAlias]
736
+ # @return [Google::Apis::ClassroomV1::ListStudentsResponse]
738
737
  #
739
738
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
740
739
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
741
740
  # @raise [Google::Apis::AuthorizationError] Authorization is required
742
- def create_course_alias(course_id, course_alias_object = nil, quota_user: nil, fields: nil, options: nil, &block)
743
- command = make_simple_command(:post, 'v1/courses/{courseId}/aliases', options)
744
- command.request_representation = Google::Apis::ClassroomV1::CourseAlias::Representation
745
- command.request_object = course_alias_object
746
- command.response_representation = Google::Apis::ClassroomV1::CourseAlias::Representation
747
- command.response_class = Google::Apis::ClassroomV1::CourseAlias
748
- command.params['courseId'] = course_id unless course_id.nil?
749
- command.query['quotaUser'] = quota_user unless quota_user.nil?
750
- command.query['fields'] = fields unless fields.nil?
751
- execute_or_queue_command(command, &block)
752
- end
753
-
754
- # Returns a list of aliases for a course.
755
- # This method returns the following error codes:
756
- # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
757
- # course or for access errors.
758
- # * `NOT_FOUND` if the course does not exist.
759
- # @param [String] course_id
760
- # The identifier of the course.
761
- # This identifier can be either the Classroom-assigned identifier or an
762
- # alias.
763
- # @param [Fixnum] page_size
764
- # Maximum number of items to return. Zero or unspecified indicates that the
765
- # server may assign a maximum.
766
- # The server may return fewer than the specified number of results.
767
- # @param [String] page_token
768
- # nextPageToken
769
- # value returned from a previous
770
- # list call,
771
- # indicating that the subsequent page of results should be returned.
772
- # The list request
773
- # must be otherwise identical to the one that resulted in this token.
774
- # @param [String] quota_user
775
- # Available to use for quota purposes for server-side applications. Can be any
776
- # arbitrary string assigned to a user, but should not exceed 40 characters.
777
- # @param [String] fields
778
- # Selector specifying which fields to include in a partial response.
779
- # @param [Google::Apis::RequestOptions] options
780
- # Request-specific options
781
- #
782
- # @yield [result, err] Result & error if block supplied
783
- # @yieldparam result [Google::Apis::ClassroomV1::ListCourseAliasesResponse] parsed result object
784
- # @yieldparam err [StandardError] error object if request failed
785
- #
786
- # @return [Google::Apis::ClassroomV1::ListCourseAliasesResponse]
787
- #
788
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
789
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
790
- # @raise [Google::Apis::AuthorizationError] Authorization is required
791
- def list_course_aliases(course_id, page_size: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
792
- command = make_simple_command(:get, 'v1/courses/{courseId}/aliases', options)
793
- command.response_representation = Google::Apis::ClassroomV1::ListCourseAliasesResponse::Representation
794
- command.response_class = Google::Apis::ClassroomV1::ListCourseAliasesResponse
741
+ def list_course_students(course_id, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
742
+ command = make_simple_command(:get, 'v1/courses/{courseId}/students', options)
743
+ command.response_representation = Google::Apis::ClassroomV1::ListStudentsResponse::Representation
744
+ command.response_class = Google::Apis::ClassroomV1::ListStudentsResponse
795
745
  command.params['courseId'] = course_id unless course_id.nil?
796
- command.query['pageSize'] = page_size unless page_size.nil?
797
746
  command.query['pageToken'] = page_token unless page_token.nil?
798
- command.query['quotaUser'] = quota_user unless quota_user.nil?
747
+ command.query['pageSize'] = page_size unless page_size.nil?
799
748
  command.query['fields'] = fields unless fields.nil?
800
- execute_or_queue_command(command, &block)
801
- end
802
-
803
- # Deletes an alias of a course.
804
- # This method returns the following error codes:
805
- # * `PERMISSION_DENIED` if the requesting user is not permitted to remove the
806
- # alias or for access errors.
807
- # * `NOT_FOUND` if the alias does not exist.
808
- # * `FAILED_PRECONDITION` if the alias requested does not make sense for the
809
- # requesting user or course (for example, if a user not in a domain
810
- # attempts to delete a domain-scoped alias).
811
- # @param [String] course_id
812
- # Identifier of the course whose alias should be deleted.
813
- # This identifier can be either the Classroom-assigned identifier or an
814
- # alias.
815
- # @param [String] alias_
816
- # Alias to delete.
817
- # This may not be the Classroom-assigned identifier.
818
- # @param [String] quota_user
819
- # Available to use for quota purposes for server-side applications. Can be any
820
- # arbitrary string assigned to a user, but should not exceed 40 characters.
821
- # @param [String] fields
822
- # Selector specifying which fields to include in a partial response.
823
- # @param [Google::Apis::RequestOptions] options
824
- # Request-specific options
825
- #
826
- # @yield [result, err] Result & error if block supplied
827
- # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
828
- # @yieldparam err [StandardError] error object if request failed
829
- #
830
- # @return [Google::Apis::ClassroomV1::Empty]
831
- #
832
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
833
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
834
- # @raise [Google::Apis::AuthorizationError] Authorization is required
835
- def delete_course_alias(course_id, alias_, quota_user: nil, fields: nil, options: nil, &block)
836
- command = make_simple_command(:delete, 'v1/courses/{courseId}/aliases/{alias}', options)
837
- command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
838
- command.response_class = Google::Apis::ClassroomV1::Empty
839
- command.params['courseId'] = course_id unless course_id.nil?
840
- command.params['alias'] = alias_ unless alias_.nil?
841
749
  command.query['quotaUser'] = quota_user unless quota_user.nil?
842
- command.query['fields'] = fields unless fields.nil?
843
750
  execute_or_queue_command(command, &block)
844
751
  end
845
752
 
@@ -865,11 +772,11 @@ module Google
865
772
  # This code is required if userId
866
773
  # corresponds to the requesting user; it may be omitted if the requesting
867
774
  # user has administrative permissions to create students for any user.
775
+ # @param [String] fields
776
+ # Selector specifying which fields to include in a partial response.
868
777
  # @param [String] quota_user
869
778
  # Available to use for quota purposes for server-side applications. Can be any
870
779
  # arbitrary string assigned to a user, but should not exceed 40 characters.
871
- # @param [String] fields
872
- # Selector specifying which fields to include in a partial response.
873
780
  # @param [Google::Apis::RequestOptions] options
874
781
  # Request-specific options
875
782
  #
@@ -882,7 +789,7 @@ module Google
882
789
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
883
790
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
884
791
  # @raise [Google::Apis::AuthorizationError] Authorization is required
885
- def create_course_student(course_id, student_object = nil, enrollment_code: nil, quota_user: nil, fields: nil, options: nil, &block)
792
+ def create_course_student(course_id, student_object = nil, enrollment_code: nil, fields: nil, quota_user: nil, options: nil, &block)
886
793
  command = make_simple_command(:post, 'v1/courses/{courseId}/students', options)
887
794
  command.request_representation = Google::Apis::ClassroomV1::Student::Representation
888
795
  command.request_object = student_object
@@ -890,14 +797,14 @@ module Google
890
797
  command.response_class = Google::Apis::ClassroomV1::Student
891
798
  command.params['courseId'] = course_id unless course_id.nil?
892
799
  command.query['enrollmentCode'] = enrollment_code unless enrollment_code.nil?
893
- command.query['quotaUser'] = quota_user unless quota_user.nil?
894
800
  command.query['fields'] = fields unless fields.nil?
801
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
895
802
  execute_or_queue_command(command, &block)
896
803
  end
897
804
 
898
- # Returns a student of a course.
805
+ # Deletes a student of a course.
899
806
  # This method returns the following error codes:
900
- # * `PERMISSION_DENIED` if the requesting user is not permitted to view
807
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to delete
901
808
  # students of this course or for access errors.
902
809
  # * `NOT_FOUND` if no student of this course has the requested ID or if the
903
810
  # course does not exist.
@@ -906,108 +813,62 @@ module Google
906
813
  # This identifier can be either the Classroom-assigned identifier or an
907
814
  # alias.
908
815
  # @param [String] user_id
909
- # Identifier of the student to return. The identifier can be one of the
816
+ # Identifier of the student to delete. The identifier can be one of the
910
817
  # following:
911
818
  # * the numeric identifier for the user
912
819
  # * the email address of the user
913
820
  # * the string literal `"me"`, indicating the requesting user
821
+ # @param [String] fields
822
+ # Selector specifying which fields to include in a partial response.
914
823
  # @param [String] quota_user
915
824
  # Available to use for quota purposes for server-side applications. Can be any
916
825
  # arbitrary string assigned to a user, but should not exceed 40 characters.
917
- # @param [String] fields
918
- # Selector specifying which fields to include in a partial response.
919
826
  # @param [Google::Apis::RequestOptions] options
920
827
  # Request-specific options
921
828
  #
922
829
  # @yield [result, err] Result & error if block supplied
923
- # @yieldparam result [Google::Apis::ClassroomV1::Student] parsed result object
830
+ # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
924
831
  # @yieldparam err [StandardError] error object if request failed
925
832
  #
926
- # @return [Google::Apis::ClassroomV1::Student]
833
+ # @return [Google::Apis::ClassroomV1::Empty]
927
834
  #
928
835
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
929
836
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
930
837
  # @raise [Google::Apis::AuthorizationError] Authorization is required
931
- def get_course_student(course_id, user_id, quota_user: nil, fields: nil, options: nil, &block)
932
- command = make_simple_command(:get, 'v1/courses/{courseId}/students/{userId}', options)
933
- command.response_representation = Google::Apis::ClassroomV1::Student::Representation
934
- command.response_class = Google::Apis::ClassroomV1::Student
838
+ def delete_course_student(course_id, user_id, fields: nil, quota_user: nil, options: nil, &block)
839
+ command = make_simple_command(:delete, 'v1/courses/{courseId}/students/{userId}', options)
840
+ command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
841
+ command.response_class = Google::Apis::ClassroomV1::Empty
935
842
  command.params['courseId'] = course_id unless course_id.nil?
936
843
  command.params['userId'] = user_id unless user_id.nil?
937
- command.query['quotaUser'] = quota_user unless quota_user.nil?
938
844
  command.query['fields'] = fields unless fields.nil?
845
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
939
846
  execute_or_queue_command(command, &block)
940
847
  end
941
848
 
942
- # Returns a list of students of this course that the requester
943
- # is permitted to view.
849
+ # Deletes a course work.
850
+ # This request must be made by the Developer Console project of the
851
+ # [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
852
+ # create the corresponding course work item.
944
853
  # This method returns the following error codes:
945
- # * `NOT_FOUND` if the course does not exist.
946
- # * `PERMISSION_DENIED` for access errors.
854
+ # * `PERMISSION_DENIED` if the requesting developer project did not create
855
+ # the corresponding course work, if the requesting user is not permitted
856
+ # to delete the requested course or for access errors.
857
+ # * `FAILED_PRECONDITION` if the requested course work has already been
858
+ # deleted.
859
+ # * `NOT_FOUND` if no course exists with the requested ID.
947
860
  # @param [String] course_id
948
861
  # Identifier of the course.
949
862
  # This identifier can be either the Classroom-assigned identifier or an
950
863
  # alias.
951
- # @param [Fixnum] page_size
952
- # Maximum number of items to return. Zero means no maximum.
953
- # The server may return fewer than the specified number of results.
954
- # @param [String] page_token
955
- # nextPageToken
956
- # value returned from a previous
957
- # list call, indicating that
958
- # the subsequent page of results should be returned.
959
- # The list request must be
960
- # otherwise identical to the one that resulted in this token.
961
- # @param [String] quota_user
962
- # Available to use for quota purposes for server-side applications. Can be any
963
- # arbitrary string assigned to a user, but should not exceed 40 characters.
864
+ # @param [String] id
865
+ # Identifier of the course work to delete.
866
+ # This identifier is a Classroom-assigned identifier.
964
867
  # @param [String] fields
965
868
  # Selector specifying which fields to include in a partial response.
966
- # @param [Google::Apis::RequestOptions] options
967
- # Request-specific options
968
- #
969
- # @yield [result, err] Result & error if block supplied
970
- # @yieldparam result [Google::Apis::ClassroomV1::ListStudentsResponse] parsed result object
971
- # @yieldparam err [StandardError] error object if request failed
972
- #
973
- # @return [Google::Apis::ClassroomV1::ListStudentsResponse]
974
- #
975
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
976
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
977
- # @raise [Google::Apis::AuthorizationError] Authorization is required
978
- def list_course_students(course_id, page_size: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
979
- command = make_simple_command(:get, 'v1/courses/{courseId}/students', options)
980
- command.response_representation = Google::Apis::ClassroomV1::ListStudentsResponse::Representation
981
- command.response_class = Google::Apis::ClassroomV1::ListStudentsResponse
982
- command.params['courseId'] = course_id unless course_id.nil?
983
- command.query['pageSize'] = page_size unless page_size.nil?
984
- command.query['pageToken'] = page_token unless page_token.nil?
985
- command.query['quotaUser'] = quota_user unless quota_user.nil?
986
- command.query['fields'] = fields unless fields.nil?
987
- execute_or_queue_command(command, &block)
988
- end
989
-
990
- # Deletes a student of a course.
991
- # This method returns the following error codes:
992
- # * `PERMISSION_DENIED` if the requesting user is not permitted to delete
993
- # students of this course or for access errors.
994
- # * `NOT_FOUND` if no student of this course has the requested ID or if the
995
- # course does not exist.
996
- # @param [String] course_id
997
- # Identifier of the course.
998
- # This identifier can be either the Classroom-assigned identifier or an
999
- # alias.
1000
- # @param [String] user_id
1001
- # Identifier of the student to delete. The identifier can be one of the
1002
- # following:
1003
- # * the numeric identifier for the user
1004
- # * the email address of the user
1005
- # * the string literal `"me"`, indicating the requesting user
1006
869
  # @param [String] quota_user
1007
870
  # Available to use for quota purposes for server-side applications. Can be any
1008
871
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1009
- # @param [String] fields
1010
- # Selector specifying which fields to include in a partial response.
1011
872
  # @param [Google::Apis::RequestOptions] options
1012
873
  # Request-specific options
1013
874
  #
@@ -1020,42 +881,61 @@ module Google
1020
881
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1021
882
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1022
883
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1023
- def delete_course_student(course_id, user_id, quota_user: nil, fields: nil, options: nil, &block)
1024
- command = make_simple_command(:delete, 'v1/courses/{courseId}/students/{userId}', options)
884
+ def delete_course_course_work(course_id, id, fields: nil, quota_user: nil, options: nil, &block)
885
+ command = make_simple_command(:delete, 'v1/courses/{courseId}/courseWork/{id}', options)
1025
886
  command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
1026
887
  command.response_class = Google::Apis::ClassroomV1::Empty
1027
888
  command.params['courseId'] = course_id unless course_id.nil?
1028
- command.params['userId'] = user_id unless user_id.nil?
1029
- command.query['quotaUser'] = quota_user unless quota_user.nil?
889
+ command.params['id'] = id unless id.nil?
1030
890
  command.query['fields'] = fields unless fields.nil?
891
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1031
892
  execute_or_queue_command(command, &block)
1032
893
  end
1033
894
 
1034
- # Creates course work.
1035
- # The resulting course work (and corresponding student submissions) are
1036
- # associated with the Developer Console project of the
895
+ # Updates one or more fields of a course work.
896
+ # See google.classroom.v1.CourseWork for details
897
+ # of which fields may be updated and who may change them.
898
+ # This request must be made by the Developer Console project of the
1037
899
  # [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1038
- # make the request. Classroom API requests to modify course work and student
1039
- # submissions must be made with an OAuth client ID from the associated
1040
- # Developer Console project.
900
+ # create the corresponding course work item.
1041
901
  # This method returns the following error codes:
1042
- # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
1043
- # requested course, create course work in the requested course, share a
1044
- # Drive attachment, or for access errors.
902
+ # * `PERMISSION_DENIED` if the requesting developer project did not create
903
+ # the corresponding course work, if the user is not permitted to make the
904
+ # requested modification to the student submission, or for
905
+ # access errors.
1045
906
  # * `INVALID_ARGUMENT` if the request is malformed.
1046
- # * `NOT_FOUND` if the requested course does not exist.
1047
- # * `FAILED_PRECONDITION` for the following request error:
1048
- # * AttachmentNotVisible
907
+ # * `FAILED_PRECONDITION` if the requested course work has already been
908
+ # deleted.
909
+ # * `NOT_FOUND` if the requested course, course work, or student submission
910
+ # does not exist.
1049
911
  # @param [String] course_id
1050
912
  # Identifier of the course.
1051
913
  # This identifier can be either the Classroom-assigned identifier or an
1052
914
  # alias.
915
+ # @param [String] id
916
+ # Identifier of the course work.
1053
917
  # @param [Google::Apis::ClassroomV1::CourseWork] course_work_object
918
+ # @param [String] update_mask
919
+ # Mask that identifies which fields on the course work to update.
920
+ # This field is required to do an update. The update fails if invalid
921
+ # fields are specified. If a field supports empty values, it can be cleared
922
+ # by specifying it in the update mask and not in the CourseWork object. If a
923
+ # field that does not support empty values is included in the update mask and
924
+ # not set in the CourseWork object, an `INVALID_ARGUMENT` error will be
925
+ # returned.
926
+ # The following fields may be specified by teachers:
927
+ # * `title`
928
+ # * `description`
929
+ # * `state`
930
+ # * `due_date`
931
+ # * `due_time`
932
+ # * `max_points`
933
+ # * `submission_modification_mode`
934
+ # @param [String] fields
935
+ # Selector specifying which fields to include in a partial response.
1054
936
  # @param [String] quota_user
1055
937
  # Available to use for quota purposes for server-side applications. Can be any
1056
938
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1057
- # @param [String] fields
1058
- # Selector specifying which fields to include in a partial response.
1059
939
  # @param [Google::Apis::RequestOptions] options
1060
940
  # Request-specific options
1061
941
  #
@@ -1068,15 +948,17 @@ module Google
1068
948
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1069
949
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1070
950
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1071
- def create_course_work(course_id, course_work_object = nil, quota_user: nil, fields: nil, options: nil, &block)
1072
- command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork', options)
951
+ def patch_course_course_work(course_id, id, course_work_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
952
+ command = make_simple_command(:patch, 'v1/courses/{courseId}/courseWork/{id}', options)
1073
953
  command.request_representation = Google::Apis::ClassroomV1::CourseWork::Representation
1074
954
  command.request_object = course_work_object
1075
955
  command.response_representation = Google::Apis::ClassroomV1::CourseWork::Representation
1076
956
  command.response_class = Google::Apis::ClassroomV1::CourseWork
1077
957
  command.params['courseId'] = course_id unless course_id.nil?
1078
- command.query['quotaUser'] = quota_user unless quota_user.nil?
958
+ command.params['id'] = id unless id.nil?
959
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1079
960
  command.query['fields'] = fields unless fields.nil?
961
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1080
962
  execute_or_queue_command(command, &block)
1081
963
  end
1082
964
 
@@ -1092,11 +974,11 @@ module Google
1092
974
  # alias.
1093
975
  # @param [String] id
1094
976
  # Identifier of the course work.
977
+ # @param [String] fields
978
+ # Selector specifying which fields to include in a partial response.
1095
979
  # @param [String] quota_user
1096
980
  # Available to use for quota purposes for server-side applications. Can be any
1097
981
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1098
- # @param [String] fields
1099
- # Selector specifying which fields to include in a partial response.
1100
982
  # @param [Google::Apis::RequestOptions] options
1101
983
  # Request-specific options
1102
984
  #
@@ -1109,14 +991,14 @@ module Google
1109
991
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1110
992
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1111
993
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1112
- def get_course_work(course_id, id, quota_user: nil, fields: nil, options: nil, &block)
994
+ def get_course_work(course_id, id, fields: nil, quota_user: nil, options: nil, &block)
1113
995
  command = make_simple_command(:get, 'v1/courses/{courseId}/courseWork/{id}', options)
1114
996
  command.response_representation = Google::Apis::ClassroomV1::CourseWork::Representation
1115
997
  command.response_class = Google::Apis::ClassroomV1::CourseWork
1116
998
  command.params['courseId'] = course_id unless course_id.nil?
1117
999
  command.params['id'] = id unless id.nil?
1118
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1119
1000
  command.query['fields'] = fields unless fields.nil?
1001
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1120
1002
  execute_or_queue_command(command, &block)
1121
1003
  end
1122
1004
 
@@ -1132,14 +1014,6 @@ module Google
1132
1014
  # Identifier of the course.
1133
1015
  # This identifier can be either the Classroom-assigned identifier or an
1134
1016
  # alias.
1135
- # @param [Array<String>, String] course_work_states
1136
- # Restriction on the work status to return. Only courseWork that matches
1137
- # is returned. If unspecified, items with a work status of `PUBLISHED`
1138
- # is returned.
1139
- # @param [Fixnum] page_size
1140
- # Maximum number of items to return. Zero or unspecified indicates that the
1141
- # server may assign a maximum.
1142
- # The server may return fewer than the specified number of results.
1143
1017
  # @param [String] order_by
1144
1018
  # Optional sort ordering for results. A comma-separated list of fields with
1145
1019
  # an optional sort direction keyword. Supported fields are `updateTime`
@@ -1153,11 +1027,19 @@ module Google
1153
1027
  # indicating that the subsequent page of results should be returned.
1154
1028
  # The list request
1155
1029
  # must be otherwise identical to the one that resulted in this token.
1030
+ # @param [Fixnum] page_size
1031
+ # Maximum number of items to return. Zero or unspecified indicates that the
1032
+ # server may assign a maximum.
1033
+ # The server may return fewer than the specified number of results.
1034
+ # @param [Array<String>, String] course_work_states
1035
+ # Restriction on the work status to return. Only courseWork that matches
1036
+ # is returned. If unspecified, items with a work status of `PUBLISHED`
1037
+ # is returned.
1038
+ # @param [String] fields
1039
+ # Selector specifying which fields to include in a partial response.
1156
1040
  # @param [String] quota_user
1157
1041
  # Available to use for quota purposes for server-side applications. Can be any
1158
1042
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1159
- # @param [String] fields
1160
- # Selector specifying which fields to include in a partial response.
1161
1043
  # @param [Google::Apis::RequestOptions] options
1162
1044
  # Request-specific options
1163
1045
  #
@@ -1170,64 +1052,45 @@ module Google
1170
1052
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1171
1053
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1172
1054
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1173
- def list_course_works(course_id, course_work_states: nil, page_size: nil, order_by: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
1055
+ def list_course_works(course_id, order_by: nil, page_token: nil, page_size: nil, course_work_states: nil, fields: nil, quota_user: nil, options: nil, &block)
1174
1056
  command = make_simple_command(:get, 'v1/courses/{courseId}/courseWork', options)
1175
1057
  command.response_representation = Google::Apis::ClassroomV1::ListCourseWorkResponse::Representation
1176
1058
  command.response_class = Google::Apis::ClassroomV1::ListCourseWorkResponse
1177
1059
  command.params['courseId'] = course_id unless course_id.nil?
1178
- command.query['courseWorkStates'] = course_work_states unless course_work_states.nil?
1179
- command.query['pageSize'] = page_size unless page_size.nil?
1180
1060
  command.query['orderBy'] = order_by unless order_by.nil?
1181
1061
  command.query['pageToken'] = page_token unless page_token.nil?
1182
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1062
+ command.query['pageSize'] = page_size unless page_size.nil?
1063
+ command.query['courseWorkStates'] = course_work_states unless course_work_states.nil?
1183
1064
  command.query['fields'] = fields unless fields.nil?
1065
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1184
1066
  execute_or_queue_command(command, &block)
1185
1067
  end
1186
1068
 
1187
- # Updates one or more fields of a course work.
1188
- # See google.classroom.v1.CourseWork for details
1189
- # of which fields may be updated and who may change them.
1190
- # This request must be made by the Developer Console project of the
1069
+ # Creates course work.
1070
+ # The resulting course work (and corresponding student submissions) are
1071
+ # associated with the Developer Console project of the
1191
1072
  # [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1192
- # create the corresponding course work item.
1073
+ # make the request. Classroom API requests to modify course work and student
1074
+ # submissions must be made with an OAuth client ID from the associated
1075
+ # Developer Console project.
1193
1076
  # This method returns the following error codes:
1194
- # * `PERMISSION_DENIED` if the requesting developer project did not create
1195
- # the corresponding course work, if the user is not permitted to make the
1196
- # requested modification to the student submission, or for
1197
- # access errors.
1077
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
1078
+ # requested course, create course work in the requested course, share a
1079
+ # Drive attachment, or for access errors.
1198
1080
  # * `INVALID_ARGUMENT` if the request is malformed.
1199
- # * `FAILED_PRECONDITION` if the requested course work has already been
1200
- # deleted.
1201
- # * `NOT_FOUND` if the requested course, course work, or student submission
1202
- # does not exist.
1081
+ # * `NOT_FOUND` if the requested course does not exist.
1082
+ # * `FAILED_PRECONDITION` for the following request error:
1083
+ # * AttachmentNotVisible
1203
1084
  # @param [String] course_id
1204
1085
  # Identifier of the course.
1205
1086
  # This identifier can be either the Classroom-assigned identifier or an
1206
1087
  # alias.
1207
- # @param [String] id
1208
- # Identifier of the course work.
1209
1088
  # @param [Google::Apis::ClassroomV1::CourseWork] course_work_object
1210
- # @param [String] update_mask
1211
- # Mask that identifies which fields on the course work to update.
1212
- # This field is required to do an update. The update fails if invalid
1213
- # fields are specified. If a field supports empty values, it can be cleared
1214
- # by specifying it in the update mask and not in the CourseWork object. If a
1215
- # field that does not support empty values is included in the update mask and
1216
- # not set in the CourseWork object, an `INVALID_ARGUMENT` error will be
1217
- # returned.
1218
- # The following fields may be specified by teachers:
1219
- # * `title`
1220
- # * `description`
1221
- # * `state`
1222
- # * `due_date`
1223
- # * `due_time`
1224
- # * `max_points`
1225
- # * `submission_modification_mode`
1089
+ # @param [String] fields
1090
+ # Selector specifying which fields to include in a partial response.
1226
1091
  # @param [String] quota_user
1227
1092
  # Available to use for quota purposes for server-side applications. Can be any
1228
1093
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1229
- # @param [String] fields
1230
- # Selector specifying which fields to include in a partial response.
1231
1094
  # @param [Google::Apis::RequestOptions] options
1232
1095
  # Request-specific options
1233
1096
  #
@@ -1240,77 +1103,31 @@ module Google
1240
1103
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1241
1104
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1242
1105
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1243
- def patch_course_course_work(course_id, id, course_work_object = nil, update_mask: nil, quota_user: nil, fields: nil, options: nil, &block)
1244
- command = make_simple_command(:patch, 'v1/courses/{courseId}/courseWork/{id}', options)
1106
+ def create_course_work(course_id, course_work_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1107
+ command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork', options)
1245
1108
  command.request_representation = Google::Apis::ClassroomV1::CourseWork::Representation
1246
1109
  command.request_object = course_work_object
1247
1110
  command.response_representation = Google::Apis::ClassroomV1::CourseWork::Representation
1248
1111
  command.response_class = Google::Apis::ClassroomV1::CourseWork
1249
1112
  command.params['courseId'] = course_id unless course_id.nil?
1250
- command.params['id'] = id unless id.nil?
1251
- command.query['updateMask'] = update_mask unless update_mask.nil?
1252
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1253
1113
  command.query['fields'] = fields unless fields.nil?
1254
- execute_or_queue_command(command, &block)
1255
- end
1256
-
1257
- # Deletes a course work.
1258
- # This request must be made by the Developer Console project of the
1259
- # [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1260
- # create the corresponding course work item.
1261
- # This method returns the following error codes:
1262
- # * `PERMISSION_DENIED` if the requesting developer project did not create
1263
- # the corresponding course work, if the requesting user is not permitted
1264
- # to delete the requested course or for access errors.
1265
- # * `FAILED_PRECONDITION` if the requested course work has already been
1266
- # deleted.
1267
- # * `NOT_FOUND` if no course exists with the requested ID.
1268
- # @param [String] course_id
1269
- # Identifier of the course.
1270
- # This identifier can be either the Classroom-assigned identifier or an
1271
- # alias.
1272
- # @param [String] id
1273
- # Identifier of the course work to delete.
1274
- # This identifier is a Classroom-assigned identifier.
1275
- # @param [String] quota_user
1276
- # Available to use for quota purposes for server-side applications. Can be any
1277
- # arbitrary string assigned to a user, but should not exceed 40 characters.
1278
- # @param [String] fields
1279
- # Selector specifying which fields to include in a partial response.
1280
- # @param [Google::Apis::RequestOptions] options
1281
- # Request-specific options
1282
- #
1283
- # @yield [result, err] Result & error if block supplied
1284
- # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
1285
- # @yieldparam err [StandardError] error object if request failed
1286
- #
1287
- # @return [Google::Apis::ClassroomV1::Empty]
1288
- #
1289
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1290
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1291
- # @raise [Google::Apis::AuthorizationError] Authorization is required
1292
- def delete_course_course_work(course_id, id, quota_user: nil, fields: nil, options: nil, &block)
1293
- command = make_simple_command(:delete, 'v1/courses/{courseId}/courseWork/{id}', options)
1294
- command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
1295
- command.response_class = Google::Apis::ClassroomV1::Empty
1296
- command.params['courseId'] = course_id unless course_id.nil?
1297
- command.params['id'] = id unless id.nil?
1298
1114
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1299
- command.query['fields'] = fields unless fields.nil?
1300
1115
  execute_or_queue_command(command, &block)
1301
1116
  end
1302
1117
 
1303
- # Modifies attachments of student submission.
1304
- # Attachments may only be added to student submissions belonging to course
1305
- # work objects with a `workType` of `ASSIGNMENT`.
1118
+ # Reclaims a student submission on behalf of the student that owns it.
1119
+ # Reclaiming a student submission transfers ownership of attached Drive
1120
+ # files to the student and update the submission state.
1121
+ # Only the student that owns the requested student submission may call this
1122
+ # method, and only for a student submission that has been turned in.
1306
1123
  # This request must be made by the Developer Console project of the
1307
1124
  # [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1308
1125
  # create the corresponding course work item.
1309
1126
  # This method returns the following error codes:
1310
1127
  # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
1311
- # requested course or course work, if the user is not permitted to modify
1312
- # attachments on the requested student submission, or for
1313
- # access errors.
1128
+ # requested course or course work, unsubmit the requested student submission,
1129
+ # or for access errors.
1130
+ # * `FAILED_PRECONDITION` if the student submission has not been turned in.
1314
1131
  # * `INVALID_ARGUMENT` if the request is malformed.
1315
1132
  # * `NOT_FOUND` if the requested course, course work, or student submission
1316
1133
  # does not exist.
@@ -1322,51 +1139,50 @@ module Google
1322
1139
  # Identifier of the course work.
1323
1140
  # @param [String] id
1324
1141
  # Identifier of the student submission.
1325
- # @param [Google::Apis::ClassroomV1::ModifyAttachmentsRequest] modify_attachments_request_object
1142
+ # @param [Google::Apis::ClassroomV1::ReclaimStudentSubmissionRequest] reclaim_student_submission_request_object
1143
+ # @param [String] fields
1144
+ # Selector specifying which fields to include in a partial response.
1326
1145
  # @param [String] quota_user
1327
1146
  # Available to use for quota purposes for server-side applications. Can be any
1328
1147
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1329
- # @param [String] fields
1330
- # Selector specifying which fields to include in a partial response.
1331
1148
  # @param [Google::Apis::RequestOptions] options
1332
1149
  # Request-specific options
1333
1150
  #
1334
1151
  # @yield [result, err] Result & error if block supplied
1335
- # @yieldparam result [Google::Apis::ClassroomV1::StudentSubmission] parsed result object
1152
+ # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
1336
1153
  # @yieldparam err [StandardError] error object if request failed
1337
1154
  #
1338
- # @return [Google::Apis::ClassroomV1::StudentSubmission]
1155
+ # @return [Google::Apis::ClassroomV1::Empty]
1339
1156
  #
1340
1157
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1341
1158
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1342
1159
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1343
- def modify_student_submission_attachments(course_id, course_work_id, id, modify_attachments_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
1344
- command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments', options)
1345
- command.request_representation = Google::Apis::ClassroomV1::ModifyAttachmentsRequest::Representation
1346
- command.request_object = modify_attachments_request_object
1347
- command.response_representation = Google::Apis::ClassroomV1::StudentSubmission::Representation
1348
- command.response_class = Google::Apis::ClassroomV1::StudentSubmission
1160
+ def reclaim_student_submission(course_id, course_work_id, id, reclaim_student_submission_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1161
+ command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim', options)
1162
+ command.request_representation = Google::Apis::ClassroomV1::ReclaimStudentSubmissionRequest::Representation
1163
+ command.request_object = reclaim_student_submission_request_object
1164
+ command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
1165
+ command.response_class = Google::Apis::ClassroomV1::Empty
1349
1166
  command.params['courseId'] = course_id unless course_id.nil?
1350
1167
  command.params['courseWorkId'] = course_work_id unless course_work_id.nil?
1351
1168
  command.params['id'] = id unless id.nil?
1352
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1353
1169
  command.query['fields'] = fields unless fields.nil?
1170
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1354
1171
  execute_or_queue_command(command, &block)
1355
1172
  end
1356
1173
 
1357
- # Reclaims a student submission on behalf of the student that owns it.
1358
- # Reclaiming a student submission transfers ownership of attached Drive
1359
- # files to the student and update the submission state.
1360
- # Only the student that owns the requested student submission may call this
1361
- # method, and only for a student submission that has been turned in.
1174
+ # Turns in a student submission.
1175
+ # Turning in a student submission transfers ownership of attached Drive
1176
+ # files to the teacher and may also update the submission state.
1177
+ # This may only be called by the student that owns the specified student
1178
+ # submission.
1362
1179
  # This request must be made by the Developer Console project of the
1363
1180
  # [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1364
1181
  # create the corresponding course work item.
1365
1182
  # This method returns the following error codes:
1366
1183
  # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
1367
- # requested course or course work, unsubmit the requested student submission,
1184
+ # requested course or course work, turn in the requested student submission,
1368
1185
  # or for access errors.
1369
- # * `FAILED_PRECONDITION` if the student submission has not been turned in.
1370
1186
  # * `INVALID_ARGUMENT` if the request is malformed.
1371
1187
  # * `NOT_FOUND` if the requested course, course work, or student submission
1372
1188
  # does not exist.
@@ -1378,12 +1194,12 @@ module Google
1378
1194
  # Identifier of the course work.
1379
1195
  # @param [String] id
1380
1196
  # Identifier of the student submission.
1381
- # @param [Google::Apis::ClassroomV1::ReclaimStudentSubmissionRequest] reclaim_student_submission_request_object
1197
+ # @param [Google::Apis::ClassroomV1::TurnInStudentSubmissionRequest] turn_in_student_submission_request_object
1198
+ # @param [String] fields
1199
+ # Selector specifying which fields to include in a partial response.
1382
1200
  # @param [String] quota_user
1383
1201
  # Available to use for quota purposes for server-side applications. Can be any
1384
1202
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1385
- # @param [String] fields
1386
- # Selector specifying which fields to include in a partial response.
1387
1203
  # @param [Google::Apis::RequestOptions] options
1388
1204
  # Request-specific options
1389
1205
  #
@@ -1396,32 +1212,31 @@ module Google
1396
1212
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1397
1213
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1398
1214
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1399
- def reclaim_student_submission(course_id, course_work_id, id, reclaim_student_submission_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
1400
- command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim', options)
1401
- command.request_representation = Google::Apis::ClassroomV1::ReclaimStudentSubmissionRequest::Representation
1402
- command.request_object = reclaim_student_submission_request_object
1215
+ def turn_in_student_submission(course_id, course_work_id, id, turn_in_student_submission_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1216
+ command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn', options)
1217
+ command.request_representation = Google::Apis::ClassroomV1::TurnInStudentSubmissionRequest::Representation
1218
+ command.request_object = turn_in_student_submission_request_object
1403
1219
  command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
1404
1220
  command.response_class = Google::Apis::ClassroomV1::Empty
1405
1221
  command.params['courseId'] = course_id unless course_id.nil?
1406
1222
  command.params['courseWorkId'] = course_work_id unless course_work_id.nil?
1407
1223
  command.params['id'] = id unless id.nil?
1408
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1409
1224
  command.query['fields'] = fields unless fields.nil?
1225
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1410
1226
  execute_or_queue_command(command, &block)
1411
1227
  end
1412
1228
 
1413
- # Turns in a student submission.
1414
- # Turning in a student submission transfers ownership of attached Drive
1415
- # files to the teacher and may also update the submission state.
1416
- # This may only be called by the student that owns the specified student
1417
- # submission.
1229
+ # Modifies attachments of student submission.
1230
+ # Attachments may only be added to student submissions belonging to course
1231
+ # work objects with a `workType` of `ASSIGNMENT`.
1418
1232
  # This request must be made by the Developer Console project of the
1419
1233
  # [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1420
1234
  # create the corresponding course work item.
1421
1235
  # This method returns the following error codes:
1422
1236
  # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
1423
- # requested course or course work, turn in the requested student submission,
1424
- # or for access errors.
1237
+ # requested course or course work, if the user is not permitted to modify
1238
+ # attachments on the requested student submission, or for
1239
+ # access errors.
1425
1240
  # * `INVALID_ARGUMENT` if the request is malformed.
1426
1241
  # * `NOT_FOUND` if the requested course, course work, or student submission
1427
1242
  # does not exist.
@@ -1433,35 +1248,35 @@ module Google
1433
1248
  # Identifier of the course work.
1434
1249
  # @param [String] id
1435
1250
  # Identifier of the student submission.
1436
- # @param [Google::Apis::ClassroomV1::TurnInStudentSubmissionRequest] turn_in_student_submission_request_object
1251
+ # @param [Google::Apis::ClassroomV1::ModifyAttachmentsRequest] modify_attachments_request_object
1252
+ # @param [String] fields
1253
+ # Selector specifying which fields to include in a partial response.
1437
1254
  # @param [String] quota_user
1438
1255
  # Available to use for quota purposes for server-side applications. Can be any
1439
1256
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1440
- # @param [String] fields
1441
- # Selector specifying which fields to include in a partial response.
1442
1257
  # @param [Google::Apis::RequestOptions] options
1443
1258
  # Request-specific options
1444
1259
  #
1445
1260
  # @yield [result, err] Result & error if block supplied
1446
- # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
1261
+ # @yieldparam result [Google::Apis::ClassroomV1::StudentSubmission] parsed result object
1447
1262
  # @yieldparam err [StandardError] error object if request failed
1448
1263
  #
1449
- # @return [Google::Apis::ClassroomV1::Empty]
1264
+ # @return [Google::Apis::ClassroomV1::StudentSubmission]
1450
1265
  #
1451
1266
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1452
1267
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1453
1268
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1454
- def turn_in_student_submission(course_id, course_work_id, id, turn_in_student_submission_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
1455
- command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn', options)
1456
- command.request_representation = Google::Apis::ClassroomV1::TurnInStudentSubmissionRequest::Representation
1457
- command.request_object = turn_in_student_submission_request_object
1458
- command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
1459
- command.response_class = Google::Apis::ClassroomV1::Empty
1269
+ def modify_student_submission_attachments(course_id, course_work_id, id, modify_attachments_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1270
+ command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments', options)
1271
+ command.request_representation = Google::Apis::ClassroomV1::ModifyAttachmentsRequest::Representation
1272
+ command.request_object = modify_attachments_request_object
1273
+ command.response_representation = Google::Apis::ClassroomV1::StudentSubmission::Representation
1274
+ command.response_class = Google::Apis::ClassroomV1::StudentSubmission
1460
1275
  command.params['courseId'] = course_id unless course_id.nil?
1461
1276
  command.params['courseWorkId'] = course_work_id unless course_work_id.nil?
1462
1277
  command.params['id'] = id unless id.nil?
1463
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1464
1278
  command.query['fields'] = fields unless fields.nil?
1279
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1465
1280
  execute_or_queue_command(command, &block)
1466
1281
  end
1467
1282
 
@@ -1484,9 +1299,6 @@ module Google
1484
1299
  # Identifer of the student work to request.
1485
1300
  # This may be set to the string literal `"-"` to request student work for
1486
1301
  # all course work in the specified course.
1487
- # @param [Array<String>, String] states
1488
- # Requested submission states. If specified, returned student submissions
1489
- # match one of the specified submission states.
1490
1302
  # @param [String] user_id
1491
1303
  # Optional argument to restrict returned student work to those owned by the
1492
1304
  # student with the specified identifier. The identifier can be one of the
@@ -1494,10 +1306,6 @@ module Google
1494
1306
  # * the numeric identifier for the user
1495
1307
  # * the email address of the user
1496
1308
  # * the string literal `"me"`, indicating the requesting user
1497
- # @param [Fixnum] page_size
1498
- # Maximum number of items to return. Zero or unspecified indicates that the
1499
- # server may assign a maximum.
1500
- # The server may return fewer than the specified number of results.
1501
1309
  # @param [String] late
1502
1310
  # Requested lateness value. If specified, returned student submissions are
1503
1311
  # restricted by the requested value.
@@ -1509,11 +1317,18 @@ module Google
1509
1317
  # indicating that the subsequent page of results should be returned.
1510
1318
  # The list request
1511
1319
  # must be otherwise identical to the one that resulted in this token.
1320
+ # @param [Fixnum] page_size
1321
+ # Maximum number of items to return. Zero or unspecified indicates that the
1322
+ # server may assign a maximum.
1323
+ # The server may return fewer than the specified number of results.
1324
+ # @param [Array<String>, String] states
1325
+ # Requested submission states. If specified, returned student submissions
1326
+ # match one of the specified submission states.
1327
+ # @param [String] fields
1328
+ # Selector specifying which fields to include in a partial response.
1512
1329
  # @param [String] quota_user
1513
1330
  # Available to use for quota purposes for server-side applications. Can be any
1514
1331
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1515
- # @param [String] fields
1516
- # Selector specifying which fields to include in a partial response.
1517
1332
  # @param [Google::Apis::RequestOptions] options
1518
1333
  # Request-specific options
1519
1334
  #
@@ -1526,19 +1341,19 @@ module Google
1526
1341
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1527
1342
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1528
1343
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1529
- def list_student_submissions(course_id, course_work_id, states: nil, user_id: nil, page_size: nil, late: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
1344
+ def list_student_submissions(course_id, course_work_id, user_id: nil, late: nil, page_token: nil, page_size: nil, states: nil, fields: nil, quota_user: nil, options: nil, &block)
1530
1345
  command = make_simple_command(:get, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions', options)
1531
1346
  command.response_representation = Google::Apis::ClassroomV1::ListStudentSubmissionsResponse::Representation
1532
1347
  command.response_class = Google::Apis::ClassroomV1::ListStudentSubmissionsResponse
1533
1348
  command.params['courseId'] = course_id unless course_id.nil?
1534
1349
  command.params['courseWorkId'] = course_work_id unless course_work_id.nil?
1535
- command.query['states'] = states unless states.nil?
1536
1350
  command.query['userId'] = user_id unless user_id.nil?
1537
- command.query['pageSize'] = page_size unless page_size.nil?
1538
1351
  command.query['late'] = late unless late.nil?
1539
1352
  command.query['pageToken'] = page_token unless page_token.nil?
1540
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1353
+ command.query['pageSize'] = page_size unless page_size.nil?
1354
+ command.query['states'] = states unless states.nil?
1541
1355
  command.query['fields'] = fields unless fields.nil?
1356
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1542
1357
  execute_or_queue_command(command, &block)
1543
1358
  end
1544
1359
 
@@ -1557,11 +1372,11 @@ module Google
1557
1372
  # Identifier of the course work.
1558
1373
  # @param [String] id
1559
1374
  # Identifier of the student submission.
1375
+ # @param [String] fields
1376
+ # Selector specifying which fields to include in a partial response.
1560
1377
  # @param [String] quota_user
1561
1378
  # Available to use for quota purposes for server-side applications. Can be any
1562
1379
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1563
- # @param [String] fields
1564
- # Selector specifying which fields to include in a partial response.
1565
1380
  # @param [Google::Apis::RequestOptions] options
1566
1381
  # Request-specific options
1567
1382
  #
@@ -1574,32 +1389,29 @@ module Google
1574
1389
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1575
1390
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1576
1391
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1577
- def get_student_submission(course_id, course_work_id, id, quota_user: nil, fields: nil, options: nil, &block)
1392
+ def get_student_submission(course_id, course_work_id, id, fields: nil, quota_user: nil, options: nil, &block)
1578
1393
  command = make_simple_command(:get, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}', options)
1579
1394
  command.response_representation = Google::Apis::ClassroomV1::StudentSubmission::Representation
1580
1395
  command.response_class = Google::Apis::ClassroomV1::StudentSubmission
1581
1396
  command.params['courseId'] = course_id unless course_id.nil?
1582
1397
  command.params['courseWorkId'] = course_work_id unless course_work_id.nil?
1583
1398
  command.params['id'] = id unless id.nil?
1584
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1585
1399
  command.query['fields'] = fields unless fields.nil?
1400
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1586
1401
  execute_or_queue_command(command, &block)
1587
1402
  end
1588
1403
 
1589
- # Returns a student submission.
1590
- # Returning a student submission transfers ownership of attached Drive
1591
- # files to the student and may also update the submission state.
1592
- # Unlike the Classroom application, returning a student submission does not
1593
- # set assignedGrade to the draftGrade value.
1594
- # Only a teacher of the course that contains the requested student submission
1595
- # may call this method.
1404
+ # Updates one or more fields of a student submission.
1405
+ # See google.classroom.v1.StudentSubmission for details
1406
+ # of which fields may be updated and who may change them.
1596
1407
  # This request must be made by the Developer Console project of the
1597
1408
  # [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1598
1409
  # create the corresponding course work item.
1599
1410
  # This method returns the following error codes:
1600
- # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
1601
- # requested course or course work, return the requested student submission,
1602
- # or for access errors.
1411
+ # * `PERMISSION_DENIED` if the requesting developer project did not create
1412
+ # the corresponding course work, if the user is not permitted to make the
1413
+ # requested modification to the student submission, or for
1414
+ # access errors.
1603
1415
  # * `INVALID_ARGUMENT` if the request is malformed.
1604
1416
  # * `NOT_FOUND` if the requested course, course work, or student submission
1605
1417
  # does not exist.
@@ -1611,49 +1423,60 @@ module Google
1611
1423
  # Identifier of the course work.
1612
1424
  # @param [String] id
1613
1425
  # Identifier of the student submission.
1614
- # @param [Google::Apis::ClassroomV1::ReturnStudentSubmissionRequest] return_student_submission_request_object
1426
+ # @param [Google::Apis::ClassroomV1::StudentSubmission] student_submission_object
1427
+ # @param [String] update_mask
1428
+ # Mask that identifies which fields on the student submission to update.
1429
+ # This field is required to do an update. The update fails if invalid
1430
+ # fields are specified.
1431
+ # The following fields may be specified by teachers:
1432
+ # * `draft_grade`
1433
+ # * `assigned_grade`
1434
+ # @param [String] fields
1435
+ # Selector specifying which fields to include in a partial response.
1615
1436
  # @param [String] quota_user
1616
1437
  # Available to use for quota purposes for server-side applications. Can be any
1617
1438
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1618
- # @param [String] fields
1619
- # Selector specifying which fields to include in a partial response.
1620
1439
  # @param [Google::Apis::RequestOptions] options
1621
1440
  # Request-specific options
1622
1441
  #
1623
1442
  # @yield [result, err] Result & error if block supplied
1624
- # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
1443
+ # @yieldparam result [Google::Apis::ClassroomV1::StudentSubmission] parsed result object
1625
1444
  # @yieldparam err [StandardError] error object if request failed
1626
1445
  #
1627
- # @return [Google::Apis::ClassroomV1::Empty]
1446
+ # @return [Google::Apis::ClassroomV1::StudentSubmission]
1628
1447
  #
1629
1448
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1630
1449
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1631
1450
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1632
- def return_student_submission(course_id, course_work_id, id, return_student_submission_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
1633
- command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return', options)
1634
- command.request_representation = Google::Apis::ClassroomV1::ReturnStudentSubmissionRequest::Representation
1635
- command.request_object = return_student_submission_request_object
1636
- command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
1637
- command.response_class = Google::Apis::ClassroomV1::Empty
1451
+ def patch_student_submission(course_id, course_work_id, id, student_submission_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1452
+ command = make_simple_command(:patch, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}', options)
1453
+ command.request_representation = Google::Apis::ClassroomV1::StudentSubmission::Representation
1454
+ command.request_object = student_submission_object
1455
+ command.response_representation = Google::Apis::ClassroomV1::StudentSubmission::Representation
1456
+ command.response_class = Google::Apis::ClassroomV1::StudentSubmission
1638
1457
  command.params['courseId'] = course_id unless course_id.nil?
1639
1458
  command.params['courseWorkId'] = course_work_id unless course_work_id.nil?
1640
1459
  command.params['id'] = id unless id.nil?
1641
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1460
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1642
1461
  command.query['fields'] = fields unless fields.nil?
1462
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1643
1463
  execute_or_queue_command(command, &block)
1644
1464
  end
1645
1465
 
1646
- # Updates one or more fields of a student submission.
1647
- # See google.classroom.v1.StudentSubmission for details
1648
- # of which fields may be updated and who may change them.
1466
+ # Returns a student submission.
1467
+ # Returning a student submission transfers ownership of attached Drive
1468
+ # files to the student and may also update the submission state.
1469
+ # Unlike the Classroom application, returning a student submission does not
1470
+ # set assignedGrade to the draftGrade value.
1471
+ # Only a teacher of the course that contains the requested student submission
1472
+ # may call this method.
1649
1473
  # This request must be made by the Developer Console project of the
1650
1474
  # [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1651
1475
  # create the corresponding course work item.
1652
1476
  # This method returns the following error codes:
1653
- # * `PERMISSION_DENIED` if the requesting developer project did not create
1654
- # the corresponding course work, if the user is not permitted to make the
1655
- # requested modification to the student submission, or for
1656
- # access errors.
1477
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to access the
1478
+ # requested course or course work, return the requested student submission,
1479
+ # or for access errors.
1657
1480
  # * `INVALID_ARGUMENT` if the request is malformed.
1658
1481
  # * `NOT_FOUND` if the requested course, course work, or student submission
1659
1482
  # does not exist.
@@ -1665,293 +1488,258 @@ module Google
1665
1488
  # Identifier of the course work.
1666
1489
  # @param [String] id
1667
1490
  # Identifier of the student submission.
1668
- # @param [Google::Apis::ClassroomV1::StudentSubmission] student_submission_object
1669
- # @param [String] update_mask
1670
- # Mask that identifies which fields on the student submission to update.
1671
- # This field is required to do an update. The update fails if invalid
1672
- # fields are specified.
1673
- # The following fields may be specified by teachers:
1674
- # * `draft_grade`
1675
- # * `assigned_grade`
1491
+ # @param [Google::Apis::ClassroomV1::ReturnStudentSubmissionRequest] return_student_submission_request_object
1492
+ # @param [String] fields
1493
+ # Selector specifying which fields to include in a partial response.
1676
1494
  # @param [String] quota_user
1677
1495
  # Available to use for quota purposes for server-side applications. Can be any
1678
1496
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1679
- # @param [String] fields
1680
- # Selector specifying which fields to include in a partial response.
1681
1497
  # @param [Google::Apis::RequestOptions] options
1682
1498
  # Request-specific options
1683
1499
  #
1684
1500
  # @yield [result, err] Result & error if block supplied
1685
- # @yieldparam result [Google::Apis::ClassroomV1::StudentSubmission] parsed result object
1501
+ # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
1686
1502
  # @yieldparam err [StandardError] error object if request failed
1687
1503
  #
1688
- # @return [Google::Apis::ClassroomV1::StudentSubmission]
1504
+ # @return [Google::Apis::ClassroomV1::Empty]
1689
1505
  #
1690
1506
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1691
1507
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1692
1508
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1693
- def patch_student_submission(course_id, course_work_id, id, student_submission_object = nil, update_mask: nil, quota_user: nil, fields: nil, options: nil, &block)
1694
- command = make_simple_command(:patch, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}', options)
1695
- command.request_representation = Google::Apis::ClassroomV1::StudentSubmission::Representation
1696
- command.request_object = student_submission_object
1697
- command.response_representation = Google::Apis::ClassroomV1::StudentSubmission::Representation
1698
- command.response_class = Google::Apis::ClassroomV1::StudentSubmission
1509
+ def return_student_submission(course_id, course_work_id, id, return_student_submission_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1510
+ command = make_simple_command(:post, 'v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return', options)
1511
+ command.request_representation = Google::Apis::ClassroomV1::ReturnStudentSubmissionRequest::Representation
1512
+ command.request_object = return_student_submission_request_object
1513
+ command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
1514
+ command.response_class = Google::Apis::ClassroomV1::Empty
1699
1515
  command.params['courseId'] = course_id unless course_id.nil?
1700
1516
  command.params['courseWorkId'] = course_work_id unless course_work_id.nil?
1701
1517
  command.params['id'] = id unless id.nil?
1702
- command.query['updateMask'] = update_mask unless update_mask.nil?
1703
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1704
1518
  command.query['fields'] = fields unless fields.nil?
1519
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1705
1520
  execute_or_queue_command(command, &block)
1706
1521
  end
1707
1522
 
1708
- # Returns a user profile.
1523
+ # Deletes a teacher of a course.
1709
1524
  # This method returns the following error codes:
1710
- # * `PERMISSION_DENIED` if the requesting user is not permitted to access
1711
- # this user profile, if no profile exists with the requested ID, or for
1712
- # access errors.
1525
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to delete
1526
+ # teachers of this course or for access errors.
1527
+ # * `NOT_FOUND` if no teacher of this course has the requested ID or if the
1528
+ # course does not exist.
1529
+ # * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher
1530
+ # of this course.
1531
+ # @param [String] course_id
1532
+ # Identifier of the course.
1533
+ # This identifier can be either the Classroom-assigned identifier or an
1534
+ # alias.
1713
1535
  # @param [String] user_id
1714
- # Identifier of the profile to return. The identifier can be one of the
1536
+ # Identifier of the teacher to delete. The identifier can be one of the
1715
1537
  # following:
1716
1538
  # * the numeric identifier for the user
1717
1539
  # * the email address of the user
1718
1540
  # * the string literal `"me"`, indicating the requesting user
1541
+ # @param [String] fields
1542
+ # Selector specifying which fields to include in a partial response.
1719
1543
  # @param [String] quota_user
1720
1544
  # Available to use for quota purposes for server-side applications. Can be any
1721
1545
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1722
- # @param [String] fields
1723
- # Selector specifying which fields to include in a partial response.
1724
1546
  # @param [Google::Apis::RequestOptions] options
1725
1547
  # Request-specific options
1726
1548
  #
1727
1549
  # @yield [result, err] Result & error if block supplied
1728
- # @yieldparam result [Google::Apis::ClassroomV1::UserProfile] parsed result object
1550
+ # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
1729
1551
  # @yieldparam err [StandardError] error object if request failed
1730
1552
  #
1731
- # @return [Google::Apis::ClassroomV1::UserProfile]
1553
+ # @return [Google::Apis::ClassroomV1::Empty]
1732
1554
  #
1733
1555
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1734
1556
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1735
1557
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1736
- def get_user_profile(user_id, quota_user: nil, fields: nil, options: nil, &block)
1737
- command = make_simple_command(:get, 'v1/userProfiles/{userId}', options)
1738
- command.response_representation = Google::Apis::ClassroomV1::UserProfile::Representation
1739
- command.response_class = Google::Apis::ClassroomV1::UserProfile
1558
+ def delete_course_teacher(course_id, user_id, fields: nil, quota_user: nil, options: nil, &block)
1559
+ command = make_simple_command(:delete, 'v1/courses/{courseId}/teachers/{userId}', options)
1560
+ command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
1561
+ command.response_class = Google::Apis::ClassroomV1::Empty
1562
+ command.params['courseId'] = course_id unless course_id.nil?
1740
1563
  command.params['userId'] = user_id unless user_id.nil?
1741
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1742
1564
  command.query['fields'] = fields unless fields.nil?
1565
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1743
1566
  execute_or_queue_command(command, &block)
1744
1567
  end
1745
1568
 
1746
- # Returns a specific guardian.
1569
+ # Returns a teacher of a course.
1747
1570
  # This method returns the following error codes:
1748
- # * `PERMISSION_DENIED` if no user that matches the provided `student_id`
1749
- # is visible to the requesting user, if the requesting user is not
1750
- # permitted to view guardian information for the student identified by the
1751
- # `student_id`, if guardians are not enabled for the domain in question,
1752
- # or for other access errors.
1753
- # * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
1754
- # be recognized (it is not an email address, nor a `student_id` from the
1755
- # API, nor the literal string `me`).
1756
- # * `NOT_FOUND` if the requesting user is permitted to view guardians for
1757
- # the requested `student_id`, but no `Guardian` record exists for that
1758
- # student that matches the provided `guardian_id`.
1759
- # @param [String] student_id
1760
- # The student whose guardian is being requested. One of the following:
1571
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to view
1572
+ # teachers of this course or for access errors.
1573
+ # * `NOT_FOUND` if no teacher of this course has the requested ID or if the
1574
+ # course does not exist.
1575
+ # @param [String] course_id
1576
+ # Identifier of the course.
1577
+ # This identifier can be either the Classroom-assigned identifier or an
1578
+ # alias.
1579
+ # @param [String] user_id
1580
+ # Identifier of the teacher to return. The identifier can be one of the
1581
+ # following:
1761
1582
  # * the numeric identifier for the user
1762
1583
  # * the email address of the user
1763
1584
  # * the string literal `"me"`, indicating the requesting user
1764
- # @param [String] guardian_id
1765
- # The `id` field from a `Guardian`.
1585
+ # @param [String] fields
1586
+ # Selector specifying which fields to include in a partial response.
1766
1587
  # @param [String] quota_user
1767
1588
  # Available to use for quota purposes for server-side applications. Can be any
1768
1589
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1769
- # @param [String] fields
1770
- # Selector specifying which fields to include in a partial response.
1771
1590
  # @param [Google::Apis::RequestOptions] options
1772
1591
  # Request-specific options
1773
1592
  #
1774
1593
  # @yield [result, err] Result & error if block supplied
1775
- # @yieldparam result [Google::Apis::ClassroomV1::Guardian] parsed result object
1594
+ # @yieldparam result [Google::Apis::ClassroomV1::Teacher] parsed result object
1776
1595
  # @yieldparam err [StandardError] error object if request failed
1777
1596
  #
1778
- # @return [Google::Apis::ClassroomV1::Guardian]
1597
+ # @return [Google::Apis::ClassroomV1::Teacher]
1779
1598
  #
1780
1599
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1781
1600
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1782
1601
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1783
- def get_user_profile_guardian(student_id, guardian_id, quota_user: nil, fields: nil, options: nil, &block)
1784
- command = make_simple_command(:get, 'v1/userProfiles/{studentId}/guardians/{guardianId}', options)
1785
- command.response_representation = Google::Apis::ClassroomV1::Guardian::Representation
1786
- command.response_class = Google::Apis::ClassroomV1::Guardian
1787
- command.params['studentId'] = student_id unless student_id.nil?
1788
- command.params['guardianId'] = guardian_id unless guardian_id.nil?
1789
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1602
+ def get_course_teacher(course_id, user_id, fields: nil, quota_user: nil, options: nil, &block)
1603
+ command = make_simple_command(:get, 'v1/courses/{courseId}/teachers/{userId}', options)
1604
+ command.response_representation = Google::Apis::ClassroomV1::Teacher::Representation
1605
+ command.response_class = Google::Apis::ClassroomV1::Teacher
1606
+ command.params['courseId'] = course_id unless course_id.nil?
1607
+ command.params['userId'] = user_id unless user_id.nil?
1790
1608
  command.query['fields'] = fields unless fields.nil?
1609
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1791
1610
  execute_or_queue_command(command, &block)
1792
1611
  end
1793
1612
 
1794
- # Returns a list of guardians that the requesting user is permitted to
1795
- # view, restricted to those that match the request.
1796
- # To list guardians for any student that the requesting user may view
1797
- # guardians for, use the literal character `-` for the student ID.
1613
+ # Returns a list of teachers of this course that the requester
1614
+ # is permitted to view.
1798
1615
  # This method returns the following error codes:
1799
- # * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting
1800
- # user is not permitted to view guardian information for that student, if
1801
- # `"-"` is specified as the `student_id` and the user is not a domain
1802
- # administrator, if guardians are not enabled for the domain in question,
1803
- # if the `invited_email_address` filter is set by a user who is not a
1804
- # domain administrator, or for other access errors.
1805
- # * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
1806
- # be recognized (it is not an email address, nor a `student_id` from the
1807
- # API, nor the literal string `me`). May also be returned if an invalid
1808
- # `page_token` is provided.
1809
- # * `NOT_FOUND` if a `student_id` is specified, and its format can be
1810
- # recognized, but Classroom has no record of that student.
1811
- # @param [String] student_id
1812
- # Filter results by the student who the guardian is linked to.
1813
- # The identifier can be one of the following:
1814
- # * the numeric identifier for the user
1815
- # * the email address of the user
1816
- # * the string literal `"me"`, indicating the requesting user
1817
- # * the string literal `"-"`, indicating that results should be returned for
1818
- # all students that the requesting user has access to view.
1819
- # @param [Fixnum] page_size
1820
- # Maximum number of items to return. Zero or unspecified indicates that the
1821
- # server may assign a maximum.
1822
- # The server may return fewer than the specified number of results.
1823
- # @param [String] invited_email_address
1824
- # Filter results by the email address that the original invitation was sent
1825
- # to, resulting in this guardian link.
1826
- # This filter can only be used by domain administrators.
1616
+ # * `NOT_FOUND` if the course does not exist.
1617
+ # * `PERMISSION_DENIED` for access errors.
1618
+ # @param [String] course_id
1619
+ # Identifier of the course.
1620
+ # This identifier can be either the Classroom-assigned identifier or an
1621
+ # alias.
1827
1622
  # @param [String] page_token
1828
1623
  # nextPageToken
1829
1624
  # value returned from a previous
1830
- # list call,
1831
- # indicating that the subsequent page of results should be returned.
1832
- # The list request
1833
- # must be otherwise identical to the one that resulted in this token.
1625
+ # list call, indicating that
1626
+ # the subsequent page of results should be returned.
1627
+ # The list request must be
1628
+ # otherwise identical to the one that resulted in this token.
1629
+ # @param [Fixnum] page_size
1630
+ # Maximum number of items to return. Zero means no maximum.
1631
+ # The server may return fewer than the specified number of results.
1632
+ # @param [String] fields
1633
+ # Selector specifying which fields to include in a partial response.
1834
1634
  # @param [String] quota_user
1835
1635
  # Available to use for quota purposes for server-side applications. Can be any
1836
1636
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1837
- # @param [String] fields
1838
- # Selector specifying which fields to include in a partial response.
1839
1637
  # @param [Google::Apis::RequestOptions] options
1840
1638
  # Request-specific options
1841
1639
  #
1842
1640
  # @yield [result, err] Result & error if block supplied
1843
- # @yieldparam result [Google::Apis::ClassroomV1::ListGuardiansResponse] parsed result object
1641
+ # @yieldparam result [Google::Apis::ClassroomV1::ListTeachersResponse] parsed result object
1844
1642
  # @yieldparam err [StandardError] error object if request failed
1845
1643
  #
1846
- # @return [Google::Apis::ClassroomV1::ListGuardiansResponse]
1644
+ # @return [Google::Apis::ClassroomV1::ListTeachersResponse]
1847
1645
  #
1848
1646
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1849
1647
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1850
1648
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1851
- def list_user_profile_guardians(student_id, page_size: nil, invited_email_address: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
1852
- command = make_simple_command(:get, 'v1/userProfiles/{studentId}/guardians', options)
1853
- command.response_representation = Google::Apis::ClassroomV1::ListGuardiansResponse::Representation
1854
- command.response_class = Google::Apis::ClassroomV1::ListGuardiansResponse
1855
- command.params['studentId'] = student_id unless student_id.nil?
1856
- command.query['pageSize'] = page_size unless page_size.nil?
1857
- command.query['invitedEmailAddress'] = invited_email_address unless invited_email_address.nil?
1649
+ def list_course_teachers(course_id, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
1650
+ command = make_simple_command(:get, 'v1/courses/{courseId}/teachers', options)
1651
+ command.response_representation = Google::Apis::ClassroomV1::ListTeachersResponse::Representation
1652
+ command.response_class = Google::Apis::ClassroomV1::ListTeachersResponse
1653
+ command.params['courseId'] = course_id unless course_id.nil?
1858
1654
  command.query['pageToken'] = page_token unless page_token.nil?
1859
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1655
+ command.query['pageSize'] = page_size unless page_size.nil?
1860
1656
  command.query['fields'] = fields unless fields.nil?
1657
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1861
1658
  execute_or_queue_command(command, &block)
1862
1659
  end
1863
1660
 
1864
- # Deletes a guardian.
1865
- # The guardian will no longer receive guardian notifications and the guardian
1866
- # will no longer be accessible via the API.
1661
+ # Creates a teacher of a course.
1867
1662
  # This method returns the following error codes:
1868
- # * `PERMISSION_DENIED` if no user that matches the provided `student_id`
1869
- # is visible to the requesting user, if the requesting user is not
1870
- # permitted to manage guardians for the student identified by the
1871
- # `student_id`, if guardians are not enabled for the domain in question,
1872
- # or for other access errors.
1873
- # * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
1874
- # be recognized (it is not an email address, nor a `student_id` from the
1875
- # API).
1876
- # * `NOT_FOUND` if the requesting user is permitted to modify guardians for
1877
- # the requested `student_id`, but no `Guardian` record exists for that
1878
- # student with the provided `guardian_id`.
1879
- # @param [String] student_id
1880
- # The student whose guardian is to be deleted. One of the following:
1881
- # * the numeric identifier for the user
1882
- # * the email address of the user
1883
- # * the string literal `"me"`, indicating the requesting user
1884
- # @param [String] guardian_id
1885
- # The `id` field from a `Guardian`.
1663
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to create
1664
+ # teachers in this course or for access errors.
1665
+ # * `NOT_FOUND` if the requested course ID does not exist.
1666
+ # * `FAILED_PRECONDITION` if the requested user's account is disabled,
1667
+ # for the following request errors:
1668
+ # * CourseMemberLimitReached
1669
+ # * CourseNotModifiable
1670
+ # * CourseTeacherLimitReached
1671
+ # * UserGroupsMembershipLimitReached
1672
+ # * `ALREADY_EXISTS` if the user is already a teacher or student in the
1673
+ # course.
1674
+ # @param [String] course_id
1675
+ # Identifier of the course.
1676
+ # This identifier can be either the Classroom-assigned identifier or an
1677
+ # alias.
1678
+ # @param [Google::Apis::ClassroomV1::Teacher] teacher_object
1679
+ # @param [String] fields
1680
+ # Selector specifying which fields to include in a partial response.
1886
1681
  # @param [String] quota_user
1887
1682
  # Available to use for quota purposes for server-side applications. Can be any
1888
1683
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1889
- # @param [String] fields
1890
- # Selector specifying which fields to include in a partial response.
1891
1684
  # @param [Google::Apis::RequestOptions] options
1892
1685
  # Request-specific options
1893
1686
  #
1894
1687
  # @yield [result, err] Result & error if block supplied
1895
- # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
1688
+ # @yieldparam result [Google::Apis::ClassroomV1::Teacher] parsed result object
1896
1689
  # @yieldparam err [StandardError] error object if request failed
1897
1690
  #
1898
- # @return [Google::Apis::ClassroomV1::Empty]
1691
+ # @return [Google::Apis::ClassroomV1::Teacher]
1899
1692
  #
1900
1693
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1901
1694
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1902
1695
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1903
- def delete_user_profile_guardian(student_id, guardian_id, quota_user: nil, fields: nil, options: nil, &block)
1904
- command = make_simple_command(:delete, 'v1/userProfiles/{studentId}/guardians/{guardianId}', options)
1905
- command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
1906
- command.response_class = Google::Apis::ClassroomV1::Empty
1907
- command.params['studentId'] = student_id unless student_id.nil?
1908
- command.params['guardianId'] = guardian_id unless guardian_id.nil?
1909
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1696
+ def create_course_teacher(course_id, teacher_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1697
+ command = make_simple_command(:post, 'v1/courses/{courseId}/teachers', options)
1698
+ command.request_representation = Google::Apis::ClassroomV1::Teacher::Representation
1699
+ command.request_object = teacher_object
1700
+ command.response_representation = Google::Apis::ClassroomV1::Teacher::Representation
1701
+ command.response_class = Google::Apis::ClassroomV1::Teacher
1702
+ command.params['courseId'] = course_id unless course_id.nil?
1910
1703
  command.query['fields'] = fields unless fields.nil?
1704
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1911
1705
  execute_or_queue_command(command, &block)
1912
1706
  end
1913
1707
 
1914
- # Returns a specific guardian invitation.
1708
+ # Returns a user profile.
1915
1709
  # This method returns the following error codes:
1916
- # * `PERMISSION_DENIED` if the requesting user is not permitted to view
1917
- # guardian invitations for the student identified by the `student_id`, if
1918
- # guardians are not enabled for the domain in question, or for other
1710
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to access
1711
+ # this user profile, if no profile exists with the requested ID, or for
1919
1712
  # access errors.
1920
- # * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
1921
- # be recognized (it is not an email address, nor a `student_id` from the
1922
- # API, nor the literal string `me`).
1923
- # * `NOT_FOUND` if Classroom cannot find any record of the given student or
1924
- # `invitation_id`. May also be returned if the student exists, but the
1925
- # requesting user does not have access to see that student.
1926
- # @param [String] student_id
1927
- # The ID of the student whose guardian invitation is being requested.
1928
- # @param [String] invitation_id
1929
- # The `id` field of the `GuardianInvitation` being requested.
1713
+ # @param [String] user_id
1714
+ # Identifier of the profile to return. The identifier can be one of the
1715
+ # following:
1716
+ # * the numeric identifier for the user
1717
+ # * the email address of the user
1718
+ # * the string literal `"me"`, indicating the requesting user
1719
+ # @param [String] fields
1720
+ # Selector specifying which fields to include in a partial response.
1930
1721
  # @param [String] quota_user
1931
1722
  # Available to use for quota purposes for server-side applications. Can be any
1932
1723
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1933
- # @param [String] fields
1934
- # Selector specifying which fields to include in a partial response.
1935
1724
  # @param [Google::Apis::RequestOptions] options
1936
1725
  # Request-specific options
1937
1726
  #
1938
1727
  # @yield [result, err] Result & error if block supplied
1939
- # @yieldparam result [Google::Apis::ClassroomV1::GuardianInvitation] parsed result object
1728
+ # @yieldparam result [Google::Apis::ClassroomV1::UserProfile] parsed result object
1940
1729
  # @yieldparam err [StandardError] error object if request failed
1941
1730
  #
1942
- # @return [Google::Apis::ClassroomV1::GuardianInvitation]
1943
- #
1944
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1945
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1946
- # @raise [Google::Apis::AuthorizationError] Authorization is required
1947
- def get_user_profile_guardian_invitation(student_id, invitation_id, quota_user: nil, fields: nil, options: nil, &block)
1948
- command = make_simple_command(:get, 'v1/userProfiles/{studentId}/guardianInvitations/{invitationId}', options)
1949
- command.response_representation = Google::Apis::ClassroomV1::GuardianInvitation::Representation
1950
- command.response_class = Google::Apis::ClassroomV1::GuardianInvitation
1951
- command.params['studentId'] = student_id unless student_id.nil?
1952
- command.params['invitationId'] = invitation_id unless invitation_id.nil?
1953
- command.query['quotaUser'] = quota_user unless quota_user.nil?
1731
+ # @return [Google::Apis::ClassroomV1::UserProfile]
1732
+ #
1733
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1734
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1735
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1736
+ def get_user_profile(user_id, fields: nil, quota_user: nil, options: nil, &block)
1737
+ command = make_simple_command(:get, 'v1/userProfiles/{userId}', options)
1738
+ command.response_representation = Google::Apis::ClassroomV1::UserProfile::Representation
1739
+ command.response_class = Google::Apis::ClassroomV1::UserProfile
1740
+ command.params['userId'] = user_id unless user_id.nil?
1954
1741
  command.query['fields'] = fields unless fields.nil?
1742
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1955
1743
  execute_or_queue_command(command, &block)
1956
1744
  end
1957
1745
 
@@ -1984,11 +1772,11 @@ module Google
1984
1772
  # @param [String] student_id
1985
1773
  # ID of the student (in standard format)
1986
1774
  # @param [Google::Apis::ClassroomV1::GuardianInvitation] guardian_invitation_object
1775
+ # @param [String] fields
1776
+ # Selector specifying which fields to include in a partial response.
1987
1777
  # @param [String] quota_user
1988
1778
  # Available to use for quota purposes for server-side applications. Can be any
1989
1779
  # arbitrary string assigned to a user, but should not exceed 40 characters.
1990
- # @param [String] fields
1991
- # Selector specifying which fields to include in a partial response.
1992
1780
  # @param [Google::Apis::RequestOptions] options
1993
1781
  # Request-specific options
1994
1782
  #
@@ -2001,15 +1789,15 @@ module Google
2001
1789
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2002
1790
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2003
1791
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2004
- def create_user_profile_guardian_invitation(student_id, guardian_invitation_object = nil, quota_user: nil, fields: nil, options: nil, &block)
1792
+ def create_user_profile_guardian_invitation(student_id, guardian_invitation_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2005
1793
  command = make_simple_command(:post, 'v1/userProfiles/{studentId}/guardianInvitations', options)
2006
1794
  command.request_representation = Google::Apis::ClassroomV1::GuardianInvitation::Representation
2007
1795
  command.request_object = guardian_invitation_object
2008
1796
  command.response_representation = Google::Apis::ClassroomV1::GuardianInvitation::Representation
2009
1797
  command.response_class = Google::Apis::ClassroomV1::GuardianInvitation
2010
1798
  command.params['studentId'] = student_id unless student_id.nil?
2011
- command.query['quotaUser'] = quota_user unless quota_user.nil?
2012
1799
  command.query['fields'] = fields unless fields.nil?
1800
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2013
1801
  execute_or_queue_command(command, &block)
2014
1802
  end
2015
1803
 
@@ -2036,16 +1824,6 @@ module Google
2036
1824
  # * the string literal `"-"`, indicating that results should be returned for
2037
1825
  # all students that the requesting user is permitted to view guardian
2038
1826
  # invitations.
2039
- # @param [Fixnum] page_size
2040
- # Maximum number of items to return. Zero or unspecified indicates that the
2041
- # server may assign a maximum.
2042
- # The server may return fewer than the specified number of results.
2043
- # @param [String] invited_email_address
2044
- # If specified, only results with the specified `invited_email_address`
2045
- # will be returned.
2046
- # @param [Array<String>, String] states
2047
- # If specified, only results with the specified `state` values will be
2048
- # returned. Otherwise, results with a `state` of `PENDING` will be returned.
2049
1827
  # @param [String] page_token
2050
1828
  # nextPageToken
2051
1829
  # value returned from a previous
@@ -2053,11 +1831,21 @@ module Google
2053
1831
  # indicating that the subsequent page of results should be returned.
2054
1832
  # The list request
2055
1833
  # must be otherwise identical to the one that resulted in this token.
1834
+ # @param [String] invited_email_address
1835
+ # If specified, only results with the specified `invited_email_address`
1836
+ # will be returned.
1837
+ # @param [Array<String>, String] states
1838
+ # If specified, only results with the specified `state` values will be
1839
+ # returned. Otherwise, results with a `state` of `PENDING` will be returned.
1840
+ # @param [Fixnum] page_size
1841
+ # Maximum number of items to return. Zero or unspecified indicates that the
1842
+ # server may assign a maximum.
1843
+ # The server may return fewer than the specified number of results.
1844
+ # @param [String] fields
1845
+ # Selector specifying which fields to include in a partial response.
2056
1846
  # @param [String] quota_user
2057
1847
  # Available to use for quota purposes for server-side applications. Can be any
2058
1848
  # arbitrary string assigned to a user, but should not exceed 40 characters.
2059
- # @param [String] fields
2060
- # Selector specifying which fields to include in a partial response.
2061
1849
  # @param [Google::Apis::RequestOptions] options
2062
1850
  # Request-specific options
2063
1851
  #
@@ -2070,17 +1858,61 @@ module Google
2070
1858
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2071
1859
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2072
1860
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2073
- def list_user_profile_guardian_invitations(student_id, page_size: nil, invited_email_address: nil, states: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
1861
+ def list_user_profile_guardian_invitations(student_id, page_token: nil, invited_email_address: nil, states: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
2074
1862
  command = make_simple_command(:get, 'v1/userProfiles/{studentId}/guardianInvitations', options)
2075
1863
  command.response_representation = Google::Apis::ClassroomV1::ListGuardianInvitationsResponse::Representation
2076
1864
  command.response_class = Google::Apis::ClassroomV1::ListGuardianInvitationsResponse
2077
1865
  command.params['studentId'] = student_id unless student_id.nil?
2078
- command.query['pageSize'] = page_size unless page_size.nil?
1866
+ command.query['pageToken'] = page_token unless page_token.nil?
2079
1867
  command.query['invitedEmailAddress'] = invited_email_address unless invited_email_address.nil?
2080
1868
  command.query['states'] = states unless states.nil?
2081
- command.query['pageToken'] = page_token unless page_token.nil?
1869
+ command.query['pageSize'] = page_size unless page_size.nil?
1870
+ command.query['fields'] = fields unless fields.nil?
2082
1871
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1872
+ execute_or_queue_command(command, &block)
1873
+ end
1874
+
1875
+ # Returns a specific guardian invitation.
1876
+ # This method returns the following error codes:
1877
+ # * `PERMISSION_DENIED` if the requesting user is not permitted to view
1878
+ # guardian invitations for the student identified by the `student_id`, if
1879
+ # guardians are not enabled for the domain in question, or for other
1880
+ # access errors.
1881
+ # * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
1882
+ # be recognized (it is not an email address, nor a `student_id` from the
1883
+ # API, nor the literal string `me`).
1884
+ # * `NOT_FOUND` if Classroom cannot find any record of the given student or
1885
+ # `invitation_id`. May also be returned if the student exists, but the
1886
+ # requesting user does not have access to see that student.
1887
+ # @param [String] student_id
1888
+ # The ID of the student whose guardian invitation is being requested.
1889
+ # @param [String] invitation_id
1890
+ # The `id` field of the `GuardianInvitation` being requested.
1891
+ # @param [String] fields
1892
+ # Selector specifying which fields to include in a partial response.
1893
+ # @param [String] quota_user
1894
+ # Available to use for quota purposes for server-side applications. Can be any
1895
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1896
+ # @param [Google::Apis::RequestOptions] options
1897
+ # Request-specific options
1898
+ #
1899
+ # @yield [result, err] Result & error if block supplied
1900
+ # @yieldparam result [Google::Apis::ClassroomV1::GuardianInvitation] parsed result object
1901
+ # @yieldparam err [StandardError] error object if request failed
1902
+ #
1903
+ # @return [Google::Apis::ClassroomV1::GuardianInvitation]
1904
+ #
1905
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1906
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1907
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1908
+ def get_user_profile_guardian_invitation(student_id, invitation_id, fields: nil, quota_user: nil, options: nil, &block)
1909
+ command = make_simple_command(:get, 'v1/userProfiles/{studentId}/guardianInvitations/{invitationId}', options)
1910
+ command.response_representation = Google::Apis::ClassroomV1::GuardianInvitation::Representation
1911
+ command.response_class = Google::Apis::ClassroomV1::GuardianInvitation
1912
+ command.params['studentId'] = student_id unless student_id.nil?
1913
+ command.params['invitationId'] = invitation_id unless invitation_id.nil?
2083
1914
  command.query['fields'] = fields unless fields.nil?
1915
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2084
1916
  execute_or_queue_command(command, &block)
2085
1917
  end
2086
1918
 
@@ -2111,11 +1943,11 @@ module Google
2111
1943
  # * `state`
2112
1944
  # When set in a query parameter, this field should be specified as
2113
1945
  # `updateMask=<field1>,<field2>,...`
1946
+ # @param [String] fields
1947
+ # Selector specifying which fields to include in a partial response.
2114
1948
  # @param [String] quota_user
2115
1949
  # Available to use for quota purposes for server-side applications. Can be any
2116
1950
  # arbitrary string assigned to a user, but should not exceed 40 characters.
2117
- # @param [String] fields
2118
- # Selector specifying which fields to include in a partial response.
2119
1951
  # @param [Google::Apis::RequestOptions] options
2120
1952
  # Request-specific options
2121
1953
  #
@@ -2128,7 +1960,7 @@ module Google
2128
1960
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2129
1961
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2130
1962
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2131
- def patch_user_profile_guardian_invitation(student_id, invitation_id, guardian_invitation_object = nil, update_mask: nil, quota_user: nil, fields: nil, options: nil, &block)
1963
+ def patch_user_profile_guardian_invitation(student_id, invitation_id, guardian_invitation_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
2132
1964
  command = make_simple_command(:patch, 'v1/userProfiles/{studentId}/guardianInvitations/{invitationId}', options)
2133
1965
  command.request_representation = Google::Apis::ClassroomV1::GuardianInvitation::Representation
2134
1966
  command.request_object = guardian_invitation_object
@@ -2137,8 +1969,176 @@ module Google
2137
1969
  command.params['studentId'] = student_id unless student_id.nil?
2138
1970
  command.params['invitationId'] = invitation_id unless invitation_id.nil?
2139
1971
  command.query['updateMask'] = update_mask unless update_mask.nil?
1972
+ command.query['fields'] = fields unless fields.nil?
1973
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1974
+ execute_or_queue_command(command, &block)
1975
+ end
1976
+
1977
+ # Deletes a guardian.
1978
+ # The guardian will no longer receive guardian notifications and the guardian
1979
+ # will no longer be accessible via the API.
1980
+ # This method returns the following error codes:
1981
+ # * `PERMISSION_DENIED` if no user that matches the provided `student_id`
1982
+ # is visible to the requesting user, if the requesting user is not
1983
+ # permitted to manage guardians for the student identified by the
1984
+ # `student_id`, if guardians are not enabled for the domain in question,
1985
+ # or for other access errors.
1986
+ # * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
1987
+ # be recognized (it is not an email address, nor a `student_id` from the
1988
+ # API).
1989
+ # * `NOT_FOUND` if the requesting user is permitted to modify guardians for
1990
+ # the requested `student_id`, but no `Guardian` record exists for that
1991
+ # student with the provided `guardian_id`.
1992
+ # @param [String] student_id
1993
+ # The student whose guardian is to be deleted. One of the following:
1994
+ # * the numeric identifier for the user
1995
+ # * the email address of the user
1996
+ # * the string literal `"me"`, indicating the requesting user
1997
+ # @param [String] guardian_id
1998
+ # The `id` field from a `Guardian`.
1999
+ # @param [String] fields
2000
+ # Selector specifying which fields to include in a partial response.
2001
+ # @param [String] quota_user
2002
+ # Available to use for quota purposes for server-side applications. Can be any
2003
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2004
+ # @param [Google::Apis::RequestOptions] options
2005
+ # Request-specific options
2006
+ #
2007
+ # @yield [result, err] Result & error if block supplied
2008
+ # @yieldparam result [Google::Apis::ClassroomV1::Empty] parsed result object
2009
+ # @yieldparam err [StandardError] error object if request failed
2010
+ #
2011
+ # @return [Google::Apis::ClassroomV1::Empty]
2012
+ #
2013
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2014
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2015
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2016
+ def delete_user_profile_guardian(student_id, guardian_id, fields: nil, quota_user: nil, options: nil, &block)
2017
+ command = make_simple_command(:delete, 'v1/userProfiles/{studentId}/guardians/{guardianId}', options)
2018
+ command.response_representation = Google::Apis::ClassroomV1::Empty::Representation
2019
+ command.response_class = Google::Apis::ClassroomV1::Empty
2020
+ command.params['studentId'] = student_id unless student_id.nil?
2021
+ command.params['guardianId'] = guardian_id unless guardian_id.nil?
2022
+ command.query['fields'] = fields unless fields.nil?
2023
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2024
+ execute_or_queue_command(command, &block)
2025
+ end
2026
+
2027
+ # Returns a list of guardians that the requesting user is permitted to
2028
+ # view, restricted to those that match the request.
2029
+ # To list guardians for any student that the requesting user may view
2030
+ # guardians for, use the literal character `-` for the student ID.
2031
+ # This method returns the following error codes:
2032
+ # * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting
2033
+ # user is not permitted to view guardian information for that student, if
2034
+ # `"-"` is specified as the `student_id` and the user is not a domain
2035
+ # administrator, if guardians are not enabled for the domain in question,
2036
+ # if the `invited_email_address` filter is set by a user who is not a
2037
+ # domain administrator, or for other access errors.
2038
+ # * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
2039
+ # be recognized (it is not an email address, nor a `student_id` from the
2040
+ # API, nor the literal string `me`). May also be returned if an invalid
2041
+ # `page_token` is provided.
2042
+ # * `NOT_FOUND` if a `student_id` is specified, and its format can be
2043
+ # recognized, but Classroom has no record of that student.
2044
+ # @param [String] student_id
2045
+ # Filter results by the student who the guardian is linked to.
2046
+ # The identifier can be one of the following:
2047
+ # * the numeric identifier for the user
2048
+ # * the email address of the user
2049
+ # * the string literal `"me"`, indicating the requesting user
2050
+ # * the string literal `"-"`, indicating that results should be returned for
2051
+ # all students that the requesting user has access to view.
2052
+ # @param [String] page_token
2053
+ # nextPageToken
2054
+ # value returned from a previous
2055
+ # list call,
2056
+ # indicating that the subsequent page of results should be returned.
2057
+ # The list request
2058
+ # must be otherwise identical to the one that resulted in this token.
2059
+ # @param [String] invited_email_address
2060
+ # Filter results by the email address that the original invitation was sent
2061
+ # to, resulting in this guardian link.
2062
+ # This filter can only be used by domain administrators.
2063
+ # @param [Fixnum] page_size
2064
+ # Maximum number of items to return. Zero or unspecified indicates that the
2065
+ # server may assign a maximum.
2066
+ # The server may return fewer than the specified number of results.
2067
+ # @param [String] fields
2068
+ # Selector specifying which fields to include in a partial response.
2069
+ # @param [String] quota_user
2070
+ # Available to use for quota purposes for server-side applications. Can be any
2071
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2072
+ # @param [Google::Apis::RequestOptions] options
2073
+ # Request-specific options
2074
+ #
2075
+ # @yield [result, err] Result & error if block supplied
2076
+ # @yieldparam result [Google::Apis::ClassroomV1::ListGuardiansResponse] parsed result object
2077
+ # @yieldparam err [StandardError] error object if request failed
2078
+ #
2079
+ # @return [Google::Apis::ClassroomV1::ListGuardiansResponse]
2080
+ #
2081
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2082
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2083
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2084
+ def list_user_profile_guardians(student_id, page_token: nil, invited_email_address: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
2085
+ command = make_simple_command(:get, 'v1/userProfiles/{studentId}/guardians', options)
2086
+ command.response_representation = Google::Apis::ClassroomV1::ListGuardiansResponse::Representation
2087
+ command.response_class = Google::Apis::ClassroomV1::ListGuardiansResponse
2088
+ command.params['studentId'] = student_id unless student_id.nil?
2089
+ command.query['pageToken'] = page_token unless page_token.nil?
2090
+ command.query['invitedEmailAddress'] = invited_email_address unless invited_email_address.nil?
2091
+ command.query['pageSize'] = page_size unless page_size.nil?
2092
+ command.query['fields'] = fields unless fields.nil?
2140
2093
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2094
+ execute_or_queue_command(command, &block)
2095
+ end
2096
+
2097
+ # Returns a specific guardian.
2098
+ # This method returns the following error codes:
2099
+ # * `PERMISSION_DENIED` if no user that matches the provided `student_id`
2100
+ # is visible to the requesting user, if the requesting user is not
2101
+ # permitted to view guardian information for the student identified by the
2102
+ # `student_id`, if guardians are not enabled for the domain in question,
2103
+ # or for other access errors.
2104
+ # * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot
2105
+ # be recognized (it is not an email address, nor a `student_id` from the
2106
+ # API, nor the literal string `me`).
2107
+ # * `NOT_FOUND` if the requesting user is permitted to view guardians for
2108
+ # the requested `student_id`, but no `Guardian` record exists for that
2109
+ # student that matches the provided `guardian_id`.
2110
+ # @param [String] student_id
2111
+ # The student whose guardian is being requested. One of the following:
2112
+ # * the numeric identifier for the user
2113
+ # * the email address of the user
2114
+ # * the string literal `"me"`, indicating the requesting user
2115
+ # @param [String] guardian_id
2116
+ # The `id` field from a `Guardian`.
2117
+ # @param [String] fields
2118
+ # Selector specifying which fields to include in a partial response.
2119
+ # @param [String] quota_user
2120
+ # Available to use for quota purposes for server-side applications. Can be any
2121
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2122
+ # @param [Google::Apis::RequestOptions] options
2123
+ # Request-specific options
2124
+ #
2125
+ # @yield [result, err] Result & error if block supplied
2126
+ # @yieldparam result [Google::Apis::ClassroomV1::Guardian] parsed result object
2127
+ # @yieldparam err [StandardError] error object if request failed
2128
+ #
2129
+ # @return [Google::Apis::ClassroomV1::Guardian]
2130
+ #
2131
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2132
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2133
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2134
+ def get_user_profile_guardian(student_id, guardian_id, fields: nil, quota_user: nil, options: nil, &block)
2135
+ command = make_simple_command(:get, 'v1/userProfiles/{studentId}/guardians/{guardianId}', options)
2136
+ command.response_representation = Google::Apis::ClassroomV1::Guardian::Representation
2137
+ command.response_class = Google::Apis::ClassroomV1::Guardian
2138
+ command.params['studentId'] = student_id unless student_id.nil?
2139
+ command.params['guardianId'] = guardian_id unless guardian_id.nil?
2141
2140
  command.query['fields'] = fields unless fields.nil?
2141
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2142
2142
  execute_or_queue_command(command, &block)
2143
2143
  end
2144
2144