Skip to content

Columns

Columns

Bases: GenericRequestMethod

Class responsible to make calls to Kanbanize columns endpoints

Source code in kanbanize_sdk/endpoints/columns.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
76
77
78
79
80
81
82
83
84
85
86
87
88
class Columns(GenericRequestMethod):
    """
    Class responsible to make calls to Kanbanize columns endpoints
    """

    endpoint = '/boards'

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

        Parameters:
            board_id: An integer parameter that represents the board identification.
            params: It's a dataclass object that provide all possible parameters to be used to list the columns.

        Returns:
            An array of objects that represents the columns
        """

        params = params.to_dict() if isinstance(params, ColumnsListParams) else params

        return self.service.get(
            self.endpoint + f'/{board_id}/columns',
            params=params
        )

    def insert(self, board_id: int, body: ColumnsInsertBody | dict, *args, **kwargs) -> dict:
        """
        This method is responsible to add a column to the board into the platform.

        Parameters:
            board_id: An integer parameter that represents the selected board object.
            body: It's a dataclass object that provide the essential request body needed to add a column
                to the platform.

        Returns:
            A column object with the basic information data.
        """

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

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

    def get(self, board_id: int, column_id: int, *args, **kwargs) -> dict:
        """
        This method is responsible to get one column object from the board into the platform.

        Parameters:
            board_id: An integer parameter that represents the selected board object.
            column_id: An integer parameter that represents the selected column object.

        Returns:
            A column object with the basic information data.

        """
        return self.service.get(self.endpoint + f'/{board_id}/columns/{column_id}')

    def update(self, board_id: int, column_id: int, body: ColumnsUpdateBody | dict, *args, **kwargs) -> dict:
        """
        This method is responsible to update one column object from the board into the platform.

        Parameters:
            board_id: An integer parameter that represents the selected board object.
            column_id: An integer parameter that represents the selected column object.
            body: It's a dataclass object that provide the essential request body needed to update a column
                to the platform.

        Returns:
            A column object with the basic information data.
        """

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

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

    def delete(self, board_id: int, column_id: int, *args, **kwargs) -> None:
        """
        This method is responsible to delete one column object from the board into the platform.

        Parameters:
            board_id: An integer parameter that represents the selected board object.
            column_id: An integer parameter that represents the selected column object.
        """
        return self.service.delete(self.endpoint + f'/{board_id}/columns/{column_id}')

delete(board_id, column_id, *args, **kwargs)

This method is responsible to delete one column object from the board into the platform.

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the selected board object.

required
column_id int

An integer parameter that represents the selected column object.

required
Source code in kanbanize_sdk/endpoints/columns.py
80
81
82
83
84
85
86
87
88
def delete(self, board_id: int, column_id: int, *args, **kwargs) -> None:
    """
    This method is responsible to delete one column object from the board into the platform.

    Parameters:
        board_id: An integer parameter that represents the selected board object.
        column_id: An integer parameter that represents the selected column object.
    """
    return self.service.delete(self.endpoint + f'/{board_id}/columns/{column_id}')

get(board_id, column_id, *args, **kwargs)

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

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the selected board object.

required
column_id int

An integer parameter that represents the selected column object.

required

Returns:

Type Description
dict

A column object with the basic information data.

Source code in kanbanize_sdk/endpoints/columns.py
48
49
50
51
52
53
54
55
56
57
58
59
60
def get(self, board_id: int, column_id: int, *args, **kwargs) -> dict:
    """
    This method is responsible to get one column object from the board into the platform.

    Parameters:
        board_id: An integer parameter that represents the selected board object.
        column_id: An integer parameter that represents the selected column object.

    Returns:
        A column object with the basic information data.

    """
    return self.service.get(self.endpoint + f'/{board_id}/columns/{column_id}')

insert(board_id, body, *args, **kwargs)

This method is responsible to add a column to the board into the platform.

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the selected board object.

required
body ColumnsInsertBody | dict

It's a dataclass object that provide the essential request body needed to add a column to the platform.

required

Returns:

Type Description
dict

A column object with the basic information data.

Source code in kanbanize_sdk/endpoints/columns.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def insert(self, board_id: int, body: ColumnsInsertBody | dict, *args, **kwargs) -> dict:
    """
    This method is responsible to add a column to the board into the platform.

    Parameters:
        board_id: An integer parameter that represents the selected board object.
        body: It's a dataclass object that provide the essential request body needed to add a column
            to the platform.

    Returns:
        A column object with the basic information data.
    """

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

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

list(board_id, params=None, *args, **kwargs)

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

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the board identification.

required
params ColumnsListParams | dict | None

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

None

Returns:

Type Description
list

An array of objects that represents the columns

Source code in kanbanize_sdk/endpoints/columns.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def list(self, board_id: int, params: ColumnsListParams | dict | None = None, *args, **kwargs) -> list:
    """
    This method is responsible to list all columns from board in the platform.

    Parameters:
        board_id: An integer parameter that represents the board identification.
        params: It's a dataclass object that provide all possible parameters to be used to list the columns.

    Returns:
        An array of objects that represents the columns
    """

    params = params.to_dict() if isinstance(params, ColumnsListParams) else params

    return self.service.get(
        self.endpoint + f'/{board_id}/columns',
        params=params
    )

update(board_id, column_id, body, *args, **kwargs)

This method is responsible to update one column object from the board into the platform.

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the selected board object.

required
column_id int

An integer parameter that represents the selected column object.

required
body ColumnsUpdateBody | dict

It's a dataclass object that provide the essential request body needed to update a column to the platform.

required

Returns:

Type Description
dict

A column object with the basic information data.

Source code in kanbanize_sdk/endpoints/columns.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
def update(self, board_id: int, column_id: int, body: ColumnsUpdateBody | dict, *args, **kwargs) -> dict:
    """
    This method is responsible to update one column object from the board into the platform.

    Parameters:
        board_id: An integer parameter that represents the selected board object.
        column_id: An integer parameter that represents the selected column object.
        body: It's a dataclass object that provide the essential request body needed to update a column
            to the platform.

    Returns:
        A column object with the basic information data.
    """

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

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