GitProviderService#
- class GitProviderService[source]#
Methods
Connect an existing repository to an assignment.
Get all repositories for the given git provider.
Create a new repository and connect it to an assignment.
Get all template repositories for the given git provider.
- connect_repository(json_body, *, provider_id, token_id, repository_id, is_test_student, author_id, extra_parameters=None)[source]#
Connect an existing repository to an assignment.
- Parameters:
json_body (
Union
[dict
,list
,ConnectRepositoryGitProviderData
]) – The body of the request. SeeConnectRepositoryGitProviderData
for information about the possible fields. You can provide this data as aConnectRepositoryGitProviderData
or as a dictionary.provider_id (
str
) – The provider from which you want to connect the repo.token_id (
str
) – The id of the token used for authentication.repository_id (
str
) – The id of the repo to connect.is_test_student (
bool
) – Is this webhook for the test student?author_id (
int
) – The id of the user for which we should get the webhook settings.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (GitProviderService[AuthenticatedClient]) –
- Returns:
A job that will be started to connect and clone the repository.
- Return type:
- get_all_repositories(*, provider_id, token_id, after=Nothing, extra_parameters=None)[source]#
Get all repositories for the given git provider.
- Parameters:
provider_id (
str
) – The provider from which you want to retrieve repos.token_id (
str
) – The token to use to retrieve the repos.after (
Union
[Just
[str
],_Nothing
[str
]]) – If given results after this cursor will be retrieved.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (GitProviderService[AuthenticatedClient]) –
- Returns:
The token.
- Return type:
- create_repository(json_body, *, provider_id, token_id, is_test_student, author_id, extra_parameters=None)[source]#
Create a new repository and connect it to an assignment.
- Parameters:
json_body (
Union
[dict
,list
,CreateRepositoryGitProviderData
]) – The body of the request. SeeCreateRepositoryGitProviderData
for information about the possible fields. You can provide this data as aCreateRepositoryGitProviderData
or as a dictionary.provider_id (
str
) – The provider in which you want to create a new repo.token_id (
str
) – The id of the token used for authentication.is_test_student (
bool
) – Is this webhook for the test student?author_id (
int
) – The id of the user for which we should get the webhook settings.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (GitProviderService[AuthenticatedClient]) –
- Returns:
A job that will be started to connect and clone the repository.
- Return type:
- get_all_templates(*, provider_id, token_id, after=Nothing, extra_parameters=None)[source]#
Get all template repositories for the given git provider.
Note: We do not yet support GitLab templates.
- Parameters:
provider_id (
str
) – The provider from which you want to retrieve repos.token_id (
str
) – The token to use to retrieve the repos.after (
Union
[Just
[str
],_Nothing
[str
]]) – If given results after this cursor will be retrieved.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (GitProviderService[AuthenticatedClient]) –
- Returns:
The token.
- Return type: