class previsionio.usecase.Usecase(**usecase_info)

Bases: previsionio.api_resource.ApiResource

A Usecase

  • _id (str) – Unique id of the usecase
  • name (str) – Name of the usecase

Delete a usecase from the actual [client] workspace.

Returns:Deletion process results
Return type:dict
classmethod from_id(_id: str) → previsionio.usecase.Usecase

Get a usecase from the platform by its unique id.

Parameters:_id (str) – Unique id of the usecase version to retrieve
Returns:Fetched usecase
Return type:BaseUsecaseVersion
Raises:PrevisionException – Any error while fetching data from the platform or parsing result
classmethod list(project_id: str, all: bool = True) → List[previsionio.usecase.Usecase]

List all the available usecase in the current active [client] workspace.


Contrary to the parent list() function, this method returns actual Usecase objects rather than plain dictionaries with the corresponding data.

Parameters:all (boolean, optional) – Whether to force the SDK to load all items of the given type (by calling the paginated API several times). Else, the query will only return the first page of result.
Returns:Fetched dataset objects
Return type:list(Usecase)

Get the list of all versions for the current use case.

Returns:List of the usecase versions (as JSON metadata)
Return type:list(dict)