Skip to content

Lanes

Lanes

Bases: GenericRequestMethod

Class responsible to make calls to Kanbanize lanes endpoints

Source code in kanbanize_sdk/endpoints/lanes.py
 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
class Lanes(GenericRequestMethod):
    """
    Class responsible to make calls to Kanbanize lanes endpoints
    """

    endpoint = '/boards'

    def list(self, board_id: int, params: LanesListParams | dict | None = None, *args, **kwargs) -> list:
        """
        This method is responsible to list all lanes from a 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 lanes.

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

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

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

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

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

        Returns:
            A lane object with the basic information data
        """

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

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

    def get(self, board_id: int, lane_id: int, *args, **kwargs) -> dict:
        """
        This method is responsible to get a lane from the board into the platform.

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

        Returns:
            A lane object with the basic information data.
        """
        return self.service.get(self.endpoint + f'/{board_id}/lanes/{lane_id}')

    def update(self, board_id: int, lane_id: int, body: LanesUpdateBody | dict,  *args, **kwargs) -> dict:
        """
        This method is responsible to update a lane from the board into the platform.

        Parameters:
            board_id: An integer parameter that represents the board selected.
            lane_id: An integer parameter that represents the lane selected.
            body: It's a dataclass object that provide all lane essential fields to be updated.
        Returns:
            A lane object with the basic information data
        """

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

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

    def delete(self, board_id: int, lane_id: int, *args, **kwargs) -> None:
        """
        This method is responsible to update a lane from the board into the platform.

        Parameters:
            board_id: An integer parameter that represents the board selected.
            lane_id: An integer parameter that represents the lane selected.
        """
        return self.service.delete(self.endpoint + f'/{board_id}/lanes/{lane_id}')

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

This method is responsible to update a lane from the board into the platform.

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the board selected.

required
lane_id int

An integer parameter that represents the lane selected.

required
Source code in kanbanize_sdk/endpoints/lanes.py
75
76
77
78
79
80
81
82
83
def delete(self, board_id: int, lane_id: int, *args, **kwargs) -> None:
    """
    This method is responsible to update a lane from the board into the platform.

    Parameters:
        board_id: An integer parameter that represents the board selected.
        lane_id: An integer parameter that represents the lane selected.
    """
    return self.service.delete(self.endpoint + f'/{board_id}/lanes/{lane_id}')

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

This method is responsible to get a lane from the board into the platform.

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the board identification.

required
lane_id int

An integer parameter that represents the lane identification.

required

Returns:

Type Description
dict

A lane object with the basic information data.

Source code in kanbanize_sdk/endpoints/lanes.py
46
47
48
49
50
51
52
53
54
55
56
57
def get(self, board_id: int, lane_id: int, *args, **kwargs) -> dict:
    """
    This method is responsible to get a lane from the board into the platform.

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

    Returns:
        A lane object with the basic information data.
    """
    return self.service.get(self.endpoint + f'/{board_id}/lanes/{lane_id}')

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

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

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the board identification.

required
body LanesInsertBody | dict

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

required

Returns:

Type Description
dict

A lane object with the basic information data

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

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

    Returns:
        A lane object with the basic information data
    """

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

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

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

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

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the board identification.

required
params LanesListParams | dict | None

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

None

Returns:

Type Description
list

An array of objects that represents the lanes

Source code in kanbanize_sdk/endpoints/lanes.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
def list(self, board_id: int, params: LanesListParams | dict | None = None, *args, **kwargs) -> list:
    """
    This method is responsible to list all lanes from a 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 lanes.

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

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

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

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

This method is responsible to update a lane from the board into the platform.

Parameters:

Name Type Description Default
board_id int

An integer parameter that represents the board selected.

required
lane_id int

An integer parameter that represents the lane selected.

required
body LanesUpdateBody | dict

It's a dataclass object that provide all lane essential fields to be updated.

required

Returns: A lane object with the basic information data

Source code in kanbanize_sdk/endpoints/lanes.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
def update(self, board_id: int, lane_id: int, body: LanesUpdateBody | dict,  *args, **kwargs) -> dict:
    """
    This method is responsible to update a lane from the board into the platform.

    Parameters:
        board_id: An integer parameter that represents the board selected.
        lane_id: An integer parameter that represents the lane selected.
        body: It's a dataclass object that provide all lane essential fields to be updated.
    Returns:
        A lane object with the basic information data
    """

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

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