Json Values
- class Json_Values(session_kwargs, client, return_type='raw')
Methods
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get details about a JSON Value
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, name, value_str])Update some attributes of this JSON Value
post
(value_str, *[, name])Create a JSON Value
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
Examples
>>> import civis >>> client = civis.APIClient() >>> client.json_values.post(...)
Revoke the permissions a group has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- group_idint
The ID of the group.
- Returns:
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint
The ID of the user.
- Returns:
- None
Response code 204: success
- get(id: int) Response
Get details about a JSON Value
- Parameters:
- idint
The ID of the JSON Value.
- Returns:
civis.Response
- idint
The ID of the JSON Value.
- namestr
The name of the JSON Value.
- valueobject
The deserialized JSON value.
- list_dependencies(id: int, *, user_id: int = None) Response
List dependent objects for this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint, optional
ID of target user
- Returns:
civis.Response
- object_typestr
Dependent object type
- fco_typestr
Human readable dependent object type
- idint
Dependent object ID
- namestr
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstr
Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).
- descriptionstr
Additional information about the dependency, if relevant
- shareablebool
Whether or not the requesting user can share this object.
List users and groups permissioned on this object
- Parameters:
- idint
The ID of the resource that is shared.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch(id: int, *, name: str = None, value_str: str = None) Response
Update some attributes of this JSON Value
- Parameters:
- idint
The ID of the JSON Value.
- namestr, optional
The name of the JSON Value.
- value_strstr, optional
The JSON value to store. Should be a serialized JSON string. Limited to 1000000 bytes.
- Returns:
civis.Response
- idint
The ID of the JSON Value.
- namestr
The name of the JSON Value.
- valueobject
The deserialized JSON value.
- post(value_str: str, *, name: str = None) Response
Create a JSON Value
- Parameters:
- value_strstr
The JSON value to store. Should be a serialized JSON string. Limited to 1000000 bytes.
- namestr, optional
The name of the JSON Value.
- Returns:
civis.Response
- idint
The ID of the JSON Value.
- namestr
The name of the JSON Value.
- valueobject
The deserialized JSON value.
Set the permissions groups has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- group_idsList[int]
An array of one or more group IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idsList[int]
An array of one or more user IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None) Response
Transfer ownership of this object to another user
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint
ID of target user
- include_dependenciesbool
Whether or not to give manage permissions on all dependencies
- email_bodystr, optional
Custom body text for e-mail sent on transfer.
- send_emailbool, optional
Send email to the target user of the transfer?
- Returns:
civis.Response
- dependenciesList[
civis.Response
] Dependent objects for this object
- object_typestr
Dependent object type
- fco_typestr
Human readable dependent object type
- idint
Dependent object ID
- namestr
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstr
Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).
- descriptionstr
Additional information about the dependency, if relevant
- sharedbool
Whether dependent object was successfully shared with target user
- dependenciesList[