on develop help sign in
Regenerating gogol-classroom from latest service definition
commitc23ac4de778ffcbc2c84f2e20b5b9c4bcc7651b0 authorBrendan Hay <brendan.g.hay@gmail.com> dateTue 25 Oct 2016, 11:37 (10 years ago) parent652ac73
14 files changed+2460−78
gen/model/classroom/v1/classroom-api.json+401−61 gogol-classroom/gen/Network/Google/Classroom.hs+65 gogol-classroom/gen/Network/Google/Classroom/Types.hs+30 gogol-classroom/gen/Network/Google/Classroom/Types/Product.hs+293−11 gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/CourseWork/StudentSubmissions/List.hs+3−3 gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/List.hs+18−3 gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/Create.hs+240 gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/Get.hs+212 gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/List.hs+269 gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/Patch.hs+250 gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/Guardians/Delete.hs+210 gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/Guardians/Get.hs+205 gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/Guardians/List.hs+257 gogol-classroom/gogol-classroom.cabal+7
gen/model/classroom/v1/classroom-api.json+401−61
@@ -1,11 +1,11 @@
11{
22 "kind": "discovery#restDescription",
3− "etag": "\"C5oy1hgQsABtYOYIOXWcR3BgYqU/CqYvNpV2Som-B9o1jdwhrzhRs18\"",
3+ "etag": "\"C5oy1hgQsABtYOYIOXWcR3BgYqU/mk_oLjlaBwJ1BcBJ5yykCFb6u3w\"",
44 "discoveryVersion": "v1",
55 "id": "classroom:v1",
66 "name": "classroom",
77 "version": "v1",
8− "revision": "20160517",
8+ "revision": "20161006",
99 "title": "Google Classroom API",
1010 "description": "Manages classes, rosters, and invitations in Google Classroom.",
1111 "ownerDomain": "google.com",
@@ -224,6 +224,10 @@
224224 "items": {
225225 "$ref": "CourseMaterialSet"
226226 }
227+ },
228+ "guardiansEnabled": {
229+ "type": "boolean",
230+ "description": "Whether or not guardian notifications are enabled for this course. Read-only."
227231 }
228232 }
229233 },
@@ -427,44 +431,66 @@
427431 }
428432 }
429433 },
430− "Invitation": {
431− "id": "Invitation",
434+ "ListGuardianInvitationsResponse": {
435+ "id": "ListGuardianInvitationsResponse",
432436 "type": "object",
433− "description": "An invitation to join a course.",
437+ "description": "Response when listing guardian invitations.",
434438 "properties": {
435− "id": {
439+ "guardianInvitations": {
440+ "type": "array",
441+ "description": "Guardian invitations that matched the list request.",
442+ "items": {
443+ "$ref": "GuardianInvitation"
444+ }
445+ },
446+ "nextPageToken": {
436447 "type": "string",
437− "description": "Identifier assigned by Classroom. Read-only."
448+ "description": "Token identifying the next page of results to return. If empty, no further results are available."
449+ }
450+ }
451+ },
452+ "GuardianInvitation": {
453+ "id": "GuardianInvitation",
454+ "type": "object",
455+ "description": "An invitation to become the guardian of a specified user, sent to a specified email address.",
456+ "properties": {
457+ "studentId": {
458+ "type": "string",
459+ "description": "ID of the student (in standard format)"
438460 },
439− "userId": {
461+ "invitationId": {
440462 "type": "string",
441− "description": "Identifier of the invited user. When specified as a parameter of a request, this identifier can be set to one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user"
463+ "description": "Unique identifier for this invitation. Read-only."
442464 },
443− "courseId": {
465+ "invitedEmailAddress": {
444466 "type": "string",
445− "description": "Identifier of the course to invite the user to."
467+ "description": "Email address that the invitation was sent to. This field is only visible to domain administrators."
446468 },
447− "role": {
469+ "state": {
448470 "type": "string",
449− "description": "Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`.",
471+ "description": "The state that this invitation is in.",
450472 "enum": [
451− "COURSE_ROLE_UNSPECIFIED",
452− "STUDENT",
453− "TEACHER"
473+ "GUARDIAN_INVITATION_STATE_UNSPECIFIED",
474+ "PENDING",
475+ "COMPLETE"
454476 ]
477+ },
478+ "creationTime": {
479+ "type": "string",
480+ "description": "The time that this invitation was created. Read-only."
455481 }
456482 }
457483 },
458− "ListInvitationsResponse": {
459− "id": "ListInvitationsResponse",
484+ "ListGuardiansResponse": {
485+ "id": "ListGuardiansResponse",
460486 "type": "object",
461− "description": "Response when listing invitations.",
487+ "description": "Response when listing guardians.",
462488 "properties": {
463− "invitations": {
489+ "guardians": {
464490 "type": "array",
465− "description": "Invitations that match the list request.",
491+ "description": "Guardians on this page of results that met the criteria specified in the request.",
466492 "items": {
467− "$ref": "Invitation"
493+ "$ref": "Guardian"
468494 }
469495 },
470496 "nextPageToken": {
@@ -473,6 +499,29 @@
473499 }
474500 }
475501 },
502+ "Guardian": {
503+ "id": "Guardian",
504+ "type": "object",
505+ "description": "Association between a student and a guardian of that student. The guardian may receive information about the student's course work.",
506+ "properties": {
507+ "studentId": {
508+ "type": "string",
509+ "description": "Identifier for the student to whom the guardian relationship applies."
510+ },
511+ "guardianId": {
512+ "type": "string",
513+ "description": "Identifier for the guardian."
514+ },
515+ "guardianProfile": {
516+ "$ref": "UserProfile",
517+ "description": "User profile for the guardian."
518+ },
519+ "invitedEmailAddress": {
520+ "type": "string",
521+ "description": "The email address to which the initial guardian invitation was sent. This field is only visible to domain administrators."
522+ }
523+ }
524+ },
476525 "UserProfile": {
477526 "id": "UserProfile",
478527 "type": "object",
@@ -615,6 +664,52 @@
615664 }
616665 }
617666 },
667+ "Invitation": {
668+ "id": "Invitation",
669+ "type": "object",
670+ "description": "An invitation to join a course.",
671+ "properties": {
672+ "id": {
673+ "type": "string",
674+ "description": "Identifier assigned by Classroom. Read-only."
675+ },
676+ "userId": {
677+ "type": "string",
678+ "description": "Identifier of the invited user. When specified as a parameter of a request, this identifier can be set to one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user"
679+ },
680+ "courseId": {
681+ "type": "string",
682+ "description": "Identifier of the course to invite the user to."
683+ },
684+ "role": {
685+ "type": "string",
686+ "description": "Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`.",
687+ "enum": [
688+ "COURSE_ROLE_UNSPECIFIED",
689+ "STUDENT",
690+ "TEACHER"
691+ ]
692+ }
693+ }
694+ },
695+ "ListInvitationsResponse": {
696+ "id": "ListInvitationsResponse",
697+ "type": "object",
698+ "description": "Response when listing invitations.",
699+ "properties": {
700+ "invitations": {
701+ "type": "array",
702+ "description": "Invitations that match the list request.",
703+ "items": {
704+ "$ref": "Invitation"
705+ }
706+ },
707+ "nextPageToken": {
708+ "type": "string",
709+ "description": "Token identifying the next page of results to return. If empty, no further results are available."
710+ }
711+ }
712+ },
618713 "CourseWork": {
619714 "id": "CourseWork",
620715 "type": "object",
@@ -638,14 +733,14 @@
638733 },
639734 "materials": {
640735 "type": "array",
641− "description": "Additional materials.",
736+ "description": "Additional materials. CourseWork must have no more than 20 material items.",
642737 "items": {
643738 "$ref": "Material"
644739 }
645740 },
646741 "state": {
647742 "type": "string",
648− "description": "Status of this course work.. If unspecified, the default state is `DRAFT`.",
743+ "description": "Status of this course work. If unspecified, the default state is `DRAFT`.",
649744 "enum": [
650745 "COURSE_WORK_STATE_UNSPECIFIED",
651746 "PUBLISHED",
@@ -675,7 +770,7 @@
675770 },
676771 "maxPoints": {
677772 "type": "number",
678− "description": "Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be an integer value.",
773+ "description": "Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value.",
679774 "format": "double"
680775 },
681776 "workType": {
@@ -870,7 +965,7 @@
870965 },
871966 "creationTime": {
872967 "type": "string",
873− "description": "Creation time of this submission.. This may be unset if the student has not accessed this item. Read-only."
968+ "description": "Creation time of this submission. This may be unset if the student has not accessed this item. Read-only."
874969 },
875970 "updateTime": {
876971 "type": "string",
@@ -894,12 +989,12 @@
894989 },
895990 "draftGrade": {
896991 "type": "number",
897− "description": "Optional pending grade. If unset, no grade was set. This must be an integer value. This is only visible to and modifiable by course teachers.",
992+ "description": "Optional pending grade. If unset, no grade was set. This must be a non-negative integer value. This is only visible to and modifiable by course teachers.",
898993 "format": "double"
899994 },
900995 "assignedGrade": {
901996 "type": "number",
902− "description": "Optional grade. If unset, no grade was set. This must be an integer value. This may be modified only by course teachers.",
997+ "description": "Optional grade. If unset, no grade was set. This must be a non-negative integer value. This may be modified only by course teachers.",
903998 "format": "double"
904999 },
9051000 "alternateLink": {
@@ -930,7 +1025,7 @@
9301025 },
9311026 "multipleChoiceSubmission": {
9321027 "$ref": "MultipleChoiceSubmission",
933− "description": "Submission content when course_work_type is MUTIPLE_CHOICE_QUESTION."
1028+ "description": "Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION."
9341029 }
9351030 }
9361031 },
@@ -1033,7 +1128,7 @@
10331128 "properties": {
10341129 "addAttachments": {
10351130 "type": "array",
1036− "description": "Attachments to add. This may only contain link attachments.",
1131+ "description": "Attachments to add. A student submission may not have more than 20 attachments. This may only contain link attachments.",
10371132 "items": {
10381133 "$ref": "Attachment"
10391134 }
@@ -1179,6 +1274,19 @@
11791274 "description": "Restricts returned courses to those having a teacher with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user",
11801275 "location": "query"
11811276 },
1277+ "courseStates": {
1278+ "type": "string",
1279+ "description": "Restricts returned courses to those in one of the specified states",
1280+ "enum": [
1281+ "COURSE_STATE_UNSPECIFIED",
1282+ "ACTIVE",
1283+ "ARCHIVED",
1284+ "PROVISIONED",
1285+ "DECLINED"
1286+ ],
1287+ "repeated": true,
1288+ "location": "query"
1289+ },
11821290 "pageSize": {
11831291 "type": "integer",
11841292 "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.",
@@ -1788,7 +1896,7 @@
17881896 },
17891897 "courseWorkId": {
17901898 "type": "string",
1791− "description": "Identifer of the student work to request. If `user_id` is specified, this may be set to the string literal `\"-\"` to request student work for all course work in the specified course.",
1899+ "description": "Identifer of the student work to request. This may be set to the string literal `\"-\"` to request student work for all course work in the specified course.",
17921900 "required": true,
17931901 "location": "path"
17941902 },
@@ -2016,6 +2124,268 @@
20162124 }
20172125 }
20182126 },
2127+ "userProfiles": {
2128+ "methods": {
2129+ "get": {
2130+ "id": "classroom.userProfiles.get",
2131+ "path": "v1/userProfiles/{userId}",
2132+ "httpMethod": "GET",
2133+ "description": "Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile or if no profile exists with the requested ID or for access errors.",
2134+ "parameters": {
2135+ "userId": {
2136+ "type": "string",
2137+ "description": "Identifier of the profile to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user",
2138+ "required": true,
2139+ "location": "path"
2140+ }
2141+ },
2142+ "parameterOrder": [
2143+ "userId"
2144+ ],
2145+ "response": {
2146+ "$ref": "UserProfile"
2147+ },
2148+ "scopes": [
2149+ "https://www.googleapis.com/auth/classroom.profile.emails",
2150+ "https://www.googleapis.com/auth/classroom.profile.photos",
2151+ "https://www.googleapis.com/auth/classroom.rosters",
2152+ "https://www.googleapis.com/auth/classroom.rosters.readonly"
2153+ ]
2154+ }
2155+ },
2156+ "resources": {
2157+ "guardianInvitations": {
2158+ "methods": {
2159+ "list": {
2160+ "id": "classroom.userProfiles.guardianInvitations.list",
2161+ "path": "v1/userProfiles/{studentId}/guardianInvitations",
2162+ "httpMethod": "GET",
2163+ "description": "Returns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian invitations for that student, if `\"-\"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` or `state` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.",
2164+ "parameters": {
2165+ "studentId": {
2166+ "type": "string",
2167+ "description": "The ID of the student whose guardian invitations are to be returned. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user * the string literal `\"-\"`, indicating that results should be returned for all students that the requesting user is permitted to view guardian invitations.",
2168+ "required": true,
2169+ "location": "path"
2170+ },
2171+ "invitedEmailAddress": {
2172+ "type": "string",
2173+ "description": "If specified, only results with the specified `invited_email_address` will be returned.",
2174+ "location": "query"
2175+ },
2176+ "states": {
2177+ "type": "string",
2178+ "description": "If specified, only results with the specified `state` values will be returned. Otherwise, results with a `state` of `PENDING` will be returned.",
2179+ "enum": [
2180+ "GUARDIAN_INVITATION_STATE_UNSPECIFIED",
2181+ "PENDING",
2182+ "COMPLETE"
2183+ ],
2184+ "repeated": true,
2185+ "location": "query"
2186+ },
2187+ "pageToken": {
2188+ "type": "string",
2189+ "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.",
2190+ "location": "query"
2191+ },
2192+ "pageSize": {
2193+ "type": "integer",
2194+ "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.",
2195+ "format": "int32",
2196+ "location": "query"
2197+ }
2198+ },
2199+ "parameterOrder": [
2200+ "studentId"
2201+ ],
2202+ "response": {
2203+ "$ref": "ListGuardianInvitationsResponse"
2204+ }
2205+ },
2206+ "get": {
2207+ "id": "classroom.userProfiles.guardianInvitations.get",
2208+ "path": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}",
2209+ "httpMethod": "GET",
2210+ "description": "Returns a specific guardian invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian invitations for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given student or `invitation_id`. May also be returned if the student exists, but the requesting user does not have access to see that student.",
2211+ "parameters": {
2212+ "studentId": {
2213+ "type": "string",
2214+ "description": "The ID of the student whose guardian invitation is being requested.",
2215+ "required": true,
2216+ "location": "path"
2217+ },
2218+ "invitationId": {
2219+ "type": "string",
2220+ "description": "The `id` field of the `GuardianInvitation` being requested.",
2221+ "required": true,
2222+ "location": "path"
2223+ }
2224+ },
2225+ "parameterOrder": [
2226+ "studentId",
2227+ "invitationId"
2228+ ],
2229+ "response": {
2230+ "$ref": "GuardianInvitation"
2231+ }
2232+ },
2233+ "create": {
2234+ "id": "classroom.userProfiles.guardianInvitations.create",
2235+ "path": "v1/userProfiles/{studentId}/guardianInvitations",
2236+ "httpMethod": "POST",
2237+ "description": "Creates a guardian invitation, and sends an email to the guardian asking them to confirm that they are the student's guardian. Once the guardian accepts the invitation, their `state` will change to `COMPLETED` and they will start receiving guardian notifications. A `Guardian` resource will also be created to represent the active guardian. The request object must have the `student_id` and `invited_email_address` fields set. Failing to set these fields, or setting any other fields in the request, will result in an error. This method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if the guardian in question has already rejected too many requests for that student, if guardians are not enabled for the domain in question, or for other access errors. * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian link limit. * `INVALID_ARGUMENT` if the guardian email address is not valid (for example, if it is too long), or if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API). This error will also be returned if read-only fields are set, or if the `state` field is set to to a value other than `PENDING`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student. * `ALREADY_EXISTS` if there is already a pending guardian invitation for the student and `invited_email_address` provided, or if the provided `invited_email_address` matches the Google account of an existing `Guardian` for this user.",
2238+ "parameters": {
2239+ "studentId": {
2240+ "type": "string",
2241+ "description": "ID of the student (in standard format)",
2242+ "required": true,
2243+ "location": "path"
2244+ }
2245+ },
2246+ "parameterOrder": [
2247+ "studentId"
2248+ ],
2249+ "request": {
2250+ "$ref": "GuardianInvitation"
2251+ },
2252+ "response": {
2253+ "$ref": "GuardianInvitation"
2254+ }
2255+ },
2256+ "patch": {
2257+ "id": "classroom.userProfiles.guardianInvitations.patch",
2258+ "path": "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}",
2259+ "httpMethod": "PATCH",
2260+ "description": "Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other access errors. * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. * `INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom.",
2261+ "parameters": {
2262+ "studentId": {
2263+ "type": "string",
2264+ "description": "The ID of the student whose guardian invitation is to be modified.",
2265+ "required": true,
2266+ "location": "path"
2267+ },
2268+ "invitationId": {
2269+ "type": "string",
2270+ "description": "The `id` field of the `GuardianInvitation` to be modified.",
2271+ "required": true,
2272+ "location": "path"
2273+ },
2274+ "updateMask": {
2275+ "type": "string",
2276+ "description": "Mask that identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. The following fields are valid: * `state` When set in a query parameter, this field should be specified as `updateMask=,,...`",
2277+ "location": "query"
2278+ }
2279+ },
2280+ "parameterOrder": [
2281+ "studentId",
2282+ "invitationId"
2283+ ],
2284+ "request": {
2285+ "$ref": "GuardianInvitation"
2286+ },
2287+ "response": {
2288+ "$ref": "GuardianInvitation"
2289+ }
2290+ }
2291+ }
2292+ },
2293+ "guardians": {
2294+ "methods": {
2295+ "list": {
2296+ "id": "classroom.userProfiles.guardians.list",
2297+ "path": "v1/userProfiles/{studentId}/guardians",
2298+ "httpMethod": "GET",
2299+ "description": "Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that the requesting user may view guardians for, use the literal character `-` for the student ID. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian information for that student, if `\"-\"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, if the `invited_email_address` filter is set by a user who is not a domain administrator, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.",
2300+ "parameters": {
2301+ "studentId": {
2302+ "type": "string",
2303+ "description": "Filter results by the student who the guardian is linked to. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user * the string literal `\"-\"`, indicating that results should be returned for all students that the requesting user has access to view.",
2304+ "required": true,
2305+ "location": "path"
2306+ },
2307+ "invitedEmailAddress": {
2308+ "type": "string",
2309+ "description": "Filter results by the email address that the original invitation was sent to, resulting in this guardian link. This filter can only be used by domain administrators.",
2310+ "location": "query"
2311+ },
2312+ "pageToken": {
2313+ "type": "string",
2314+ "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.",
2315+ "location": "query"
2316+ },
2317+ "pageSize": {
2318+ "type": "integer",
2319+ "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.",
2320+ "format": "int32",
2321+ "location": "query"
2322+ }
2323+ },
2324+ "parameterOrder": [
2325+ "studentId"
2326+ ],
2327+ "response": {
2328+ "$ref": "ListGuardiansResponse"
2329+ }
2330+ },
2331+ "get": {
2332+ "id": "classroom.userProfiles.guardians.get",
2333+ "path": "v1/userProfiles/{studentId}/guardians/{guardianId}",
2334+ "httpMethod": "GET",
2335+ "description": "Returns a specific guardian. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian information for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given student or `guardian_id`, or if the guardian has been disabled.",
2336+ "parameters": {
2337+ "studentId": {
2338+ "type": "string",
2339+ "description": "The student whose guardian is being requested. One of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user",
2340+ "required": true,
2341+ "location": "path"
2342+ },
2343+ "guardianId": {
2344+ "type": "string",
2345+ "description": "The `id` field from a `Guardian`.",
2346+ "required": true,
2347+ "location": "path"
2348+ }
2349+ },
2350+ "parameterOrder": [
2351+ "studentId",
2352+ "guardianId"
2353+ ],
2354+ "response": {
2355+ "$ref": "Guardian"
2356+ }
2357+ },
2358+ "delete": {
2359+ "id": "classroom.userProfiles.guardians.delete",
2360+ "path": "v1/userProfiles/{studentId}/guardians/{guardianId}",
2361+ "httpMethod": "DELETE",
2362+ "description": "Deletes a guardian. The guardian will no longer receive guardian notifications and the guardian will no longer be accessible via the API. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to manage guardians for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API). * `NOT_FOUND` if Classroom cannot find any record of the given `student_id` or `guardian_id`, or if the guardian has already been disabled.",
2363+ "parameters": {
2364+ "studentId": {
2365+ "type": "string",
2366+ "description": "The student whose guardian is to be deleted. One of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user",
2367+ "required": true,
2368+ "location": "path"
2369+ },
2370+ "guardianId": {
2371+ "type": "string",
2372+ "description": "The `id` field from a `Guardian`.",
2373+ "required": true,
2374+ "location": "path"
2375+ }
2376+ },
2377+ "parameterOrder": [
2378+ "studentId",
2379+ "guardianId"
2380+ ],
2381+ "response": {
2382+ "$ref": "Empty"
2383+ }
2384+ }
2385+ }
2386+ }
2387+ }
2388+ },
20192389 "invitations": {
20202390 "methods": {
20212391 "create": {
@@ -2140,36 +2510,6 @@
21402510 ]
21412511 }
21422512 }
2143− },
2144− "userProfiles": {
2145− "methods": {
2146− "get": {
2147− "id": "classroom.userProfiles.get",
2148− "path": "v1/userProfiles/{userId}",
2149− "httpMethod": "GET",
2150− "description": "Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile or if no profile exists with the requested ID or for access errors.",
2151− "parameters": {
2152− "userId": {
2153− "type": "string",
2154− "description": "Identifier of the profile to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user",
2155− "required": true,
2156− "location": "path"
2157− }
2158− },
2159− "parameterOrder": [
2160− "userId"
2161− ],
2162− "response": {
2163− "$ref": "UserProfile"
2164− },
2165− "scopes": [
2166− "https://www.googleapis.com/auth/classroom.profile.emails",
2167− "https://www.googleapis.com/auth/classroom.profile.photos",
2168− "https://www.googleapis.com/auth/classroom.rosters",
2169− "https://www.googleapis.com/auth/classroom.rosters.readonly"
2170− ]
2171− }
2172− }
21732513 }
21742514 }
21752515}
gogol-classroom/gen/Network/Google/Classroom.hs+65
@@ -140,6 +140,27 @@ module Network.Google.Classroom
140140 -- ** classroom.userProfiles.get
141141 , module Network.Google.Resource.Classroom.UserProFiles.Get
142142
143+ -- ** classroom.userProfiles.guardianInvitations.create
144+ , module Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Create
145+
146+ -- ** classroom.userProfiles.guardianInvitations.get
147+ , module Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Get
148+
149+ -- ** classroom.userProfiles.guardianInvitations.list
150+ , module Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.List
151+
152+ -- ** classroom.userProfiles.guardianInvitations.patch
153+ , module Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Patch
154+
155+ -- ** classroom.userProfiles.guardians.delete
156+ , module Network.Google.Resource.Classroom.UserProFiles.Guardians.Delete
157+
158+ -- ** classroom.userProfiles.guardians.get
159+ , module Network.Google.Resource.Classroom.UserProFiles.Guardians.Get
160+
161+ -- ** classroom.userProfiles.guardians.list
162+ , module Network.Google.Resource.Classroom.UserProFiles.Guardians.List
163+
143164 -- * Types
144165
145166 -- ** ListCourseAliasesResponse
@@ -177,6 +198,15 @@ module Network.Google.Classroom
177198 , dfTitle
178199 , dfAlternateLink
179200
201+ -- ** GuardianInvitation
202+ , GuardianInvitation
203+ , guardianInvitation
204+ , giCreationTime
205+ , giStudentId
206+ , giState
207+ , giInvitationId
208+ , giInvitedEmailAddress
209+
180210 -- ** ReturnStudentSubmissionRequest
181211 , ReturnStudentSubmissionRequest
182212 , returnStudentSubmissionRequest
@@ -242,6 +272,14 @@ module Network.Google.Classroom
242272 , lirNextPageToken
243273 , lirInvitations
244274
275+ -- ** Guardian
276+ , Guardian
277+ , guardian
278+ , gStudentId
279+ , gGuardianId
280+ , gInvitedEmailAddress
281+ , gGuardianProFile
282+
245283 -- ** CourseMaterial
246284 , CourseMaterial
247285 , courseMaterial
@@ -291,6 +329,12 @@ module Network.Google.Classroom
291329 , ssAlternateLink
292330 , ssCourseWorkId
293331
332+ -- ** ListGuardiansResponse
333+ , ListGuardiansResponse
334+ , listGuardiansResponse
335+ , lgrNextPageToken
336+ , lgrGuardians
337+
294338 -- ** Date
295339 , Date
296340 , date
@@ -366,6 +410,7 @@ module Network.Google.Classroom
366410 , cTeacherGroupEmail
367411 , cTeacherFolder
368412 , cCourseState
413+ , cGuardiansEnabled
369414 , cEnrollmentCode
370415 , cUpdateTime
371416 , cOwnerId
@@ -385,6 +430,12 @@ module Network.Google.Classroom
385430 , todMinutes
386431 , todSeconds
387432
433+ -- ** ListGuardianInvitationsResponse
434+ , ListGuardianInvitationsResponse
435+ , listGuardianInvitationsResponse
436+ , lgirNextPageToken
437+ , lgirGuardianInvitations
438+
388439 -- ** Assignment
389440 , Assignment
390441 , assignment
@@ -465,6 +516,13 @@ import Network.Google.Resource.Classroom.Invitations.Delete
465516import Network.Google.Resource.Classroom.Invitations.Get
466517import Network.Google.Resource.Classroom.Invitations.List
467518import Network.Google.Resource.Classroom.UserProFiles.Get
519+import Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Create
520+import Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Get
521+import Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.List
522+import Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Patch
523+import Network.Google.Resource.Classroom.UserProFiles.Guardians.Delete
524+import Network.Google.Resource.Classroom.UserProFiles.Guardians.Get
525+import Network.Google.Resource.Classroom.UserProFiles.Guardians.List
468526
469527{- $resources
470528TODO
@@ -508,4 +566,11 @@ type ClassroomAPI =
508566 :<|> CoursesCreateResource
509567 :<|> CoursesDeleteResource
510568 :<|> CoursesUpdateResource
569+ :<|> UserProFilesGuardiansListResource
570+ :<|> UserProFilesGuardiansGetResource
571+ :<|> UserProFilesGuardiansDeleteResource
572+ :<|> UserProFilesGuardianInvitationsListResource
573+ :<|> UserProFilesGuardianInvitationsPatchResource
574+ :<|> UserProFilesGuardianInvitationsGetResource
575+ :<|> UserProFilesGuardianInvitationsCreateResource
511576 :<|> UserProFilesGetResource
gogol-classroom/gen/Network/Google/Classroom/Types.hs+30
@@ -69,6 +69,15 @@ module Network.Google.Classroom.Types
6969 , dfTitle
7070 , dfAlternateLink
7171
72+ -- * GuardianInvitation
73+ , GuardianInvitation
74+ , guardianInvitation
75+ , giCreationTime
76+ , giStudentId
77+ , giState
78+ , giInvitationId
79+ , giInvitedEmailAddress
80+
7281 -- * ReturnStudentSubmissionRequest
7382 , ReturnStudentSubmissionRequest
7483 , returnStudentSubmissionRequest
@@ -134,6 +143,14 @@ module Network.Google.Classroom.Types
134143 , lirNextPageToken
135144 , lirInvitations
136145
146+ -- * Guardian
147+ , Guardian
148+ , guardian
149+ , gStudentId
150+ , gGuardianId
151+ , gInvitedEmailAddress
152+ , gGuardianProFile
153+
137154 -- * CourseMaterial
138155 , CourseMaterial
139156 , courseMaterial
@@ -183,6 +200,12 @@ module Network.Google.Classroom.Types
183200 , ssAlternateLink
184201 , ssCourseWorkId
185202
203+ -- * ListGuardiansResponse
204+ , ListGuardiansResponse
205+ , listGuardiansResponse
206+ , lgrNextPageToken
207+ , lgrGuardians
208+
186209 -- * Date
187210 , Date
188211 , date
@@ -258,6 +281,7 @@ module Network.Google.Classroom.Types
258281 , cTeacherGroupEmail
259282 , cTeacherFolder
260283 , cCourseState
284+ , cGuardiansEnabled
261285 , cEnrollmentCode
262286 , cUpdateTime
263287 , cOwnerId
@@ -277,6 +301,12 @@ module Network.Google.Classroom.Types
277301 , todMinutes
278302 , todSeconds
279303
304+ -- * ListGuardianInvitationsResponse
305+ , ListGuardianInvitationsResponse
306+ , listGuardianInvitationsResponse
307+ , lgirNextPageToken
308+ , lgirGuardianInvitations
309+
280310 -- * Assignment
281311 , Assignment
282312 , assignment
gogol-classroom/gen/Network/Google/Classroom/Types/Product.hs+293−11
@@ -161,12 +161,13 @@ cwCreationTime
161161 = lens _cwCreationTime
162162 (\ s a -> s{_cwCreationTime = a})
163163
164−-- | Status of this course work.. If unspecified, the default state is
164+-- | Status of this course work. If unspecified, the default state is
165165-- \`DRAFT\`.
166166cwState :: Lens' CourseWork (Maybe Text)
167167cwState = lens _cwState (\ s a -> s{_cwState = a})
168168
169−-- | Additional materials.
169+-- | Additional materials. CourseWork must have no more than 20 material
170+-- items.
170171cwMaterials :: Lens' CourseWork [Material]
171172cwMaterials
172173 = lens _cwMaterials (\ s a -> s{_cwMaterials = a}) .
@@ -179,7 +180,8 @@ cwCourseId
179180 = lens _cwCourseId (\ s a -> s{_cwCourseId = a})
180181
181182-- | Maximum grade for this course work. If zero or unspecified, this
182−-- assignment is considered ungraded. This must be an integer value.
183+-- assignment is considered ungraded. This must be a non-negative integer
184+-- value.
183185cwMaxPoints :: Lens' CourseWork (Maybe Double)
184186cwMaxPoints
185187 = lens _cwMaxPoints (\ s a -> s{_cwMaxPoints = a}) .
@@ -376,6 +378,91 @@ instance ToJSON DriveFile where
376378 ("id" .=) <$> _dfId, ("title" .=) <$> _dfTitle,
377379 ("alternateLink" .=) <$> _dfAlternateLink])
378380
381+-- | An invitation to become the guardian of a specified user, sent to a
382+-- specified email address.
383+--
384+-- /See:/ 'guardianInvitation' smart constructor.
385+data GuardianInvitation = GuardianInvitation'
386+ { _giCreationTime :: !(Maybe Text)
387+ , _giStudentId :: !(Maybe Text)
388+ , _giState :: !(Maybe Text)
389+ , _giInvitationId :: !(Maybe Text)
390+ , _giInvitedEmailAddress :: !(Maybe Text)
391+ } deriving (Eq,Show,Data,Typeable,Generic)
392+
393+-- | Creates a value of 'GuardianInvitation' with the minimum fields required to make a request.
394+--
395+-- Use one of the following lenses to modify other fields as desired:
396+--
397+-- * 'giCreationTime'
398+--
399+-- * 'giStudentId'
400+--
401+-- * 'giState'
402+--
403+-- * 'giInvitationId'
404+--
405+-- * 'giInvitedEmailAddress'
406+guardianInvitation
407+ :: GuardianInvitation
408+guardianInvitation =
409+ GuardianInvitation'
410+ { _giCreationTime = Nothing
411+ , _giStudentId = Nothing
412+ , _giState = Nothing
413+ , _giInvitationId = Nothing
414+ , _giInvitedEmailAddress = Nothing
415+ }
416+
417+-- | The time that this invitation was created. Read-only.
418+giCreationTime :: Lens' GuardianInvitation (Maybe Text)
419+giCreationTime
420+ = lens _giCreationTime
421+ (\ s a -> s{_giCreationTime = a})
422+
423+-- | ID of the student (in standard format)
424+giStudentId :: Lens' GuardianInvitation (Maybe Text)
425+giStudentId
426+ = lens _giStudentId (\ s a -> s{_giStudentId = a})
427+
428+-- | The state that this invitation is in.
429+giState :: Lens' GuardianInvitation (Maybe Text)
430+giState = lens _giState (\ s a -> s{_giState = a})
431+
432+-- | Unique identifier for this invitation. Read-only.
433+giInvitationId :: Lens' GuardianInvitation (Maybe Text)
434+giInvitationId
435+ = lens _giInvitationId
436+ (\ s a -> s{_giInvitationId = a})
437+
438+-- | Email address that the invitation was sent to. This field is only
439+-- visible to domain administrators.
440+giInvitedEmailAddress :: Lens' GuardianInvitation (Maybe Text)
441+giInvitedEmailAddress
442+ = lens _giInvitedEmailAddress
443+ (\ s a -> s{_giInvitedEmailAddress = a})
444+
445+instance FromJSON GuardianInvitation where
446+ parseJSON
447+ = withObject "GuardianInvitation"
448+ (\ o ->
449+ GuardianInvitation' <$>
450+ (o .:? "creationTime") <*> (o .:? "studentId") <*>
451+ (o .:? "state")
452+ <*> (o .:? "invitationId")
453+ <*> (o .:? "invitedEmailAddress"))
454+
455+instance ToJSON GuardianInvitation where
456+ toJSON GuardianInvitation'{..}
457+ = object
458+ (catMaybes
459+ [("creationTime" .=) <$> _giCreationTime,
460+ ("studentId" .=) <$> _giStudentId,
461+ ("state" .=) <$> _giState,
462+ ("invitationId" .=) <$> _giInvitationId,
463+ ("invitedEmailAddress" .=) <$>
464+ _giInvitedEmailAddress])
465+
379466-- | Request to return a student submission.
380467--
381468-- /See:/ 'returnStudentSubmissionRequest' smart constructor.
@@ -650,7 +737,8 @@ modifyAttachmentsRequest =
650737 { _marAddAttachments = Nothing
651738 }
652739
653−-- | Attachments to add. This may only contain link attachments.
740+-- | Attachments to add. A student submission may not have more than 20
741+-- attachments. This may only contain link attachments.
654742marAddAttachments :: Lens' ModifyAttachmentsRequest [Attachment]
655743marAddAttachments
656744 = lens _marAddAttachments
@@ -882,6 +970,79 @@ instance ToJSON ListInvitationsResponse where
882970 [("nextPageToken" .=) <$> _lirNextPageToken,
883971 ("invitations" .=) <$> _lirInvitations])
884972
973+-- | Association between a student and a guardian of that student. The
974+-- guardian may receive information about the student\'s course work.
975+--
976+-- /See:/ 'guardian' smart constructor.
977+data Guardian = Guardian'
978+ { _gStudentId :: !(Maybe Text)
979+ , _gGuardianId :: !(Maybe Text)
980+ , _gInvitedEmailAddress :: !(Maybe Text)
981+ , _gGuardianProFile :: !(Maybe UserProFile)
982+ } deriving (Eq,Show,Data,Typeable,Generic)
983+
984+-- | Creates a value of 'Guardian' with the minimum fields required to make a request.
985+--
986+-- Use one of the following lenses to modify other fields as desired:
987+--
988+-- * 'gStudentId'
989+--
990+-- * 'gGuardianId'
991+--
992+-- * 'gInvitedEmailAddress'
993+--
994+-- * 'gGuardianProFile'
995+guardian
996+ :: Guardian
997+guardian =
998+ Guardian'
999+ { _gStudentId = Nothing
1000+ , _gGuardianId = Nothing
1001+ , _gInvitedEmailAddress = Nothing
1002+ , _gGuardianProFile = Nothing
1003+ }
1004+
1005+-- | Identifier for the student to whom the guardian relationship applies.
1006+gStudentId :: Lens' Guardian (Maybe Text)
1007+gStudentId
1008+ = lens _gStudentId (\ s a -> s{_gStudentId = a})
1009+
1010+-- | Identifier for the guardian.
1011+gGuardianId :: Lens' Guardian (Maybe Text)
1012+gGuardianId
1013+ = lens _gGuardianId (\ s a -> s{_gGuardianId = a})
1014+
1015+-- | The email address to which the initial guardian invitation was sent.
1016+-- This field is only visible to domain administrators.
1017+gInvitedEmailAddress :: Lens' Guardian (Maybe Text)
1018+gInvitedEmailAddress
1019+ = lens _gInvitedEmailAddress
1020+ (\ s a -> s{_gInvitedEmailAddress = a})
1021+
1022+-- | User profile for the guardian.
1023+gGuardianProFile :: Lens' Guardian (Maybe UserProFile)
1024+gGuardianProFile
1025+ = lens _gGuardianProFile
1026+ (\ s a -> s{_gGuardianProFile = a})
1027+
1028+instance FromJSON Guardian where
1029+ parseJSON
1030+ = withObject "Guardian"
1031+ (\ o ->
1032+ Guardian' <$>
1033+ (o .:? "studentId") <*> (o .:? "guardianId") <*>
1034+ (o .:? "invitedEmailAddress")
1035+ <*> (o .:? "guardianProfile"))
1036+
1037+instance ToJSON Guardian where
1038+ toJSON Guardian'{..}
1039+ = object
1040+ (catMaybes
1041+ [("studentId" .=) <$> _gStudentId,
1042+ ("guardianId" .=) <$> _gGuardianId,
1043+ ("invitedEmailAddress" .=) <$> _gInvitedEmailAddress,
1044+ ("guardianProfile" .=) <$> _gGuardianProFile])
1045+
8851046-- | A material attached to a course as part of a material set.
8861047--
8871048-- /See:/ 'courseMaterial' smart constructor.
@@ -1203,7 +1364,7 @@ studentSubmission =
12031364 , _ssCourseWorkId = Nothing
12041365 }
12051366
1206−-- | Creation time of this submission.. This may be unset if the student has
1367+-- | Creation time of this submission. This may be unset if the student has
12071368-- not accessed this item. Read-only.
12081369ssCreationTime :: Lens' StudentSubmission (Maybe Text)
12091370ssCreationTime
@@ -1223,7 +1384,7 @@ ssCourseId :: Lens' StudentSubmission (Maybe Text)
12231384ssCourseId
12241385 = lens _ssCourseId (\ s a -> s{_ssCourseId = a})
12251386
1226−-- | Submission content when course_work_type is MUTIPLE_CHOICE_QUESTION.
1387+-- | Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION.
12271388ssMultipleChoiceSubmission :: Lens' StudentSubmission (Maybe MultipleChoiceSubmission)
12281389ssMultipleChoiceSubmission
12291390 = lens _ssMultipleChoiceSubmission
@@ -1265,8 +1426,8 @@ ssCourseWorkType
12651426 = lens _ssCourseWorkType
12661427 (\ s a -> s{_ssCourseWorkType = a})
12671428
1268−-- | Optional grade. If unset, no grade was set. This must be an integer
1269−-- value. This may be modified only by course teachers.
1429+-- | Optional grade. If unset, no grade was set. This must be a non-negative
1430+-- integer value. This may be modified only by course teachers.
12701431ssAssignedGrade :: Lens' StudentSubmission (Maybe Double)
12711432ssAssignedGrade
12721433 = lens _ssAssignedGrade
@@ -1278,9 +1439,9 @@ ssAssignedGrade
12781439ssId :: Lens' StudentSubmission (Maybe Text)
12791440ssId = lens _ssId (\ s a -> s{_ssId = a})
12801441
1281−-- | Optional pending grade. If unset, no grade was set. This must be an
1282−-- integer value. This is only visible to and modifiable by course
1283−-- teachers.
1442+-- | Optional pending grade. If unset, no grade was set. This must be a
1443+-- non-negative integer value. This is only visible to and modifiable by
1444+-- course teachers.
12841445ssDraftGrade :: Lens' StudentSubmission (Maybe Double)
12851446ssDraftGrade
12861447 = lens _ssDraftGrade (\ s a -> s{_ssDraftGrade = a})
@@ -1343,6 +1504,59 @@ instance ToJSON StudentSubmission where
13431504 ("alternateLink" .=) <$> _ssAlternateLink,
13441505 ("courseWorkId" .=) <$> _ssCourseWorkId])
13451506
1507+-- | Response when listing guardians.
1508+--
1509+-- /See:/ 'listGuardiansResponse' smart constructor.
1510+data ListGuardiansResponse = ListGuardiansResponse'
1511+ { _lgrNextPageToken :: !(Maybe Text)
1512+ , _lgrGuardians :: !(Maybe [Guardian])
1513+ } deriving (Eq,Show,Data,Typeable,Generic)
1514+
1515+-- | Creates a value of 'ListGuardiansResponse' with the minimum fields required to make a request.
1516+--
1517+-- Use one of the following lenses to modify other fields as desired:
1518+--
1519+-- * 'lgrNextPageToken'
1520+--
1521+-- * 'lgrGuardians'
1522+listGuardiansResponse
1523+ :: ListGuardiansResponse
1524+listGuardiansResponse =
1525+ ListGuardiansResponse'
1526+ { _lgrNextPageToken = Nothing
1527+ , _lgrGuardians = Nothing
1528+ }
1529+
1530+-- | Token identifying the next page of results to return. If empty, no
1531+-- further results are available.
1532+lgrNextPageToken :: Lens' ListGuardiansResponse (Maybe Text)
1533+lgrNextPageToken
1534+ = lens _lgrNextPageToken
1535+ (\ s a -> s{_lgrNextPageToken = a})
1536+
1537+-- | Guardians on this page of results that met the criteria specified in the
1538+-- request.
1539+lgrGuardians :: Lens' ListGuardiansResponse [Guardian]
1540+lgrGuardians
1541+ = lens _lgrGuardians (\ s a -> s{_lgrGuardians = a})
1542+ . _Default
1543+ . _Coerce
1544+
1545+instance FromJSON ListGuardiansResponse where
1546+ parseJSON
1547+ = withObject "ListGuardiansResponse"
1548+ (\ o ->
1549+ ListGuardiansResponse' <$>
1550+ (o .:? "nextPageToken") <*>
1551+ (o .:? "guardians" .!= mempty))
1552+
1553+instance ToJSON ListGuardiansResponse where
1554+ toJSON ListGuardiansResponse'{..}
1555+ = object
1556+ (catMaybes
1557+ [("nextPageToken" .=) <$> _lgrNextPageToken,
1558+ ("guardians" .=) <$> _lgrGuardians])
1559+
13461560-- | Represents a whole calendar date, e.g. date of birth. The time of day
13471561-- and time zone are either specified elsewhere or are not significant. The
13481562-- date is relative to the Proleptic Gregorian Calendar. The day may be 0
@@ -1905,6 +2119,7 @@ data Course = Course'
19052119 , _cTeacherGroupEmail :: !(Maybe Text)
19062120 , _cTeacherFolder :: !(Maybe DriveFolder)
19072121 , _cCourseState :: !(Maybe Text)
2122+ , _cGuardiansEnabled :: !(Maybe Bool)
19082123 , _cEnrollmentCode :: !(Maybe Text)
19092124 , _cUpdateTime :: !(Maybe Text)
19102125 , _cOwnerId :: !(Maybe Text)
@@ -1933,6 +2148,8 @@ data Course = Course'
19332148--
19342149-- * 'cCourseState'
19352150--
2151+-- * 'cGuardiansEnabled'
2152+--
19362153-- * 'cEnrollmentCode'
19372154--
19382155-- * 'cUpdateTime'
@@ -1962,6 +2179,7 @@ course =
19622179 , _cTeacherGroupEmail = Nothing
19632180 , _cTeacherFolder = Nothing
19642181 , _cCourseState = Nothing
2182+ , _cGuardiansEnabled = Nothing
19652183 , _cEnrollmentCode = Nothing
19662184 , _cUpdateTime = Nothing
19672185 , _cOwnerId = Nothing
@@ -2017,6 +2235,13 @@ cCourseState :: Lens' Course (Maybe Text)
20172235cCourseState
20182236 = lens _cCourseState (\ s a -> s{_cCourseState = a})
20192237
2238+-- | Whether or not guardian notifications are enabled for this course.
2239+-- Read-only.
2240+cGuardiansEnabled :: Lens' Course (Maybe Bool)
2241+cGuardiansEnabled
2242+ = lens _cGuardiansEnabled
2243+ (\ s a -> s{_cGuardiansEnabled = a})
2244+
20202245-- | Enrollment code to use when joining this course. Specifying this field
20212246-- in a course update mask results in an error. Read-only.
20222247cEnrollmentCode :: Lens' Course (Maybe Text)
@@ -2099,6 +2324,7 @@ instance FromJSON Course where
20992324 <*> (o .:? "teacherGroupEmail")
21002325 <*> (o .:? "teacherFolder")
21012326 <*> (o .:? "courseState")
2327+ <*> (o .:? "guardiansEnabled")
21022328 <*> (o .:? "enrollmentCode")
21032329 <*> (o .:? "updateTime")
21042330 <*> (o .:? "ownerId")
@@ -2120,6 +2346,7 @@ instance ToJSON Course where
21202346 ("teacherGroupEmail" .=) <$> _cTeacherGroupEmail,
21212347 ("teacherFolder" .=) <$> _cTeacherFolder,
21222348 ("courseState" .=) <$> _cCourseState,
2349+ ("guardiansEnabled" .=) <$> _cGuardiansEnabled,
21232350 ("enrollmentCode" .=) <$> _cEnrollmentCode,
21242351 ("updateTime" .=) <$> _cUpdateTime,
21252352 ("ownerId" .=) <$> _cOwnerId, ("name" .=) <$> _cName,
@@ -2209,6 +2436,61 @@ instance ToJSON TimeOfDay' where
22092436 ("minutes" .=) <$> _todMinutes,
22102437 ("seconds" .=) <$> _todSeconds])
22112438
2439+-- | Response when listing guardian invitations.
2440+--
2441+-- /See:/ 'listGuardianInvitationsResponse' smart constructor.
2442+data ListGuardianInvitationsResponse = ListGuardianInvitationsResponse'
2443+ { _lgirNextPageToken :: !(Maybe Text)
2444+ , _lgirGuardianInvitations :: !(Maybe [GuardianInvitation])
2445+ } deriving (Eq,Show,Data,Typeable,Generic)
2446+
2447+-- | Creates a value of 'ListGuardianInvitationsResponse' with the minimum fields required to make a request.
2448+--
2449+-- Use one of the following lenses to modify other fields as desired:
2450+--
2451+-- * 'lgirNextPageToken'
2452+--
2453+-- * 'lgirGuardianInvitations'
2454+listGuardianInvitationsResponse
2455+ :: ListGuardianInvitationsResponse
2456+listGuardianInvitationsResponse =
2457+ ListGuardianInvitationsResponse'
2458+ { _lgirNextPageToken = Nothing
2459+ , _lgirGuardianInvitations = Nothing
2460+ }
2461+
2462+-- | Token identifying the next page of results to return. If empty, no
2463+-- further results are available.
2464+lgirNextPageToken :: Lens' ListGuardianInvitationsResponse (Maybe Text)
2465+lgirNextPageToken
2466+ = lens _lgirNextPageToken
2467+ (\ s a -> s{_lgirNextPageToken = a})
2468+
2469+-- | Guardian invitations that matched the list request.
2470+lgirGuardianInvitations :: Lens' ListGuardianInvitationsResponse [GuardianInvitation]
2471+lgirGuardianInvitations
2472+ = lens _lgirGuardianInvitations
2473+ (\ s a -> s{_lgirGuardianInvitations = a})
2474+ . _Default
2475+ . _Coerce
2476+
2477+instance FromJSON ListGuardianInvitationsResponse
2478+ where
2479+ parseJSON
2480+ = withObject "ListGuardianInvitationsResponse"
2481+ (\ o ->
2482+ ListGuardianInvitationsResponse' <$>
2483+ (o .:? "nextPageToken") <*>
2484+ (o .:? "guardianInvitations" .!= mempty))
2485+
2486+instance ToJSON ListGuardianInvitationsResponse where
2487+ toJSON ListGuardianInvitationsResponse'{..}
2488+ = object
2489+ (catMaybes
2490+ [("nextPageToken" .=) <$> _lgirNextPageToken,
2491+ ("guardianInvitations" .=) <$>
2492+ _lgirGuardianInvitations])
2493+
22122494-- | Additional details for assignments.
22132495--
22142496-- /See:/ 'assignment' smart constructor.
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/CourseWork/StudentSubmissions/List.hs+3−3
@@ -256,9 +256,9 @@ ccwsslCallback
256256 = lens _ccwsslCallback
257257 (\ s a -> s{_ccwsslCallback = a})
258258
259−-- | Identifer of the student work to request. If \`user_id\` is specified,
260−-- this may be set to the string literal \`\"-\"\` to request student work
261−-- for all course work in the specified course.
259+-- | Identifer of the student work to request. This may be set to the string
260+-- literal \`\"-\"\` to request student work for all course work in the
261+-- specified course.
262262ccwsslCourseWorkId :: Lens' CoursesCourseWorkStudentSubmissionsList Text
263263ccwsslCourseWorkId
264264 = lens _ccwsslCourseWorkId
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/List.hs+18−3
@@ -47,6 +47,7 @@ module Network.Google.Resource.Classroom.Courses.List
4747 , clBearerToken
4848 , clPageToken
4949 , clPageSize
50+ , clCourseStates
5051 , clCallback
5152 ) where
5253
@@ -68,9 +69,10 @@ type CoursesListResource =
6869 QueryParam "bearer_token" Text :>
6970 QueryParam "pageToken" Text :>
7071 QueryParam "pageSize" (Textual Int32) :>
71− QueryParam "callback" Text :>
72− QueryParam "alt" AltJSON :>
73− Get '[JSON] ListCoursesResponse
72+ QueryParams "courseStates" Text :>
73+ QueryParam "callback" Text :>
74+ QueryParam "alt" AltJSON :>
75+ Get '[JSON] ListCoursesResponse
7476
7577-- | Returns a list of courses that the requesting user is permitted to view,
7678-- restricted to those that match the request. This method returns the
@@ -90,6 +92,7 @@ data CoursesList = CoursesList'
9092 , _clBearerToken :: !(Maybe Text)
9193 , _clPageToken :: !(Maybe Text)
9294 , _clPageSize :: !(Maybe (Textual Int32))
95+ , _clCourseStates :: !(Maybe [Text])
9396 , _clCallback :: !(Maybe Text)
9497 } deriving (Eq,Show,Data,Typeable,Generic)
9598
@@ -117,6 +120,8 @@ data CoursesList = CoursesList'
117120--
118121-- * 'clPageSize'
119122--
123+-- * 'clCourseStates'
124+--
120125-- * 'clCallback'
121126coursesList
122127 :: CoursesList
@@ -132,6 +137,7 @@ coursesList =
132137 , _clBearerToken = Nothing
133138 , _clPageToken = Nothing
134139 , _clPageSize = Nothing
140+ , _clCourseStates = Nothing
135141 , _clCallback = Nothing
136142 }
137143
@@ -197,6 +203,14 @@ clPageSize
197203 = lens _clPageSize (\ s a -> s{_clPageSize = a}) .
198204 mapping _Coerce
199205
206+-- | Restricts returned courses to those in one of the specified states
207+clCourseStates :: Lens' CoursesList [Text]
208+clCourseStates
209+ = lens _clCourseStates
210+ (\ s a -> s{_clCourseStates = a})
211+ . _Default
212+ . _Coerce
213+
200214-- | JSONP
201215clCallback :: Lens' CoursesList (Maybe Text)
202216clCallback
@@ -216,6 +230,7 @@ instance GoogleRequest CoursesList where
216230 _clBearerToken
217231 _clPageToken
218232 _clPageSize
233+ (_clCourseStates ^. _Default)
219234 _clCallback
220235 (Just AltJSON)
221236 classroomService
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/Create.hsnew file+240
@@ -0,0 +1,240 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Create
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Creates a guardian invitation, and sends an email to the guardian asking
24+-- them to confirm that they are the student\'s guardian. Once the guardian
25+-- accepts the invitation, their \`state\` will change to \`COMPLETED\` and
26+-- they will start receiving guardian notifications. A \`Guardian\`
27+-- resource will also be created to represent the active guardian. The
28+-- request object must have the \`student_id\` and
29+-- \`invited_email_address\` fields set. Failing to set these fields, or
30+-- setting any other fields in the request, will result in an error. This
31+-- method returns the following error codes: * \`PERMISSION_DENIED\` if the
32+-- current user does not have permission to manage guardians, if the
33+-- guardian in question has already rejected too many requests for that
34+-- student, if guardians are not enabled for the domain in question, or for
35+-- other access errors. * \`RESOURCE_EXHAUSTED\` if the student or guardian
36+-- has exceeded the guardian link limit. * \`INVALID_ARGUMENT\` if the
37+-- guardian email address is not valid (for example, if it is too long), or
38+-- if the format of the student ID provided cannot be recognized (it is not
39+-- an email address, nor a \`user_id\` from this API). This error will also
40+-- be returned if read-only fields are set, or if the \`state\` field is
41+-- set to to a value other than \`PENDING\`. * \`NOT_FOUND\` if the student
42+-- ID provided is a valid student ID, but Classroom has no record of that
43+-- student. * \`ALREADY_EXISTS\` if there is already a pending guardian
44+-- invitation for the student and \`invited_email_address\` provided, or if
45+-- the provided \`invited_email_address\` matches the Google account of an
46+-- existing \`Guardian\` for this user.
47+--
48+-- /See:/ <https://developers.google.com/classroom/ Google Classroom API Reference> for @classroom.userProfiles.guardianInvitations.create@.
49+module Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Create
50+ (
51+ -- * REST Resource
52+ UserProFilesGuardianInvitationsCreateResource
53+
54+ -- * Creating a Request
55+ , userProFilesGuardianInvitationsCreate
56+ , UserProFilesGuardianInvitationsCreate
57+
58+ -- * Request Lenses
59+ , upfgicStudentId
60+ , upfgicXgafv
61+ , upfgicUploadProtocol
62+ , upfgicPp
63+ , upfgicAccessToken
64+ , upfgicUploadType
65+ , upfgicPayload
66+ , upfgicBearerToken
67+ , upfgicCallback
68+ ) where
69+
70+import Network.Google.Classroom.Types
71+import Network.Google.Prelude
72+
73+-- | A resource alias for @classroom.userProfiles.guardianInvitations.create@ method which the
74+-- 'UserProFilesGuardianInvitationsCreate' request conforms to.
75+type UserProFilesGuardianInvitationsCreateResource =
76+ "v1" :>
77+ "userProfiles" :>
78+ Capture "studentId" Text :>
79+ "guardianInvitations" :>
80+ QueryParam "$.xgafv" Text :>
81+ QueryParam "upload_protocol" Text :>
82+ QueryParam "pp" Bool :>
83+ QueryParam "access_token" Text :>
84+ QueryParam "uploadType" Text :>
85+ QueryParam "bearer_token" Text :>
86+ QueryParam "callback" Text :>
87+ QueryParam "alt" AltJSON :>
88+ ReqBody '[JSON] GuardianInvitation :>
89+ Post '[JSON] GuardianInvitation
90+
91+-- | Creates a guardian invitation, and sends an email to the guardian asking
92+-- them to confirm that they are the student\'s guardian. Once the guardian
93+-- accepts the invitation, their \`state\` will change to \`COMPLETED\` and
94+-- they will start receiving guardian notifications. A \`Guardian\`
95+-- resource will also be created to represent the active guardian. The
96+-- request object must have the \`student_id\` and
97+-- \`invited_email_address\` fields set. Failing to set these fields, or
98+-- setting any other fields in the request, will result in an error. This
99+-- method returns the following error codes: * \`PERMISSION_DENIED\` if the
100+-- current user does not have permission to manage guardians, if the
101+-- guardian in question has already rejected too many requests for that
102+-- student, if guardians are not enabled for the domain in question, or for
103+-- other access errors. * \`RESOURCE_EXHAUSTED\` if the student or guardian
104+-- has exceeded the guardian link limit. * \`INVALID_ARGUMENT\` if the
105+-- guardian email address is not valid (for example, if it is too long), or
106+-- if the format of the student ID provided cannot be recognized (it is not
107+-- an email address, nor a \`user_id\` from this API). This error will also
108+-- be returned if read-only fields are set, or if the \`state\` field is
109+-- set to to a value other than \`PENDING\`. * \`NOT_FOUND\` if the student
110+-- ID provided is a valid student ID, but Classroom has no record of that
111+-- student. * \`ALREADY_EXISTS\` if there is already a pending guardian
112+-- invitation for the student and \`invited_email_address\` provided, or if
113+-- the provided \`invited_email_address\` matches the Google account of an
114+-- existing \`Guardian\` for this user.
115+--
116+-- /See:/ 'userProFilesGuardianInvitationsCreate' smart constructor.
117+data UserProFilesGuardianInvitationsCreate = UserProFilesGuardianInvitationsCreate'
118+ { _upfgicStudentId :: !Text
119+ , _upfgicXgafv :: !(Maybe Text)
120+ , _upfgicUploadProtocol :: !(Maybe Text)
121+ , _upfgicPp :: !Bool
122+ , _upfgicAccessToken :: !(Maybe Text)
123+ , _upfgicUploadType :: !(Maybe Text)
124+ , _upfgicPayload :: !GuardianInvitation
125+ , _upfgicBearerToken :: !(Maybe Text)
126+ , _upfgicCallback :: !(Maybe Text)
127+ } deriving (Eq,Show,Data,Typeable,Generic)
128+
129+-- | Creates a value of 'UserProFilesGuardianInvitationsCreate' with the minimum fields required to make a request.
130+--
131+-- Use one of the following lenses to modify other fields as desired:
132+--
133+-- * 'upfgicStudentId'
134+--
135+-- * 'upfgicXgafv'
136+--
137+-- * 'upfgicUploadProtocol'
138+--
139+-- * 'upfgicPp'
140+--
141+-- * 'upfgicAccessToken'
142+--
143+-- * 'upfgicUploadType'
144+--
145+-- * 'upfgicPayload'
146+--
147+-- * 'upfgicBearerToken'
148+--
149+-- * 'upfgicCallback'
150+userProFilesGuardianInvitationsCreate
151+ :: Text -- ^ 'upfgicStudentId'
152+ -> GuardianInvitation -- ^ 'upfgicPayload'
153+ -> UserProFilesGuardianInvitationsCreate
154+userProFilesGuardianInvitationsCreate pUpfgicStudentId_ pUpfgicPayload_ =
155+ UserProFilesGuardianInvitationsCreate'
156+ { _upfgicStudentId = pUpfgicStudentId_
157+ , _upfgicXgafv = Nothing
158+ , _upfgicUploadProtocol = Nothing
159+ , _upfgicPp = True
160+ , _upfgicAccessToken = Nothing
161+ , _upfgicUploadType = Nothing
162+ , _upfgicPayload = pUpfgicPayload_
163+ , _upfgicBearerToken = Nothing
164+ , _upfgicCallback = Nothing
165+ }
166+
167+-- | ID of the student (in standard format)
168+upfgicStudentId :: Lens' UserProFilesGuardianInvitationsCreate Text
169+upfgicStudentId
170+ = lens _upfgicStudentId
171+ (\ s a -> s{_upfgicStudentId = a})
172+
173+-- | V1 error format.
174+upfgicXgafv :: Lens' UserProFilesGuardianInvitationsCreate (Maybe Text)
175+upfgicXgafv
176+ = lens _upfgicXgafv (\ s a -> s{_upfgicXgafv = a})
177+
178+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
179+upfgicUploadProtocol :: Lens' UserProFilesGuardianInvitationsCreate (Maybe Text)
180+upfgicUploadProtocol
181+ = lens _upfgicUploadProtocol
182+ (\ s a -> s{_upfgicUploadProtocol = a})
183+
184+-- | Pretty-print response.
185+upfgicPp :: Lens' UserProFilesGuardianInvitationsCreate Bool
186+upfgicPp = lens _upfgicPp (\ s a -> s{_upfgicPp = a})
187+
188+-- | OAuth access token.
189+upfgicAccessToken :: Lens' UserProFilesGuardianInvitationsCreate (Maybe Text)
190+upfgicAccessToken
191+ = lens _upfgicAccessToken
192+ (\ s a -> s{_upfgicAccessToken = a})
193+
194+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
195+upfgicUploadType :: Lens' UserProFilesGuardianInvitationsCreate (Maybe Text)
196+upfgicUploadType
197+ = lens _upfgicUploadType
198+ (\ s a -> s{_upfgicUploadType = a})
199+
200+-- | Multipart request metadata.
201+upfgicPayload :: Lens' UserProFilesGuardianInvitationsCreate GuardianInvitation
202+upfgicPayload
203+ = lens _upfgicPayload
204+ (\ s a -> s{_upfgicPayload = a})
205+
206+-- | OAuth bearer token.
207+upfgicBearerToken :: Lens' UserProFilesGuardianInvitationsCreate (Maybe Text)
208+upfgicBearerToken
209+ = lens _upfgicBearerToken
210+ (\ s a -> s{_upfgicBearerToken = a})
211+
212+-- | JSONP
213+upfgicCallback :: Lens' UserProFilesGuardianInvitationsCreate (Maybe Text)
214+upfgicCallback
215+ = lens _upfgicCallback
216+ (\ s a -> s{_upfgicCallback = a})
217+
218+instance GoogleRequest
219+ UserProFilesGuardianInvitationsCreate where
220+ type Rs UserProFilesGuardianInvitationsCreate =
221+ GuardianInvitation
222+ type Scopes UserProFilesGuardianInvitationsCreate =
223+ '[]
224+ requestClient
225+ UserProFilesGuardianInvitationsCreate'{..}
226+ = go _upfgicStudentId _upfgicXgafv
227+ _upfgicUploadProtocol
228+ (Just _upfgicPp)
229+ _upfgicAccessToken
230+ _upfgicUploadType
231+ _upfgicBearerToken
232+ _upfgicCallback
233+ (Just AltJSON)
234+ _upfgicPayload
235+ classroomService
236+ where go
237+ = buildClient
238+ (Proxy ::
239+ Proxy UserProFilesGuardianInvitationsCreateResource)
240+ mempty
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/Get.hsnew file+212
@@ -0,0 +1,212 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Get
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Returns a specific guardian invitation. This method returns the
24+-- following error codes: * \`PERMISSION_DENIED\` if the requesting user is
25+-- not permitted to view guardian invitations for the student identified by
26+-- the \`student_id\`, if guardians are not enabled for the domain in
27+-- question, or for other access errors. * \`INVALID_ARGUMENT\` if a
28+-- \`student_id\` is specified, but its format cannot be recognized (it is
29+-- not an email address, nor a \`student_id\` from the API, nor the literal
30+-- string \`me\`). * \`NOT_FOUND\` if Classroom cannot find any record of
31+-- the given student or \`invitation_id\`. May also be returned if the
32+-- student exists, but the requesting user does not have access to see that
33+-- student.
34+--
35+-- /See:/ <https://developers.google.com/classroom/ Google Classroom API Reference> for @classroom.userProfiles.guardianInvitations.get@.
36+module Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Get
37+ (
38+ -- * REST Resource
39+ UserProFilesGuardianInvitationsGetResource
40+
41+ -- * Creating a Request
42+ , userProFilesGuardianInvitationsGet
43+ , UserProFilesGuardianInvitationsGet
44+
45+ -- * Request Lenses
46+ , upfgigStudentId
47+ , upfgigXgafv
48+ , upfgigUploadProtocol
49+ , upfgigPp
50+ , upfgigAccessToken
51+ , upfgigUploadType
52+ , upfgigInvitationId
53+ , upfgigBearerToken
54+ , upfgigCallback
55+ ) where
56+
57+import Network.Google.Classroom.Types
58+import Network.Google.Prelude
59+
60+-- | A resource alias for @classroom.userProfiles.guardianInvitations.get@ method which the
61+-- 'UserProFilesGuardianInvitationsGet' request conforms to.
62+type UserProFilesGuardianInvitationsGetResource =
63+ "v1" :>
64+ "userProfiles" :>
65+ Capture "studentId" Text :>
66+ "guardianInvitations" :>
67+ Capture "invitationId" Text :>
68+ QueryParam "$.xgafv" Text :>
69+ QueryParam "upload_protocol" Text :>
70+ QueryParam "pp" Bool :>
71+ QueryParam "access_token" Text :>
72+ QueryParam "uploadType" Text :>
73+ QueryParam "bearer_token" Text :>
74+ QueryParam "callback" Text :>
75+ QueryParam "alt" AltJSON :>
76+ Get '[JSON] GuardianInvitation
77+
78+-- | Returns a specific guardian invitation. This method returns the
79+-- following error codes: * \`PERMISSION_DENIED\` if the requesting user is
80+-- not permitted to view guardian invitations for the student identified by
81+-- the \`student_id\`, if guardians are not enabled for the domain in
82+-- question, or for other access errors. * \`INVALID_ARGUMENT\` if a
83+-- \`student_id\` is specified, but its format cannot be recognized (it is
84+-- not an email address, nor a \`student_id\` from the API, nor the literal
85+-- string \`me\`). * \`NOT_FOUND\` if Classroom cannot find any record of
86+-- the given student or \`invitation_id\`. May also be returned if the
87+-- student exists, but the requesting user does not have access to see that
88+-- student.
89+--
90+-- /See:/ 'userProFilesGuardianInvitationsGet' smart constructor.
91+data UserProFilesGuardianInvitationsGet = UserProFilesGuardianInvitationsGet'
92+ { _upfgigStudentId :: !Text
93+ , _upfgigXgafv :: !(Maybe Text)
94+ , _upfgigUploadProtocol :: !(Maybe Text)
95+ , _upfgigPp :: !Bool
96+ , _upfgigAccessToken :: !(Maybe Text)
97+ , _upfgigUploadType :: !(Maybe Text)
98+ , _upfgigInvitationId :: !Text
99+ , _upfgigBearerToken :: !(Maybe Text)
100+ , _upfgigCallback :: !(Maybe Text)
101+ } deriving (Eq,Show,Data,Typeable,Generic)
102+
103+-- | Creates a value of 'UserProFilesGuardianInvitationsGet' with the minimum fields required to make a request.
104+--
105+-- Use one of the following lenses to modify other fields as desired:
106+--
107+-- * 'upfgigStudentId'
108+--
109+-- * 'upfgigXgafv'
110+--
111+-- * 'upfgigUploadProtocol'
112+--
113+-- * 'upfgigPp'
114+--
115+-- * 'upfgigAccessToken'
116+--
117+-- * 'upfgigUploadType'
118+--
119+-- * 'upfgigInvitationId'
120+--
121+-- * 'upfgigBearerToken'
122+--
123+-- * 'upfgigCallback'
124+userProFilesGuardianInvitationsGet
125+ :: Text -- ^ 'upfgigStudentId'
126+ -> Text -- ^ 'upfgigInvitationId'
127+ -> UserProFilesGuardianInvitationsGet
128+userProFilesGuardianInvitationsGet pUpfgigStudentId_ pUpfgigInvitationId_ =
129+ UserProFilesGuardianInvitationsGet'
130+ { _upfgigStudentId = pUpfgigStudentId_
131+ , _upfgigXgafv = Nothing
132+ , _upfgigUploadProtocol = Nothing
133+ , _upfgigPp = True
134+ , _upfgigAccessToken = Nothing
135+ , _upfgigUploadType = Nothing
136+ , _upfgigInvitationId = pUpfgigInvitationId_
137+ , _upfgigBearerToken = Nothing
138+ , _upfgigCallback = Nothing
139+ }
140+
141+-- | The ID of the student whose guardian invitation is being requested.
142+upfgigStudentId :: Lens' UserProFilesGuardianInvitationsGet Text
143+upfgigStudentId
144+ = lens _upfgigStudentId
145+ (\ s a -> s{_upfgigStudentId = a})
146+
147+-- | V1 error format.
148+upfgigXgafv :: Lens' UserProFilesGuardianInvitationsGet (Maybe Text)
149+upfgigXgafv
150+ = lens _upfgigXgafv (\ s a -> s{_upfgigXgafv = a})
151+
152+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
153+upfgigUploadProtocol :: Lens' UserProFilesGuardianInvitationsGet (Maybe Text)
154+upfgigUploadProtocol
155+ = lens _upfgigUploadProtocol
156+ (\ s a -> s{_upfgigUploadProtocol = a})
157+
158+-- | Pretty-print response.
159+upfgigPp :: Lens' UserProFilesGuardianInvitationsGet Bool
160+upfgigPp = lens _upfgigPp (\ s a -> s{_upfgigPp = a})
161+
162+-- | OAuth access token.
163+upfgigAccessToken :: Lens' UserProFilesGuardianInvitationsGet (Maybe Text)
164+upfgigAccessToken
165+ = lens _upfgigAccessToken
166+ (\ s a -> s{_upfgigAccessToken = a})
167+
168+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
169+upfgigUploadType :: Lens' UserProFilesGuardianInvitationsGet (Maybe Text)
170+upfgigUploadType
171+ = lens _upfgigUploadType
172+ (\ s a -> s{_upfgigUploadType = a})
173+
174+-- | The \`id\` field of the \`GuardianInvitation\` being requested.
175+upfgigInvitationId :: Lens' UserProFilesGuardianInvitationsGet Text
176+upfgigInvitationId
177+ = lens _upfgigInvitationId
178+ (\ s a -> s{_upfgigInvitationId = a})
179+
180+-- | OAuth bearer token.
181+upfgigBearerToken :: Lens' UserProFilesGuardianInvitationsGet (Maybe Text)
182+upfgigBearerToken
183+ = lens _upfgigBearerToken
184+ (\ s a -> s{_upfgigBearerToken = a})
185+
186+-- | JSONP
187+upfgigCallback :: Lens' UserProFilesGuardianInvitationsGet (Maybe Text)
188+upfgigCallback
189+ = lens _upfgigCallback
190+ (\ s a -> s{_upfgigCallback = a})
191+
192+instance GoogleRequest
193+ UserProFilesGuardianInvitationsGet where
194+ type Rs UserProFilesGuardianInvitationsGet =
195+ GuardianInvitation
196+ type Scopes UserProFilesGuardianInvitationsGet = '[]
197+ requestClient UserProFilesGuardianInvitationsGet'{..}
198+ = go _upfgigStudentId _upfgigInvitationId
199+ _upfgigXgafv
200+ _upfgigUploadProtocol
201+ (Just _upfgigPp)
202+ _upfgigAccessToken
203+ _upfgigUploadType
204+ _upfgigBearerToken
205+ _upfgigCallback
206+ (Just AltJSON)
207+ classroomService
208+ where go
209+ = buildClient
210+ (Proxy ::
211+ Proxy UserProFilesGuardianInvitationsGetResource)
212+ mempty
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/List.hsnew file+269
@@ -0,0 +1,269 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.List
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Returns a list of guardian invitations that the requesting user is
24+-- permitted to view, filtered by the parameters provided. This method
25+-- returns the following error codes: * \`PERMISSION_DENIED\` if a
26+-- \`student_id\` is specified, and the requesting user is not permitted to
27+-- view guardian invitations for that student, if \`\"-\"\` is specified as
28+-- the \`student_id\` and the user is not a domain administrator, if
29+-- guardians are not enabled for the domain in question, or for other
30+-- access errors. * \`INVALID_ARGUMENT\` if a \`student_id\` is specified,
31+-- but its format cannot be recognized (it is not an email address, nor a
32+-- \`student_id\` from the API, nor the literal string \`me\`). May also be
33+-- returned if an invalid \`page_token\` or \`state\` is provided. *
34+-- \`NOT_FOUND\` if a \`student_id\` is specified, and its format can be
35+-- recognized, but Classroom has no record of that student.
36+--
37+-- /See:/ <https://developers.google.com/classroom/ Google Classroom API Reference> for @classroom.userProfiles.guardianInvitations.list@.
38+module Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.List
39+ (
40+ -- * REST Resource
41+ UserProFilesGuardianInvitationsListResource
42+
43+ -- * Creating a Request
44+ , userProFilesGuardianInvitationsList
45+ , UserProFilesGuardianInvitationsList
46+
47+ -- * Request Lenses
48+ , upfgilStudentId
49+ , upfgilStates
50+ , upfgilXgafv
51+ , upfgilUploadProtocol
52+ , upfgilPp
53+ , upfgilAccessToken
54+ , upfgilUploadType
55+ , upfgilBearerToken
56+ , upfgilInvitedEmailAddress
57+ , upfgilPageToken
58+ , upfgilPageSize
59+ , upfgilCallback
60+ ) where
61+
62+import Network.Google.Classroom.Types
63+import Network.Google.Prelude
64+
65+-- | A resource alias for @classroom.userProfiles.guardianInvitations.list@ method which the
66+-- 'UserProFilesGuardianInvitationsList' request conforms to.
67+type UserProFilesGuardianInvitationsListResource =
68+ "v1" :>
69+ "userProfiles" :>
70+ Capture "studentId" Text :>
71+ "guardianInvitations" :>
72+ QueryParams "states" Text :>
73+ QueryParam "$.xgafv" Text :>
74+ QueryParam "upload_protocol" Text :>
75+ QueryParam "pp" Bool :>
76+ QueryParam "access_token" Text :>
77+ QueryParam "uploadType" Text :>
78+ QueryParam "bearer_token" Text :>
79+ QueryParam "invitedEmailAddress" Text :>
80+ QueryParam "pageToken" Text :>
81+ QueryParam "pageSize" (Textual Int32) :>
82+ QueryParam "callback" Text :>
83+ QueryParam "alt" AltJSON :>
84+ Get '[JSON] ListGuardianInvitationsResponse
85+
86+-- | Returns a list of guardian invitations that the requesting user is
87+-- permitted to view, filtered by the parameters provided. This method
88+-- returns the following error codes: * \`PERMISSION_DENIED\` if a
89+-- \`student_id\` is specified, and the requesting user is not permitted to
90+-- view guardian invitations for that student, if \`\"-\"\` is specified as
91+-- the \`student_id\` and the user is not a domain administrator, if
92+-- guardians are not enabled for the domain in question, or for other
93+-- access errors. * \`INVALID_ARGUMENT\` if a \`student_id\` is specified,
94+-- but its format cannot be recognized (it is not an email address, nor a
95+-- \`student_id\` from the API, nor the literal string \`me\`). May also be
96+-- returned if an invalid \`page_token\` or \`state\` is provided. *
97+-- \`NOT_FOUND\` if a \`student_id\` is specified, and its format can be
98+-- recognized, but Classroom has no record of that student.
99+--
100+-- /See:/ 'userProFilesGuardianInvitationsList' smart constructor.
101+data UserProFilesGuardianInvitationsList = UserProFilesGuardianInvitationsList'
102+ { _upfgilStudentId :: !Text
103+ , _upfgilStates :: !(Maybe [Text])
104+ , _upfgilXgafv :: !(Maybe Text)
105+ , _upfgilUploadProtocol :: !(Maybe Text)
106+ , _upfgilPp :: !Bool
107+ , _upfgilAccessToken :: !(Maybe Text)
108+ , _upfgilUploadType :: !(Maybe Text)
109+ , _upfgilBearerToken :: !(Maybe Text)
110+ , _upfgilInvitedEmailAddress :: !(Maybe Text)
111+ , _upfgilPageToken :: !(Maybe Text)
112+ , _upfgilPageSize :: !(Maybe (Textual Int32))
113+ , _upfgilCallback :: !(Maybe Text)
114+ } deriving (Eq,Show,Data,Typeable,Generic)
115+
116+-- | Creates a value of 'UserProFilesGuardianInvitationsList' with the minimum fields required to make a request.
117+--
118+-- Use one of the following lenses to modify other fields as desired:
119+--
120+-- * 'upfgilStudentId'
121+--
122+-- * 'upfgilStates'
123+--
124+-- * 'upfgilXgafv'
125+--
126+-- * 'upfgilUploadProtocol'
127+--
128+-- * 'upfgilPp'
129+--
130+-- * 'upfgilAccessToken'
131+--
132+-- * 'upfgilUploadType'
133+--
134+-- * 'upfgilBearerToken'
135+--
136+-- * 'upfgilInvitedEmailAddress'
137+--
138+-- * 'upfgilPageToken'
139+--
140+-- * 'upfgilPageSize'
141+--
142+-- * 'upfgilCallback'
143+userProFilesGuardianInvitationsList
144+ :: Text -- ^ 'upfgilStudentId'
145+ -> UserProFilesGuardianInvitationsList
146+userProFilesGuardianInvitationsList pUpfgilStudentId_ =
147+ UserProFilesGuardianInvitationsList'
148+ { _upfgilStudentId = pUpfgilStudentId_
149+ , _upfgilStates = Nothing
150+ , _upfgilXgafv = Nothing
151+ , _upfgilUploadProtocol = Nothing
152+ , _upfgilPp = True
153+ , _upfgilAccessToken = Nothing
154+ , _upfgilUploadType = Nothing
155+ , _upfgilBearerToken = Nothing
156+ , _upfgilInvitedEmailAddress = Nothing
157+ , _upfgilPageToken = Nothing
158+ , _upfgilPageSize = Nothing
159+ , _upfgilCallback = Nothing
160+ }
161+
162+-- | The ID of the student whose guardian invitations are to be returned. The
163+-- identifier can be one of the following: * the numeric identifier for the
164+-- user * the email address of the user * the string literal \`\"me\"\`,
165+-- indicating the requesting user * the string literal \`\"-\"\`,
166+-- indicating that results should be returned for all students that the
167+-- requesting user is permitted to view guardian invitations.
168+upfgilStudentId :: Lens' UserProFilesGuardianInvitationsList Text
169+upfgilStudentId
170+ = lens _upfgilStudentId
171+ (\ s a -> s{_upfgilStudentId = a})
172+
173+-- | If specified, only results with the specified \`state\` values will be
174+-- returned. Otherwise, results with a \`state\` of \`PENDING\` will be
175+-- returned.
176+upfgilStates :: Lens' UserProFilesGuardianInvitationsList [Text]
177+upfgilStates
178+ = lens _upfgilStates (\ s a -> s{_upfgilStates = a})
179+ . _Default
180+ . _Coerce
181+
182+-- | V1 error format.
183+upfgilXgafv :: Lens' UserProFilesGuardianInvitationsList (Maybe Text)
184+upfgilXgafv
185+ = lens _upfgilXgafv (\ s a -> s{_upfgilXgafv = a})
186+
187+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
188+upfgilUploadProtocol :: Lens' UserProFilesGuardianInvitationsList (Maybe Text)
189+upfgilUploadProtocol
190+ = lens _upfgilUploadProtocol
191+ (\ s a -> s{_upfgilUploadProtocol = a})
192+
193+-- | Pretty-print response.
194+upfgilPp :: Lens' UserProFilesGuardianInvitationsList Bool
195+upfgilPp = lens _upfgilPp (\ s a -> s{_upfgilPp = a})
196+
197+-- | OAuth access token.
198+upfgilAccessToken :: Lens' UserProFilesGuardianInvitationsList (Maybe Text)
199+upfgilAccessToken
200+ = lens _upfgilAccessToken
201+ (\ s a -> s{_upfgilAccessToken = a})
202+
203+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
204+upfgilUploadType :: Lens' UserProFilesGuardianInvitationsList (Maybe Text)
205+upfgilUploadType
206+ = lens _upfgilUploadType
207+ (\ s a -> s{_upfgilUploadType = a})
208+
209+-- | OAuth bearer token.
210+upfgilBearerToken :: Lens' UserProFilesGuardianInvitationsList (Maybe Text)
211+upfgilBearerToken
212+ = lens _upfgilBearerToken
213+ (\ s a -> s{_upfgilBearerToken = a})
214+
215+-- | If specified, only results with the specified \`invited_email_address\`
216+-- will be returned.
217+upfgilInvitedEmailAddress :: Lens' UserProFilesGuardianInvitationsList (Maybe Text)
218+upfgilInvitedEmailAddress
219+ = lens _upfgilInvitedEmailAddress
220+ (\ s a -> s{_upfgilInvitedEmailAddress = a})
221+
222+-- | nextPageToken value returned from a previous list call, indicating that
223+-- the subsequent page of results should be returned. The list request must
224+-- be otherwise identical to the one that resulted in this token.
225+upfgilPageToken :: Lens' UserProFilesGuardianInvitationsList (Maybe Text)
226+upfgilPageToken
227+ = lens _upfgilPageToken
228+ (\ s a -> s{_upfgilPageToken = a})
229+
230+-- | Maximum number of items to return. Zero or unspecified indicates that
231+-- the server may assign a maximum. The server may return fewer than the
232+-- specified number of results.
233+upfgilPageSize :: Lens' UserProFilesGuardianInvitationsList (Maybe Int32)
234+upfgilPageSize
235+ = lens _upfgilPageSize
236+ (\ s a -> s{_upfgilPageSize = a})
237+ . mapping _Coerce
238+
239+-- | JSONP
240+upfgilCallback :: Lens' UserProFilesGuardianInvitationsList (Maybe Text)
241+upfgilCallback
242+ = lens _upfgilCallback
243+ (\ s a -> s{_upfgilCallback = a})
244+
245+instance GoogleRequest
246+ UserProFilesGuardianInvitationsList where
247+ type Rs UserProFilesGuardianInvitationsList =
248+ ListGuardianInvitationsResponse
249+ type Scopes UserProFilesGuardianInvitationsList = '[]
250+ requestClient
251+ UserProFilesGuardianInvitationsList'{..}
252+ = go _upfgilStudentId (_upfgilStates ^. _Default)
253+ _upfgilXgafv
254+ _upfgilUploadProtocol
255+ (Just _upfgilPp)
256+ _upfgilAccessToken
257+ _upfgilUploadType
258+ _upfgilBearerToken
259+ _upfgilInvitedEmailAddress
260+ _upfgilPageToken
261+ _upfgilPageSize
262+ _upfgilCallback
263+ (Just AltJSON)
264+ classroomService
265+ where go
266+ = buildClient
267+ (Proxy ::
268+ Proxy UserProFilesGuardianInvitationsListResource)
269+ mempty
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/GuardianInvitations/Patch.hsnew file+250
@@ -0,0 +1,250 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Patch
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Modifies a guardian invitation. Currently, the only valid modification
24+-- is to change the \`state\` from \`PENDING\` to \`COMPLETE\`. This has
25+-- the effect of withdrawing the invitation. This method returns the
26+-- following error codes: * \`PERMISSION_DENIED\` if the current user does
27+-- not have permission to manage guardians, if guardians are not enabled
28+-- for the domain in question or for other access errors. *
29+-- \`FAILED_PRECONDITION\` if the guardian link is not in the \`PENDING\`
30+-- state. * \`INVALID_ARGUMENT\` if the format of the student ID provided
31+-- cannot be recognized (it is not an email address, nor a \`user_id\` from
32+-- this API), or if the passed \`GuardianInvitation\` has a \`state\` other
33+-- than \`COMPLETE\`, or if it modifies fields other than \`state\`. *
34+-- \`NOT_FOUND\` if the student ID provided is a valid student ID, but
35+-- Classroom has no record of that student, or if the \`id\` field does not
36+-- refer to a guardian invitation known to Classroom.
37+--
38+-- /See:/ <https://developers.google.com/classroom/ Google Classroom API Reference> for @classroom.userProfiles.guardianInvitations.patch@.
39+module Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Patch
40+ (
41+ -- * REST Resource
42+ UserProFilesGuardianInvitationsPatchResource
43+
44+ -- * Creating a Request
45+ , userProFilesGuardianInvitationsPatch
46+ , UserProFilesGuardianInvitationsPatch
47+
48+ -- * Request Lenses
49+ , upfgipStudentId
50+ , upfgipXgafv
51+ , upfgipUploadProtocol
52+ , upfgipUpdateMask
53+ , upfgipPp
54+ , upfgipAccessToken
55+ , upfgipUploadType
56+ , upfgipPayload
57+ , upfgipInvitationId
58+ , upfgipBearerToken
59+ , upfgipCallback
60+ ) where
61+
62+import Network.Google.Classroom.Types
63+import Network.Google.Prelude
64+
65+-- | A resource alias for @classroom.userProfiles.guardianInvitations.patch@ method which the
66+-- 'UserProFilesGuardianInvitationsPatch' request conforms to.
67+type UserProFilesGuardianInvitationsPatchResource =
68+ "v1" :>
69+ "userProfiles" :>
70+ Capture "studentId" Text :>
71+ "guardianInvitations" :>
72+ Capture "invitationId" Text :>
73+ QueryParam "$.xgafv" Text :>
74+ QueryParam "upload_protocol" Text :>
75+ QueryParam "updateMask" Text :>
76+ QueryParam "pp" Bool :>
77+ QueryParam "access_token" Text :>
78+ QueryParam "uploadType" Text :>
79+ QueryParam "bearer_token" Text :>
80+ QueryParam "callback" Text :>
81+ QueryParam "alt" AltJSON :>
82+ ReqBody '[JSON] GuardianInvitation :>
83+ Patch '[JSON] GuardianInvitation
84+
85+-- | Modifies a guardian invitation. Currently, the only valid modification
86+-- is to change the \`state\` from \`PENDING\` to \`COMPLETE\`. This has
87+-- the effect of withdrawing the invitation. This method returns the
88+-- following error codes: * \`PERMISSION_DENIED\` if the current user does
89+-- not have permission to manage guardians, if guardians are not enabled
90+-- for the domain in question or for other access errors. *
91+-- \`FAILED_PRECONDITION\` if the guardian link is not in the \`PENDING\`
92+-- state. * \`INVALID_ARGUMENT\` if the format of the student ID provided
93+-- cannot be recognized (it is not an email address, nor a \`user_id\` from
94+-- this API), or if the passed \`GuardianInvitation\` has a \`state\` other
95+-- than \`COMPLETE\`, or if it modifies fields other than \`state\`. *
96+-- \`NOT_FOUND\` if the student ID provided is a valid student ID, but
97+-- Classroom has no record of that student, or if the \`id\` field does not
98+-- refer to a guardian invitation known to Classroom.
99+--
100+-- /See:/ 'userProFilesGuardianInvitationsPatch' smart constructor.
101+data UserProFilesGuardianInvitationsPatch = UserProFilesGuardianInvitationsPatch'
102+ { _upfgipStudentId :: !Text
103+ , _upfgipXgafv :: !(Maybe Text)
104+ , _upfgipUploadProtocol :: !(Maybe Text)
105+ , _upfgipUpdateMask :: !(Maybe Text)
106+ , _upfgipPp :: !Bool
107+ , _upfgipAccessToken :: !(Maybe Text)
108+ , _upfgipUploadType :: !(Maybe Text)
109+ , _upfgipPayload :: !GuardianInvitation
110+ , _upfgipInvitationId :: !Text
111+ , _upfgipBearerToken :: !(Maybe Text)
112+ , _upfgipCallback :: !(Maybe Text)
113+ } deriving (Eq,Show,Data,Typeable,Generic)
114+
115+-- | Creates a value of 'UserProFilesGuardianInvitationsPatch' with the minimum fields required to make a request.
116+--
117+-- Use one of the following lenses to modify other fields as desired:
118+--
119+-- * 'upfgipStudentId'
120+--
121+-- * 'upfgipXgafv'
122+--
123+-- * 'upfgipUploadProtocol'
124+--
125+-- * 'upfgipUpdateMask'
126+--
127+-- * 'upfgipPp'
128+--
129+-- * 'upfgipAccessToken'
130+--
131+-- * 'upfgipUploadType'
132+--
133+-- * 'upfgipPayload'
134+--
135+-- * 'upfgipInvitationId'
136+--
137+-- * 'upfgipBearerToken'
138+--
139+-- * 'upfgipCallback'
140+userProFilesGuardianInvitationsPatch
141+ :: Text -- ^ 'upfgipStudentId'
142+ -> GuardianInvitation -- ^ 'upfgipPayload'
143+ -> Text -- ^ 'upfgipInvitationId'
144+ -> UserProFilesGuardianInvitationsPatch
145+userProFilesGuardianInvitationsPatch pUpfgipStudentId_ pUpfgipPayload_ pUpfgipInvitationId_ =
146+ UserProFilesGuardianInvitationsPatch'
147+ { _upfgipStudentId = pUpfgipStudentId_
148+ , _upfgipXgafv = Nothing
149+ , _upfgipUploadProtocol = Nothing
150+ , _upfgipUpdateMask = Nothing
151+ , _upfgipPp = True
152+ , _upfgipAccessToken = Nothing
153+ , _upfgipUploadType = Nothing
154+ , _upfgipPayload = pUpfgipPayload_
155+ , _upfgipInvitationId = pUpfgipInvitationId_
156+ , _upfgipBearerToken = Nothing
157+ , _upfgipCallback = Nothing
158+ }
159+
160+-- | The ID of the student whose guardian invitation is to be modified.
161+upfgipStudentId :: Lens' UserProFilesGuardianInvitationsPatch Text
162+upfgipStudentId
163+ = lens _upfgipStudentId
164+ (\ s a -> s{_upfgipStudentId = a})
165+
166+-- | V1 error format.
167+upfgipXgafv :: Lens' UserProFilesGuardianInvitationsPatch (Maybe Text)
168+upfgipXgafv
169+ = lens _upfgipXgafv (\ s a -> s{_upfgipXgafv = a})
170+
171+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
172+upfgipUploadProtocol :: Lens' UserProFilesGuardianInvitationsPatch (Maybe Text)
173+upfgipUploadProtocol
174+ = lens _upfgipUploadProtocol
175+ (\ s a -> s{_upfgipUploadProtocol = a})
176+
177+-- | Mask that identifies which fields on the course to update. This field is
178+-- required to do an update. The update will fail if invalid fields are
179+-- specified. The following fields are valid: * \`state\` When set in a
180+-- query parameter, this field should be specified as \`updateMask=,,...\`
181+upfgipUpdateMask :: Lens' UserProFilesGuardianInvitationsPatch (Maybe Text)
182+upfgipUpdateMask
183+ = lens _upfgipUpdateMask
184+ (\ s a -> s{_upfgipUpdateMask = a})
185+
186+-- | Pretty-print response.
187+upfgipPp :: Lens' UserProFilesGuardianInvitationsPatch Bool
188+upfgipPp = lens _upfgipPp (\ s a -> s{_upfgipPp = a})
189+
190+-- | OAuth access token.
191+upfgipAccessToken :: Lens' UserProFilesGuardianInvitationsPatch (Maybe Text)
192+upfgipAccessToken
193+ = lens _upfgipAccessToken
194+ (\ s a -> s{_upfgipAccessToken = a})
195+
196+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
197+upfgipUploadType :: Lens' UserProFilesGuardianInvitationsPatch (Maybe Text)
198+upfgipUploadType
199+ = lens _upfgipUploadType
200+ (\ s a -> s{_upfgipUploadType = a})
201+
202+-- | Multipart request metadata.
203+upfgipPayload :: Lens' UserProFilesGuardianInvitationsPatch GuardianInvitation
204+upfgipPayload
205+ = lens _upfgipPayload
206+ (\ s a -> s{_upfgipPayload = a})
207+
208+-- | The \`id\` field of the \`GuardianInvitation\` to be modified.
209+upfgipInvitationId :: Lens' UserProFilesGuardianInvitationsPatch Text
210+upfgipInvitationId
211+ = lens _upfgipInvitationId
212+ (\ s a -> s{_upfgipInvitationId = a})
213+
214+-- | OAuth bearer token.
215+upfgipBearerToken :: Lens' UserProFilesGuardianInvitationsPatch (Maybe Text)
216+upfgipBearerToken
217+ = lens _upfgipBearerToken
218+ (\ s a -> s{_upfgipBearerToken = a})
219+
220+-- | JSONP
221+upfgipCallback :: Lens' UserProFilesGuardianInvitationsPatch (Maybe Text)
222+upfgipCallback
223+ = lens _upfgipCallback
224+ (\ s a -> s{_upfgipCallback = a})
225+
226+instance GoogleRequest
227+ UserProFilesGuardianInvitationsPatch where
228+ type Rs UserProFilesGuardianInvitationsPatch =
229+ GuardianInvitation
230+ type Scopes UserProFilesGuardianInvitationsPatch =
231+ '[]
232+ requestClient
233+ UserProFilesGuardianInvitationsPatch'{..}
234+ = go _upfgipStudentId _upfgipInvitationId
235+ _upfgipXgafv
236+ _upfgipUploadProtocol
237+ _upfgipUpdateMask
238+ (Just _upfgipPp)
239+ _upfgipAccessToken
240+ _upfgipUploadType
241+ _upfgipBearerToken
242+ _upfgipCallback
243+ (Just AltJSON)
244+ _upfgipPayload
245+ classroomService
246+ where go
247+ = buildClient
248+ (Proxy ::
249+ Proxy UserProFilesGuardianInvitationsPatchResource)
250+ mempty
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/Guardians/Delete.hsnew file+210
@@ -0,0 +1,210 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Classroom.UserProFiles.Guardians.Delete
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Deletes a guardian. The guardian will no longer receive guardian
24+-- notifications and the guardian will no longer be accessible via the API.
25+-- This method returns the following error codes: * \`PERMISSION_DENIED\`
26+-- if the requesting user is not permitted to manage guardians for the
27+-- student identified by the \`student_id\`, if guardians are not enabled
28+-- for the domain in question, or for other access errors. *
29+-- \`INVALID_ARGUMENT\` if a \`student_id\` is specified, but its format
30+-- cannot be recognized (it is not an email address, nor a \`student_id\`
31+-- from the API). * \`NOT_FOUND\` if Classroom cannot find any record of
32+-- the given \`student_id\` or \`guardian_id\`, or if the guardian has
33+-- already been disabled.
34+--
35+-- /See:/ <https://developers.google.com/classroom/ Google Classroom API Reference> for @classroom.userProfiles.guardians.delete@.
36+module Network.Google.Resource.Classroom.UserProFiles.Guardians.Delete
37+ (
38+ -- * REST Resource
39+ UserProFilesGuardiansDeleteResource
40+
41+ -- * Creating a Request
42+ , userProFilesGuardiansDelete
43+ , UserProFilesGuardiansDelete
44+
45+ -- * Request Lenses
46+ , upfgdStudentId
47+ , upfgdXgafv
48+ , upfgdUploadProtocol
49+ , upfgdPp
50+ , upfgdAccessToken
51+ , upfgdUploadType
52+ , upfgdGuardianId
53+ , upfgdBearerToken
54+ , upfgdCallback
55+ ) where
56+
57+import Network.Google.Classroom.Types
58+import Network.Google.Prelude
59+
60+-- | A resource alias for @classroom.userProfiles.guardians.delete@ method which the
61+-- 'UserProFilesGuardiansDelete' request conforms to.
62+type UserProFilesGuardiansDeleteResource =
63+ "v1" :>
64+ "userProfiles" :>
65+ Capture "studentId" Text :>
66+ "guardians" :>
67+ Capture "guardianId" Text :>
68+ QueryParam "$.xgafv" Text :>
69+ QueryParam "upload_protocol" Text :>
70+ QueryParam "pp" Bool :>
71+ QueryParam "access_token" Text :>
72+ QueryParam "uploadType" Text :>
73+ QueryParam "bearer_token" Text :>
74+ QueryParam "callback" Text :>
75+ QueryParam "alt" AltJSON :> Delete '[JSON] Empty
76+
77+-- | Deletes a guardian. The guardian will no longer receive guardian
78+-- notifications and the guardian will no longer be accessible via the API.
79+-- This method returns the following error codes: * \`PERMISSION_DENIED\`
80+-- if the requesting user is not permitted to manage guardians for the
81+-- student identified by the \`student_id\`, if guardians are not enabled
82+-- for the domain in question, or for other access errors. *
83+-- \`INVALID_ARGUMENT\` if a \`student_id\` is specified, but its format
84+-- cannot be recognized (it is not an email address, nor a \`student_id\`
85+-- from the API). * \`NOT_FOUND\` if Classroom cannot find any record of
86+-- the given \`student_id\` or \`guardian_id\`, or if the guardian has
87+-- already been disabled.
88+--
89+-- /See:/ 'userProFilesGuardiansDelete' smart constructor.
90+data UserProFilesGuardiansDelete = UserProFilesGuardiansDelete'
91+ { _upfgdStudentId :: !Text
92+ , _upfgdXgafv :: !(Maybe Text)
93+ , _upfgdUploadProtocol :: !(Maybe Text)
94+ , _upfgdPp :: !Bool
95+ , _upfgdAccessToken :: !(Maybe Text)
96+ , _upfgdUploadType :: !(Maybe Text)
97+ , _upfgdGuardianId :: !Text
98+ , _upfgdBearerToken :: !(Maybe Text)
99+ , _upfgdCallback :: !(Maybe Text)
100+ } deriving (Eq,Show,Data,Typeable,Generic)
101+
102+-- | Creates a value of 'UserProFilesGuardiansDelete' with the minimum fields required to make a request.
103+--
104+-- Use one of the following lenses to modify other fields as desired:
105+--
106+-- * 'upfgdStudentId'
107+--
108+-- * 'upfgdXgafv'
109+--
110+-- * 'upfgdUploadProtocol'
111+--
112+-- * 'upfgdPp'
113+--
114+-- * 'upfgdAccessToken'
115+--
116+-- * 'upfgdUploadType'
117+--
118+-- * 'upfgdGuardianId'
119+--
120+-- * 'upfgdBearerToken'
121+--
122+-- * 'upfgdCallback'
123+userProFilesGuardiansDelete
124+ :: Text -- ^ 'upfgdStudentId'
125+ -> Text -- ^ 'upfgdGuardianId'
126+ -> UserProFilesGuardiansDelete
127+userProFilesGuardiansDelete pUpfgdStudentId_ pUpfgdGuardianId_ =
128+ UserProFilesGuardiansDelete'
129+ { _upfgdStudentId = pUpfgdStudentId_
130+ , _upfgdXgafv = Nothing
131+ , _upfgdUploadProtocol = Nothing
132+ , _upfgdPp = True
133+ , _upfgdAccessToken = Nothing
134+ , _upfgdUploadType = Nothing
135+ , _upfgdGuardianId = pUpfgdGuardianId_
136+ , _upfgdBearerToken = Nothing
137+ , _upfgdCallback = Nothing
138+ }
139+
140+-- | The student whose guardian is to be deleted. One of the following: * the
141+-- numeric identifier for the user * the email address of the user * the
142+-- string literal \`\"me\"\`, indicating the requesting user
143+upfgdStudentId :: Lens' UserProFilesGuardiansDelete Text
144+upfgdStudentId
145+ = lens _upfgdStudentId
146+ (\ s a -> s{_upfgdStudentId = a})
147+
148+-- | V1 error format.
149+upfgdXgafv :: Lens' UserProFilesGuardiansDelete (Maybe Text)
150+upfgdXgafv
151+ = lens _upfgdXgafv (\ s a -> s{_upfgdXgafv = a})
152+
153+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
154+upfgdUploadProtocol :: Lens' UserProFilesGuardiansDelete (Maybe Text)
155+upfgdUploadProtocol
156+ = lens _upfgdUploadProtocol
157+ (\ s a -> s{_upfgdUploadProtocol = a})
158+
159+-- | Pretty-print response.
160+upfgdPp :: Lens' UserProFilesGuardiansDelete Bool
161+upfgdPp = lens _upfgdPp (\ s a -> s{_upfgdPp = a})
162+
163+-- | OAuth access token.
164+upfgdAccessToken :: Lens' UserProFilesGuardiansDelete (Maybe Text)
165+upfgdAccessToken
166+ = lens _upfgdAccessToken
167+ (\ s a -> s{_upfgdAccessToken = a})
168+
169+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
170+upfgdUploadType :: Lens' UserProFilesGuardiansDelete (Maybe Text)
171+upfgdUploadType
172+ = lens _upfgdUploadType
173+ (\ s a -> s{_upfgdUploadType = a})
174+
175+-- | The \`id\` field from a \`Guardian\`.
176+upfgdGuardianId :: Lens' UserProFilesGuardiansDelete Text
177+upfgdGuardianId
178+ = lens _upfgdGuardianId
179+ (\ s a -> s{_upfgdGuardianId = a})
180+
181+-- | OAuth bearer token.
182+upfgdBearerToken :: Lens' UserProFilesGuardiansDelete (Maybe Text)
183+upfgdBearerToken
184+ = lens _upfgdBearerToken
185+ (\ s a -> s{_upfgdBearerToken = a})
186+
187+-- | JSONP
188+upfgdCallback :: Lens' UserProFilesGuardiansDelete (Maybe Text)
189+upfgdCallback
190+ = lens _upfgdCallback
191+ (\ s a -> s{_upfgdCallback = a})
192+
193+instance GoogleRequest UserProFilesGuardiansDelete
194+ where
195+ type Rs UserProFilesGuardiansDelete = Empty
196+ type Scopes UserProFilesGuardiansDelete = '[]
197+ requestClient UserProFilesGuardiansDelete'{..}
198+ = go _upfgdStudentId _upfgdGuardianId _upfgdXgafv
199+ _upfgdUploadProtocol
200+ (Just _upfgdPp)
201+ _upfgdAccessToken
202+ _upfgdUploadType
203+ _upfgdBearerToken
204+ _upfgdCallback
205+ (Just AltJSON)
206+ classroomService
207+ where go
208+ = buildClient
209+ (Proxy :: Proxy UserProFilesGuardiansDeleteResource)
210+ mempty
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/Guardians/Get.hsnew file+205
@@ -0,0 +1,205 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Classroom.UserProFiles.Guardians.Get
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Returns a specific guardian. This method returns the following error
24+-- codes: * \`PERMISSION_DENIED\` if the requesting user is not permitted
25+-- to view guardian information for the student identified by the
26+-- \`student_id\`, if guardians are not enabled for the domain in question,
27+-- or for other access errors. * \`INVALID_ARGUMENT\` if a \`student_id\`
28+-- is specified, but its format cannot be recognized (it is not an email
29+-- address, nor a \`student_id\` from the API, nor the literal string
30+-- \`me\`). * \`NOT_FOUND\` if Classroom cannot find any record of the
31+-- given student or \`guardian_id\`, or if the guardian has been disabled.
32+--
33+-- /See:/ <https://developers.google.com/classroom/ Google Classroom API Reference> for @classroom.userProfiles.guardians.get@.
34+module Network.Google.Resource.Classroom.UserProFiles.Guardians.Get
35+ (
36+ -- * REST Resource
37+ UserProFilesGuardiansGetResource
38+
39+ -- * Creating a Request
40+ , userProFilesGuardiansGet
41+ , UserProFilesGuardiansGet
42+
43+ -- * Request Lenses
44+ , upfggStudentId
45+ , upfggXgafv
46+ , upfggUploadProtocol
47+ , upfggPp
48+ , upfggAccessToken
49+ , upfggUploadType
50+ , upfggGuardianId
51+ , upfggBearerToken
52+ , upfggCallback
53+ ) where
54+
55+import Network.Google.Classroom.Types
56+import Network.Google.Prelude
57+
58+-- | A resource alias for @classroom.userProfiles.guardians.get@ method which the
59+-- 'UserProFilesGuardiansGet' request conforms to.
60+type UserProFilesGuardiansGetResource =
61+ "v1" :>
62+ "userProfiles" :>
63+ Capture "studentId" Text :>
64+ "guardians" :>
65+ Capture "guardianId" Text :>
66+ QueryParam "$.xgafv" Text :>
67+ QueryParam "upload_protocol" Text :>
68+ QueryParam "pp" Bool :>
69+ QueryParam "access_token" Text :>
70+ QueryParam "uploadType" Text :>
71+ QueryParam "bearer_token" Text :>
72+ QueryParam "callback" Text :>
73+ QueryParam "alt" AltJSON :> Get '[JSON] Guardian
74+
75+-- | Returns a specific guardian. This method returns the following error
76+-- codes: * \`PERMISSION_DENIED\` if the requesting user is not permitted
77+-- to view guardian information for the student identified by the
78+-- \`student_id\`, if guardians are not enabled for the domain in question,
79+-- or for other access errors. * \`INVALID_ARGUMENT\` if a \`student_id\`
80+-- is specified, but its format cannot be recognized (it is not an email
81+-- address, nor a \`student_id\` from the API, nor the literal string
82+-- \`me\`). * \`NOT_FOUND\` if Classroom cannot find any record of the
83+-- given student or \`guardian_id\`, or if the guardian has been disabled.
84+--
85+-- /See:/ 'userProFilesGuardiansGet' smart constructor.
86+data UserProFilesGuardiansGet = UserProFilesGuardiansGet'
87+ { _upfggStudentId :: !Text
88+ , _upfggXgafv :: !(Maybe Text)
89+ , _upfggUploadProtocol :: !(Maybe Text)
90+ , _upfggPp :: !Bool
91+ , _upfggAccessToken :: !(Maybe Text)
92+ , _upfggUploadType :: !(Maybe Text)
93+ , _upfggGuardianId :: !Text
94+ , _upfggBearerToken :: !(Maybe Text)
95+ , _upfggCallback :: !(Maybe Text)
96+ } deriving (Eq,Show,Data,Typeable,Generic)
97+
98+-- | Creates a value of 'UserProFilesGuardiansGet' with the minimum fields required to make a request.
99+--
100+-- Use one of the following lenses to modify other fields as desired:
101+--
102+-- * 'upfggStudentId'
103+--
104+-- * 'upfggXgafv'
105+--
106+-- * 'upfggUploadProtocol'
107+--
108+-- * 'upfggPp'
109+--
110+-- * 'upfggAccessToken'
111+--
112+-- * 'upfggUploadType'
113+--
114+-- * 'upfggGuardianId'
115+--
116+-- * 'upfggBearerToken'
117+--
118+-- * 'upfggCallback'
119+userProFilesGuardiansGet
120+ :: Text -- ^ 'upfggStudentId'
121+ -> Text -- ^ 'upfggGuardianId'
122+ -> UserProFilesGuardiansGet
123+userProFilesGuardiansGet pUpfggStudentId_ pUpfggGuardianId_ =
124+ UserProFilesGuardiansGet'
125+ { _upfggStudentId = pUpfggStudentId_
126+ , _upfggXgafv = Nothing
127+ , _upfggUploadProtocol = Nothing
128+ , _upfggPp = True
129+ , _upfggAccessToken = Nothing
130+ , _upfggUploadType = Nothing
131+ , _upfggGuardianId = pUpfggGuardianId_
132+ , _upfggBearerToken = Nothing
133+ , _upfggCallback = Nothing
134+ }
135+
136+-- | The student whose guardian is being requested. One of the following: *
137+-- the numeric identifier for the user * the email address of the user *
138+-- the string literal \`\"me\"\`, indicating the requesting user
139+upfggStudentId :: Lens' UserProFilesGuardiansGet Text
140+upfggStudentId
141+ = lens _upfggStudentId
142+ (\ s a -> s{_upfggStudentId = a})
143+
144+-- | V1 error format.
145+upfggXgafv :: Lens' UserProFilesGuardiansGet (Maybe Text)
146+upfggXgafv
147+ = lens _upfggXgafv (\ s a -> s{_upfggXgafv = a})
148+
149+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
150+upfggUploadProtocol :: Lens' UserProFilesGuardiansGet (Maybe Text)
151+upfggUploadProtocol
152+ = lens _upfggUploadProtocol
153+ (\ s a -> s{_upfggUploadProtocol = a})
154+
155+-- | Pretty-print response.
156+upfggPp :: Lens' UserProFilesGuardiansGet Bool
157+upfggPp = lens _upfggPp (\ s a -> s{_upfggPp = a})
158+
159+-- | OAuth access token.
160+upfggAccessToken :: Lens' UserProFilesGuardiansGet (Maybe Text)
161+upfggAccessToken
162+ = lens _upfggAccessToken
163+ (\ s a -> s{_upfggAccessToken = a})
164+
165+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
166+upfggUploadType :: Lens' UserProFilesGuardiansGet (Maybe Text)
167+upfggUploadType
168+ = lens _upfggUploadType
169+ (\ s a -> s{_upfggUploadType = a})
170+
171+-- | The \`id\` field from a \`Guardian\`.
172+upfggGuardianId :: Lens' UserProFilesGuardiansGet Text
173+upfggGuardianId
174+ = lens _upfggGuardianId
175+ (\ s a -> s{_upfggGuardianId = a})
176+
177+-- | OAuth bearer token.
178+upfggBearerToken :: Lens' UserProFilesGuardiansGet (Maybe Text)
179+upfggBearerToken
180+ = lens _upfggBearerToken
181+ (\ s a -> s{_upfggBearerToken = a})
182+
183+-- | JSONP
184+upfggCallback :: Lens' UserProFilesGuardiansGet (Maybe Text)
185+upfggCallback
186+ = lens _upfggCallback
187+ (\ s a -> s{_upfggCallback = a})
188+
189+instance GoogleRequest UserProFilesGuardiansGet where
190+ type Rs UserProFilesGuardiansGet = Guardian
191+ type Scopes UserProFilesGuardiansGet = '[]
192+ requestClient UserProFilesGuardiansGet'{..}
193+ = go _upfggStudentId _upfggGuardianId _upfggXgafv
194+ _upfggUploadProtocol
195+ (Just _upfggPp)
196+ _upfggAccessToken
197+ _upfggUploadType
198+ _upfggBearerToken
199+ _upfggCallback
200+ (Just AltJSON)
201+ classroomService
202+ where go
203+ = buildClient
204+ (Proxy :: Proxy UserProFilesGuardiansGetResource)
205+ mempty
gogol-classroom/gen/Network/Google/Resource/Classroom/UserProFiles/Guardians/List.hsnew file+257
@@ -0,0 +1,257 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Classroom.UserProFiles.Guardians.List
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Returns a list of guardians that the requesting user is permitted to
24+-- view, restricted to those that match the request. To list guardians for
25+-- any student that the requesting user may view guardians for, use the
26+-- literal character \`-\` for the student ID. This method returns the
27+-- following error codes: * \`PERMISSION_DENIED\` if a \`student_id\` is
28+-- specified, and the requesting user is not permitted to view guardian
29+-- information for that student, if \`\"-\"\` is specified as the
30+-- \`student_id\` and the user is not a domain administrator, if guardians
31+-- are not enabled for the domain in question, if the
32+-- \`invited_email_address\` filter is set by a user who is not a domain
33+-- administrator, or for other access errors. * \`INVALID_ARGUMENT\` if a
34+-- \`student_id\` is specified, but its format cannot be recognized (it is
35+-- not an email address, nor a \`student_id\` from the API, nor the literal
36+-- string \`me\`). May also be returned if an invalid \`page_token\` is
37+-- provided. * \`NOT_FOUND\` if a \`student_id\` is specified, and its
38+-- format can be recognized, but Classroom has no record of that student.
39+--
40+-- /See:/ <https://developers.google.com/classroom/ Google Classroom API Reference> for @classroom.userProfiles.guardians.list@.
41+module Network.Google.Resource.Classroom.UserProFiles.Guardians.List
42+ (
43+ -- * REST Resource
44+ UserProFilesGuardiansListResource
45+
46+ -- * Creating a Request
47+ , userProFilesGuardiansList
48+ , UserProFilesGuardiansList
49+
50+ -- * Request Lenses
51+ , upfglStudentId
52+ , upfglXgafv
53+ , upfglUploadProtocol
54+ , upfglPp
55+ , upfglAccessToken
56+ , upfglUploadType
57+ , upfglBearerToken
58+ , upfglInvitedEmailAddress
59+ , upfglPageToken
60+ , upfglPageSize
61+ , upfglCallback
62+ ) where
63+
64+import Network.Google.Classroom.Types
65+import Network.Google.Prelude
66+
67+-- | A resource alias for @classroom.userProfiles.guardians.list@ method which the
68+-- 'UserProFilesGuardiansList' request conforms to.
69+type UserProFilesGuardiansListResource =
70+ "v1" :>
71+ "userProfiles" :>
72+ Capture "studentId" Text :>
73+ "guardians" :>
74+ QueryParam "$.xgafv" Text :>
75+ QueryParam "upload_protocol" Text :>
76+ QueryParam "pp" Bool :>
77+ QueryParam "access_token" Text :>
78+ QueryParam "uploadType" Text :>
79+ QueryParam "bearer_token" Text :>
80+ QueryParam "invitedEmailAddress" Text :>
81+ QueryParam "pageToken" Text :>
82+ QueryParam "pageSize" (Textual Int32) :>
83+ QueryParam "callback" Text :>
84+ QueryParam "alt" AltJSON :>
85+ Get '[JSON] ListGuardiansResponse
86+
87+-- | Returns a list of guardians that the requesting user is permitted to
88+-- view, restricted to those that match the request. To list guardians for
89+-- any student that the requesting user may view guardians for, use the
90+-- literal character \`-\` for the student ID. This method returns the
91+-- following error codes: * \`PERMISSION_DENIED\` if a \`student_id\` is
92+-- specified, and the requesting user is not permitted to view guardian
93+-- information for that student, if \`\"-\"\` is specified as the
94+-- \`student_id\` and the user is not a domain administrator, if guardians
95+-- are not enabled for the domain in question, if the
96+-- \`invited_email_address\` filter is set by a user who is not a domain
97+-- administrator, or for other access errors. * \`INVALID_ARGUMENT\` if a
98+-- \`student_id\` is specified, but its format cannot be recognized (it is
99+-- not an email address, nor a \`student_id\` from the API, nor the literal
100+-- string \`me\`). May also be returned if an invalid \`page_token\` is
101+-- provided. * \`NOT_FOUND\` if a \`student_id\` is specified, and its
102+-- format can be recognized, but Classroom has no record of that student.
103+--
104+-- /See:/ 'userProFilesGuardiansList' smart constructor.
105+data UserProFilesGuardiansList = UserProFilesGuardiansList'
106+ { _upfglStudentId :: !Text
107+ , _upfglXgafv :: !(Maybe Text)
108+ , _upfglUploadProtocol :: !(Maybe Text)
109+ , _upfglPp :: !Bool
110+ , _upfglAccessToken :: !(Maybe Text)
111+ , _upfglUploadType :: !(Maybe Text)
112+ , _upfglBearerToken :: !(Maybe Text)
113+ , _upfglInvitedEmailAddress :: !(Maybe Text)
114+ , _upfglPageToken :: !(Maybe Text)
115+ , _upfglPageSize :: !(Maybe (Textual Int32))
116+ , _upfglCallback :: !(Maybe Text)
117+ } deriving (Eq,Show,Data,Typeable,Generic)
118+
119+-- | Creates a value of 'UserProFilesGuardiansList' with the minimum fields required to make a request.
120+--
121+-- Use one of the following lenses to modify other fields as desired:
122+--
123+-- * 'upfglStudentId'
124+--
125+-- * 'upfglXgafv'
126+--
127+-- * 'upfglUploadProtocol'
128+--
129+-- * 'upfglPp'
130+--
131+-- * 'upfglAccessToken'
132+--
133+-- * 'upfglUploadType'
134+--
135+-- * 'upfglBearerToken'
136+--
137+-- * 'upfglInvitedEmailAddress'
138+--
139+-- * 'upfglPageToken'
140+--
141+-- * 'upfglPageSize'
142+--
143+-- * 'upfglCallback'
144+userProFilesGuardiansList
145+ :: Text -- ^ 'upfglStudentId'
146+ -> UserProFilesGuardiansList
147+userProFilesGuardiansList pUpfglStudentId_ =
148+ UserProFilesGuardiansList'
149+ { _upfglStudentId = pUpfglStudentId_
150+ , _upfglXgafv = Nothing
151+ , _upfglUploadProtocol = Nothing
152+ , _upfglPp = True
153+ , _upfglAccessToken = Nothing
154+ , _upfglUploadType = Nothing
155+ , _upfglBearerToken = Nothing
156+ , _upfglInvitedEmailAddress = Nothing
157+ , _upfglPageToken = Nothing
158+ , _upfglPageSize = Nothing
159+ , _upfglCallback = Nothing
160+ }
161+
162+-- | Filter results by the student who the guardian is linked to. The
163+-- identifier can be one of the following: * the numeric identifier for the
164+-- user * the email address of the user * the string literal \`\"me\"\`,
165+-- indicating the requesting user * the string literal \`\"-\"\`,
166+-- indicating that results should be returned for all students that the
167+-- requesting user has access to view.
168+upfglStudentId :: Lens' UserProFilesGuardiansList Text
169+upfglStudentId
170+ = lens _upfglStudentId
171+ (\ s a -> s{_upfglStudentId = a})
172+
173+-- | V1 error format.
174+upfglXgafv :: Lens' UserProFilesGuardiansList (Maybe Text)
175+upfglXgafv
176+ = lens _upfglXgafv (\ s a -> s{_upfglXgafv = a})
177+
178+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
179+upfglUploadProtocol :: Lens' UserProFilesGuardiansList (Maybe Text)
180+upfglUploadProtocol
181+ = lens _upfglUploadProtocol
182+ (\ s a -> s{_upfglUploadProtocol = a})
183+
184+-- | Pretty-print response.
185+upfglPp :: Lens' UserProFilesGuardiansList Bool
186+upfglPp = lens _upfglPp (\ s a -> s{_upfglPp = a})
187+
188+-- | OAuth access token.
189+upfglAccessToken :: Lens' UserProFilesGuardiansList (Maybe Text)
190+upfglAccessToken
191+ = lens _upfglAccessToken
192+ (\ s a -> s{_upfglAccessToken = a})
193+
194+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
195+upfglUploadType :: Lens' UserProFilesGuardiansList (Maybe Text)
196+upfglUploadType
197+ = lens _upfglUploadType
198+ (\ s a -> s{_upfglUploadType = a})
199+
200+-- | OAuth bearer token.
201+upfglBearerToken :: Lens' UserProFilesGuardiansList (Maybe Text)
202+upfglBearerToken
203+ = lens _upfglBearerToken
204+ (\ s a -> s{_upfglBearerToken = a})
205+
206+-- | Filter results by the email address that the original invitation was
207+-- sent to, resulting in this guardian link. This filter can only be used
208+-- by domain administrators.
209+upfglInvitedEmailAddress :: Lens' UserProFilesGuardiansList (Maybe Text)
210+upfglInvitedEmailAddress
211+ = lens _upfglInvitedEmailAddress
212+ (\ s a -> s{_upfglInvitedEmailAddress = a})
213+
214+-- | nextPageToken value returned from a previous list call, indicating that
215+-- the subsequent page of results should be returned. The list request must
216+-- be otherwise identical to the one that resulted in this token.
217+upfglPageToken :: Lens' UserProFilesGuardiansList (Maybe Text)
218+upfglPageToken
219+ = lens _upfglPageToken
220+ (\ s a -> s{_upfglPageToken = a})
221+
222+-- | Maximum number of items to return. Zero or unspecified indicates that
223+-- the server may assign a maximum. The server may return fewer than the
224+-- specified number of results.
225+upfglPageSize :: Lens' UserProFilesGuardiansList (Maybe Int32)
226+upfglPageSize
227+ = lens _upfglPageSize
228+ (\ s a -> s{_upfglPageSize = a})
229+ . mapping _Coerce
230+
231+-- | JSONP
232+upfglCallback :: Lens' UserProFilesGuardiansList (Maybe Text)
233+upfglCallback
234+ = lens _upfglCallback
235+ (\ s a -> s{_upfglCallback = a})
236+
237+instance GoogleRequest UserProFilesGuardiansList
238+ where
239+ type Rs UserProFilesGuardiansList =
240+ ListGuardiansResponse
241+ type Scopes UserProFilesGuardiansList = '[]
242+ requestClient UserProFilesGuardiansList'{..}
243+ = go _upfglStudentId _upfglXgafv _upfglUploadProtocol
244+ (Just _upfglPp)
245+ _upfglAccessToken
246+ _upfglUploadType
247+ _upfglBearerToken
248+ _upfglInvitedEmailAddress
249+ _upfglPageToken
250+ _upfglPageSize
251+ _upfglCallback
252+ (Just AltJSON)
253+ classroomService
254+ where go
255+ = buildClient
256+ (Proxy :: Proxy UserProFilesGuardiansListResource)
257+ mempty
gogol-classroom/gogol-classroom.cabal+7
@@ -68,6 +68,13 @@ library
6868 , Network.Google.Resource.Classroom.Invitations.Get
6969 , Network.Google.Resource.Classroom.Invitations.List
7070 , Network.Google.Resource.Classroom.UserProFiles.Get
71+ , Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Create
72+ , Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Get
73+ , Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.List
74+ , Network.Google.Resource.Classroom.UserProFiles.GuardianInvitations.Patch
75+ , Network.Google.Resource.Classroom.UserProFiles.Guardians.Delete
76+ , Network.Google.Resource.Classroom.UserProFiles.Guardians.Get
77+ , Network.Google.Resource.Classroom.UserProFiles.Guardians.List
7178
7279 other-modules:
7380 Network.Google.Classroom.Types.Product