AuthenticatedClient#
- class AuthenticatedClient[source]#
A Client which has been authenticated for use on secured endpoints
Methods
Get an
AuthenticatedClientby logging in with your username and password.Get an
AuthenticatedClientby logging in through command line interface.Get an
AuthenticatedClientby logging with an access token.Attributes
aboutGet a
AboutServiceto do requests concerning About.access_planGet a
AccessPlanServiceto do requests concerning AccessPlan.assignmentGet a
AssignmentServiceto do requests concerning Assignment.auto_testGet a
AutoTestServiceto do requests concerning AutoTest.commentGet a
CommentServiceto do requests concerning Comment.courseGet a
CourseServiceto do requests concerning Course.course_priceGet a
CoursePriceServiceto do requests concerning CoursePrice.fileGet a
FileServiceto do requests concerning File.git_providerGet a
GitProviderServiceto do requests concerning GitProvider.groupGet a
GroupServiceto do requests concerning Group.group_setGet a
GroupSetServiceto do requests concerning GroupSet.login_linkGet a
LoginLinkServiceto do requests concerning LoginLink.ltiGet a
LTIServiceto do requests concerning LTI.notificationGet a
NotificationServiceto do requests concerning Notification.oauth_providerGet a
OAuthProviderServiceto do requests concerning OAuthProvider.oauth_tokenGet a
OAuthTokenServiceto do requests concerning OAuthToken.permissionGet a
PermissionServiceto do requests concerning Permission.plagiarismGet a
PlagiarismServiceto do requests concerning Plagiarism.roleGet a
RoleServiceto do requests concerning Role.samlGet a
SamlServiceto do requests concerning Saml.sectionGet a
SectionServiceto do requests concerning Section.site_settingsGet a
SiteSettingsServiceto do requests concerning SiteSettings.snippetGet a
SnippetServiceto do requests concerning Snippet.sso_providerGet a
SSOProviderServiceto do requests concerning SSOProvider.submissionGet a
SubmissionServiceto do requests concerning Submission.task_resultGet a
TaskResultServiceto do requests concerning TaskResult.tenantGet a
TenantServiceto do requests concerning Tenant.transactionGet a
TransactionServiceto do requests concerning Transaction.userGet a
UserServiceto do requests concerning User.user_settingGet a
UserSettingServiceto do requests concerning UserSetting.webhookGet a
WebhookServiceto do requests concerning Webhook.- classmethod get(username, password, tenant=None, host='https://app.codegra.de')[source]#
Get an
AuthenticatedClientby logging in with your username and password.with AuthenticatedClient.get( username='my-username', password=os.getenv('CG_PASS'), tenant='My University', ) as client: print('Hi I am {}'.format(client.user.get().name)
- Parameters:
username (
str) – Your CodeGrade username.password (
str) – Your CodeGrade password, if you do not know your password you can set it by following these steps.tenant (
Optional[str]) – The id or name of your tenant in CodeGrade. This is the name you click on the login screen.host (
str) – The CodeGrade instance you want to use.
- Returns:
A client that you can use to do authenticated requests to CodeGrade. We advise you to use it in combination with a
withblock (i.e. as a contextmanager) for the highest efficiency.- Return type:
- classmethod get_with_token(token, host='https://app.codegra.de', *, check=True)[source]#
Get an
AuthenticatedClientby logging with an access token.- Parameters:
- Returns:
A new
AuthenticatedClient.- Return type:
- classmethod get_from_cli()[source]#
Get an
AuthenticatedClientby logging in through command line interface.- Returns:
A new
AuthenticatedClient.- Return type: