google-api-client 0.13.0 → 0.13.1

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