1<?php 2/* 3 * Copyright 2014 Google Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 * use this file except in compliance with the License. You may obtain a copy of 7 * the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18/** 19 * The "guardians" collection of methods. 20 * Typical usage is: 21 * <code> 22 * $classroomService = new Google_Service_Classroom(...); 23 * $guardians = $classroomService->guardians; 24 * </code> 25 */ 26class Google_Service_Classroom_Resource_UserProfilesGuardians extends Google_Service_Resource 27{ 28 /** 29 * Deletes a guardian. 30 * 31 * The guardian will no longer receive guardian notifications and the guardian 32 * will no longer be accessible via the API. 33 * 34 * This method returns the following error codes: 35 * 36 * * `PERMISSION_DENIED` if no user that matches the provided `student_id` is 37 * visible to the requesting user, if the requesting user is not permitted to 38 * manage guardians for the student identified by the `student_id`, if 39 * guardians are not enabled for the domain in question, or for other access 40 * errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format 41 * cannot be recognized (it is not an email address, nor a `student_id` from 42 * the API). * `NOT_FOUND` if the requesting user is permitted to modify 43 * guardians for the requested `student_id`, but no `Guardian` record exists 44 * for that student with the provided `guardian_id`. (guardians.delete) 45 * 46 * @param string $studentId The student whose guardian is to be deleted. One of 47 * the following: 48 * 49 * * the numeric identifier for the user * the email address of the user * the 50 * string literal `"me"`, indicating the requesting user 51 * @param string $guardianId The `id` field from a `Guardian`. 52 * @param array $optParams Optional parameters. 53 * @return Google_Service_Classroom_ClassroomEmpty 54 */ 55 public function delete($studentId, $guardianId, $optParams = array()) 56 { 57 $params = array('studentId' => $studentId, 'guardianId' => $guardianId); 58 $params = array_merge($params, $optParams); 59 return $this->call('delete', array($params), "Google_Service_Classroom_ClassroomEmpty"); 60 } 61 /** 62 * Returns a specific guardian. 63 * 64 * This method returns the following error codes: 65 * 66 * * `PERMISSION_DENIED` if no user that matches the provided `student_id` is 67 * visible to the requesting user, if the requesting user is not permitted to 68 * view guardian information for the student identified by the `student_id`, 69 * if guardians are not enabled for the domain in question, or for other 70 * access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its 71 * format cannot be recognized (it is not an email address, nor a `student_id` 72 * from the API, nor the literal string `me`). * `NOT_FOUND` if the requesting 73 * user is permitted to view guardians for the requested `student_id`, but no 74 * `Guardian` record exists for that student that matches the provided 75 * `guardian_id`. (guardians.get) 76 * 77 * @param string $studentId The student whose guardian is being requested. One 78 * of the following: 79 * 80 * * the numeric identifier for the user * the email address of the user * the 81 * string literal `"me"`, indicating the requesting user 82 * @param string $guardianId The `id` field from a `Guardian`. 83 * @param array $optParams Optional parameters. 84 * @return Google_Service_Classroom_Guardian 85 */ 86 public function get($studentId, $guardianId, $optParams = array()) 87 { 88 $params = array('studentId' => $studentId, 'guardianId' => $guardianId); 89 $params = array_merge($params, $optParams); 90 return $this->call('get', array($params), "Google_Service_Classroom_Guardian"); 91 } 92 /** 93 * Returns a list of guardians that the requesting user is permitted to view, 94 * restricted to those that match the request. 95 * 96 * To list guardians for any student that the requesting user may view guardians 97 * for, use the literal character `-` for the student ID. 98 * 99 * This method returns the following error codes: 100 * 101 * * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting 102 * user is not permitted to view guardian information for that student, if 103 * `"-"` is specified as the `student_id` and the user is not a domain 104 * administrator, if guardians are not enabled for the domain in question, if 105 * the `invited_email_address` filter is set by a user who is not a domain 106 * administrator, or for other access errors. * `INVALID_ARGUMENT` if a 107 * `student_id` is specified, but its format cannot be recognized (it is not 108 * an email address, nor a `student_id` from the API, nor the literal string 109 * `me`). May also be returned if an invalid `page_token` is provided. * 110 * `NOT_FOUND` if a `student_id` is specified, and its format can be 111 * recognized, but Classroom has no record of that student. 112 * (guardians.listUserProfilesGuardians) 113 * 114 * @param string $studentId Filter results by the student who the guardian is 115 * linked to. The identifier can be one of the following: 116 * 117 * * the numeric identifier for the user * the email address of the user * the 118 * string literal `"me"`, indicating the requesting user * the string literal 119 * `"-"`, indicating that results should be returned for all students that the 120 * requesting user has access to view. 121 * @param array $optParams Optional parameters. 122 * 123 * @opt_param string pageToken nextPageToken value returned from a previous list 124 * call, indicating that the subsequent page of results should be returned. 125 * 126 * The list request must be otherwise identical to the one that resulted in this 127 * token. 128 * @opt_param string invitedEmailAddress Filter results by the email address 129 * that the original invitation was sent to, resulting in this guardian link. 130 * This filter can only be used by domain administrators. 131 * @opt_param int pageSize Maximum number of items to return. Zero or 132 * unspecified indicates that the server may assign a maximum. 133 * 134 * The server may return fewer than the specified number of results. 135 * @return Google_Service_Classroom_ListGuardiansResponse 136 */ 137 public function listUserProfilesGuardians($studentId, $optParams = array()) 138 { 139 $params = array('studentId' => $studentId); 140 $params = array_merge($params, $optParams); 141 return $this->call('list', array($params), "Google_Service_Classroom_ListGuardiansResponse"); 142 } 143} 144