utils.rcclient.entities.global_variable
This module defines a GlobalVariable class for interacting with the Global Variable service.
- utils.rcclient.entities.global_variable.name
The name of the global variable.
- Type:
str
- utils.rcclient.entities.global_variable.project_id
The project ID of the global variable.
- Type:
str
- utils.rcclient.entities.global_variable._id
The ID of the global variable.
- Type:
str
- utils.rcclient.entities.global_variable.type
The type of the global variable.
- Type:
str
- utils.rcclient.entities.global_variable.value
The value of the global variable.
- Type:
str
- utils.rcclient.entities.global_variable.gv_service
The global variable service.
- Type:
ClassVar[gv_svc.GlobalVariableService]
- from_(res_dto
res_dtos.GlobalVariableResponseDto) -> GlobalVariable: Converts a GlobalVariableResponseDto object to a GlobalVariable object.
- get_all(project_id
str) -> List[GlobalVariable]: Gets all global variables for the specified project ID.
- get_all_by_solution(solution_id
str) -> List[GlobalVariable]: Gets all global variables for the specified solution ID.
- get(_id
str) -> GlobalVariable: Gets the global variable with the specified ID.
- utils.rcclient.entities.global_variable.create() GlobalVariable
Creates a new global variable.
- utils.rcclient.entities.global_variable.update() GlobalVariable
Updates the existing global variable.
- utils.rcclient.entities.global_variable.delete() None
Deletes the global variable.
- Usage:
- To create a new global variable:
- gv = GlobalVariable(name=”example”, project_id=”12345”, type=”string”,
value=”hello world”)
gv.create()
- To update an existing global variable:
gv = GlobalVariable.get(“67890”) gv.value = “new value” gv.update()
Module Contents
Classes
A class representing a Global Variable. |
Attributes
- utils.rcclient.entities.global_variable.logger
- class utils.rcclient.entities.global_variable.GlobalVariable
A class representing a Global Variable.
Attributes:
- namestr
The name of the Global Variable.
- project_idstr, optional
The ID of the project to which this Global Variable belongs.
- _idstr, optional
The unique identifier of the Global Variable.
- typestr, optional
The data type of the Global Variable.
- valuestr, optional
The value of the Global Variable.
- gv_serviceClassVar[gv_svc.GlobalVariableService]
An instance of the GlobalVariableService class, used to interact with the platform API.
Methods:
- from_(res_dto: res_dtos.GlobalVariableResponseDto) -> GlobalVariable:
Create a new GlobalVariable instance from a GlobalVariableResponseDto object.
- get_all(project_id: str) -> List[GlobalVariable]:
Get a list of all Global Variables belonging to the specified project.
- get_all_by_solution(solution_id: str) -> List[GlobalVariable]:
Get a list of all Global Variables belonging to the specified solution.
- get(_id: str) -> GlobalVariable:
Get a GlobalVariable instance by its unique identifier.
- create() -> GlobalVariable:
Create a new Global Variable.
- update() -> GlobalVariable:
Update the value of an existing Global Variable.
- delete() -> None:
Delete an existing Global Variable.
- name: str
- project_id: str
- _id: str
- type: str
- value: str
- gv_service: ClassVar[utils.rcclient.services.global_variable_service.GlobalVariableService]
- classmethod from_(res_dto: utils.rcclient.dtos.response_dtos.GlobalVariableResponseDto) GlobalVariable
- classmethod get_all(project_id: str) List[GlobalVariable]
Returns a list of all GlobalVariable objects belonging to the specified project.
- Parameters:
project_id (str) – The ID of the project to retrieve GlobalVariable
for. (objects)
- Returns:
A list of GlobalVariable objects belonging to the specified project.
- Return type:
List[GlobalVariable]
- classmethod get_all_by_solution(solution_id: str) List[GlobalVariable]
Returns a list of all GlobalVariable objects belonging to the specified solution.
- Parameters:
solution_id (str) – The ID of the solution to retrieve GlobalVariable objects for.
- Returns:
- A list of GlobalVariable objects belonging to
the specified solution.
- Return type:
List[GlobalVariable]
- classmethod get(_id: str) GlobalVariable
Returns the GlobalVariable object with the specified ID.
- Parameters:
_id (str) – The ID of the GlobalVariable object to retrieve.
- Returns:
The GlobalVariable object with the specified ID.
- Return type:
- create() GlobalVariable
Creates a new GlobalVariable object using the specified data and returns it.
- Returns:
The created GlobalVariable object.
- Return type:
- update() GlobalVariable
Updates the existing GlobalVariable object with the specified data and returns it.
- Returns:
The updated GlobalVariable object.
- Return type:
- create_or_update() GlobalVariable
Creates a new GlobalVariable object using name and projectId and returns it.(when name+projectId is not unique) Updates the existing GlobalVariable object with the specified data and returns it.(when name+projectId is unique) :returns: The created or updated GlobalVariable object. :rtype: GlobalVariable
- delete() None
Deletes the GlobalVariable object from the database.
- Returns:
None