File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -336,8 +336,8 @@ def add_attachment(self):
336336 # [START classroom_add_attachment]
337337 request = {
338338 'addAttachments' : [
339- {'link' : { 'url' : 'http://example.com/quiz-results' }},
340- {'link' : { 'url' : 'http://example.com/quiz-reading' }}
339+ {'link' : {'url' : 'http://example.com/quiz-results' }},
340+ {'link' : {'url' : 'http://example.com/quiz-reading' }}
341341 ]
342342 }
343343 coursework = service .courses ().courseWork ()
@@ -347,3 +347,20 @@ def add_attachment(self):
347347 id = "CgwI1Jy-rhQQlMDK8Gk" ,
348348 body = request ).execute ()
349349 # [END classroom_add_attachment]
350+
351+ def invite_guardian (self ):
352+ """
353+ Send an invite to a guardian
354+ """
355+ service = self .service
356+ # [START classroom_add_attachment]
357+ guardianInvitation = {
358+ 'invitedEmailAddress' : 'guardian@gmail.com' ,
359+ }
360+ guardianInvitations = service .userProfiles ().guardianInvitations ()
361+ guardianInvitation = guardianInvitations .create (
362+ # You can use a user ID or an email address.
363+ studentId = 'student@mydomain.edu' ,
364+ body = guardianInvitation ).execute ()
365+ print ("Invitation created with id: {%s}"
366+ % guardianInvitation .get ('invitationId' ))
You can’t perform that action at this time.
0 commit comments