SnippetService#
- class SnippetService[source]#
- create(json_body, *, extra_parameters=None)[source]#
Add or modify a Snippet by key.
- Parameters:
json_body (
Union
[dict
,list
,CreateSnippetData
]) – The body of the request. SeeCreateSnippetData
for information about the possible fields. You can provide this data as aCreateSnippetData
or as a dictionary.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 (SnippetService[AuthenticatedClient]) –
- Returns:
A response containing the JSON serialized snippet and return code 201.
- Return type:
- delete(*, snippet_id, extra_parameters=None)[source]#
Delete the Snippet with the given id.
- Parameters:
- Returns:
An empty response with return code 204
- Return type:
None
- patch(json_body, *, snippet_id, extra_parameters=None)[source]#
Modify the Snippet with the given id.
- Parameters:
json_body (
Union
[dict
,list
,PatchSnippetData
]) – The body of the request. SeePatchSnippetData
for information about the possible fields. You can provide this data as aPatchSnippetData
or as a dictionary.snippet_id (
int
) – The id of the snippet to change.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 (SnippetService[AuthenticatedClient]) –
- Returns:
An empty response with return code 204.
- Return type:
None
- get_all(*, extra_parameters=None)[source]#
Get all snippets of the current user.
- Parameters:
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 (SnippetService[AuthenticatedClient]) –
- Returns:
An array containing all snippets for the currently logged in user.
- Return type: