SnippetService#
- class SnippetService[source]#
- create(json_body)[source]#
Add or modify a Snippet by key.
- Parameters:
json_body (
CreateSnippetData) – The body of the request. SeeCreateSnippetDatafor information about the possible fields. You can provide this data as aCreateSnippetDataor as a dictionary.self (SnippetService[AuthenticatedClient]) –
- Returns:
A response containing the JSON serialized snippet and return code 201.
- Return type:
- delete(*, snippet_id)[source]#
Delete the Snippet with the given id.
- Parameters:
snippet_id (
int) – The id of the snippetself (SnippetService[AuthenticatedClient]) –
- Returns:
An empty response with return code 204
- Return type:
None
- patch(json_body, *, snippet_id)[source]#
Modify the Snippet with the given id.
- Parameters:
json_body (
PatchSnippetData) – The body of the request. SeePatchSnippetDatafor information about the possible fields. You can provide this data as aPatchSnippetDataor as a dictionary.snippet_id (
int) – The id of the snippet to change.self (SnippetService[AuthenticatedClient]) –
- Returns:
An empty response with return code 204.
- Return type:
None
- get_all(*, page_size=20)[source]#
Get all snippets of the current user.
- Parameters:
page_size (
int) – The size of a single page, maximum is 50.self (SnippetService[AuthenticatedClient]) –
- Returns:
An array containing all snippets for the currently logged in user.
- Return type:
Response[Snippet]