Skip to content

Boards

Boards

Bases: GenericRequestMethod

Class responsible to make calls to Kanbanize boards endpoints

Source code in kanbanize_sdk/endpoints/boards.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
class Boards(GenericRequestMethod):
    """
    Class responsible to make calls to Kanbanize boards endpoints
    """
    endpoint = '/boards'

    def list(self, params: BoardsListParams | dict | None = None, **kwargs) -> list:
        """
        This method is responsible to list all board in the platform.

        Parameters:
            params: It's a dataclass object that provide all possible parameters to be used to list the boards.

        Returns:
            An array of objects that represents the boards
        """
        params = params.to_dict() if isinstance(params, BoardsListParams) else params
        return self.service.get(self.endpoint, params=params)

    def insert(self, body: BoardsInsertBody | dict) -> dict:
        """
        This method is responsible to insert a board to the platform.

        Parameters:
            body: It's a dataclass object that provide the essential request body needed to invite an board to the platform.

        Returns:
            An board object with the basic information data
        """

        payload = body.to_dict() if isinstance(body, BoardsInsertBody) else body

        return self.service.post(self.endpoint, data=payload)

    def get(self, board_id: int) -> dict:
        """
        This method is responsible to get one board from the platform.

        Parameters:
            board_id: An integer parameter that represents the board identification.

        Returns:
            A searched board object
        """
        return self.service.get(self.endpoint + f'/{board_id}')

    def update(self, board_id: int, body: BoardsUpdateBody | dict) -> dict:
        """
        This method is responsible to update an board in the platform.

        Parameters:
            board_id: An integer parameter that represents the board identification.
            body: It's a dataclass object that represent the body option to be updated.

        Returns:
            The updated board object
        """

        payload = body.to_dict() if isinstance(body, BoardsUpdateBody) else body

        return self.service.patch(self.endpoint + f'/{board_id}', data=payload)

    def delete(self, board_id: int) -> None:
        """
        This method is responsible to remove an board from the platform.

        Parameters:
            board_id: An integer parameter that represents the board identification.

        """
        return self.service.delete(self.endpoint + f'/{board_id}')

delete(board_id)

This method is responsible to remove an board from the platform.

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the board identification.

required
Source code in kanbanize_sdk/endpoints/boards.py
67
68
69
70
71
72
73
74
75
def delete(self, board_id: int) -> None:
    """
    This method is responsible to remove an board from the platform.

    Parameters:
        board_id: An integer parameter that represents the board identification.

    """
    return self.service.delete(self.endpoint + f'/{board_id}')

get(board_id)

This method is responsible to get one board from the platform.

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the board identification.

required

Returns:

Type Description
dict

A searched board object

Source code in kanbanize_sdk/endpoints/boards.py
39
40
41
42
43
44
45
46
47
48
49
def get(self, board_id: int) -> dict:
    """
    This method is responsible to get one board from the platform.

    Parameters:
        board_id: An integer parameter that represents the board identification.

    Returns:
        A searched board object
    """
    return self.service.get(self.endpoint + f'/{board_id}')

insert(body)

This method is responsible to insert a board to the platform.

Parameters:

Name Type Description Default
body BoardsInsertBody | dict

It's a dataclass object that provide the essential request body needed to invite an board to the platform.

required

Returns:

Type Description
dict

An board object with the basic information data

Source code in kanbanize_sdk/endpoints/boards.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def insert(self, body: BoardsInsertBody | dict) -> dict:
    """
    This method is responsible to insert a board to the platform.

    Parameters:
        body: It's a dataclass object that provide the essential request body needed to invite an board to the platform.

    Returns:
        An board object with the basic information data
    """

    payload = body.to_dict() if isinstance(body, BoardsInsertBody) else body

    return self.service.post(self.endpoint, data=payload)

list(params=None, **kwargs)

This method is responsible to list all board in the platform.

Parameters:

Name Type Description Default
params BoardsListParams | dict | None

It's a dataclass object that provide all possible parameters to be used to list the boards.

None

Returns:

Type Description
list

An array of objects that represents the boards

Source code in kanbanize_sdk/endpoints/boards.py
11
12
13
14
15
16
17
18
19
20
21
22
def list(self, params: BoardsListParams | dict | None = None, **kwargs) -> list:
    """
    This method is responsible to list all board in the platform.

    Parameters:
        params: It's a dataclass object that provide all possible parameters to be used to list the boards.

    Returns:
        An array of objects that represents the boards
    """
    params = params.to_dict() if isinstance(params, BoardsListParams) else params
    return self.service.get(self.endpoint, params=params)

update(board_id, body)

This method is responsible to update an board in the platform.

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the board identification.

required
body BoardsUpdateBody | dict

It's a dataclass object that represent the body option to be updated.

required

Returns:

Type Description
dict

The updated board object

Source code in kanbanize_sdk/endpoints/boards.py
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
def update(self, board_id: int, body: BoardsUpdateBody | dict) -> dict:
    """
    This method is responsible to update an board in the platform.

    Parameters:
        board_id: An integer parameter that represents the board identification.
        body: It's a dataclass object that represent the body option to be updated.

    Returns:
        The updated board object
    """

    payload = body.to_dict() if isinstance(body, BoardsUpdateBody) else body

    return self.service.patch(self.endpoint + f'/{board_id}', data=payload)