laceworksdk.api.v2.contract_info

Lacework ContractInfo API wrapper.

 1# -*- coding: utf-8 -*-
 2"""
 3Lacework ContractInfo API wrapper.
 4"""
 5
 6from laceworksdk.api.base_endpoint import BaseEndpoint
 7
 8
 9class ContractInfoAPI(BaseEndpoint):
10
11    def __init__(self, session):
12        """
13        Initializes the ContractInfoAPI object.
14
15        :param session: An instance of the HttpSession class
16
17        :return ContractInfoAPI object.
18        """
19
20        super().__init__(session, "ContractInfo")
21
22    def get(self,
23            **request_params):
24        """
25        A method to get ContractInfo objects.
26
27        :param request_params: Additional request parameters.
28            (provides support for parameters that may be added in the future)
29
30        :return response json
31        """
32
33        params = self.build_dict_from_items(
34            request_params
35        )
36
37        response = self._session.get(self.build_url(), params=params)
38
39        return response.json()
class ContractInfoAPI(laceworksdk.api.base_endpoint.BaseEndpoint):
10class ContractInfoAPI(BaseEndpoint):
11
12    def __init__(self, session):
13        """
14        Initializes the ContractInfoAPI object.
15
16        :param session: An instance of the HttpSession class
17
18        :return ContractInfoAPI object.
19        """
20
21        super().__init__(session, "ContractInfo")
22
23    def get(self,
24            **request_params):
25        """
26        A method to get ContractInfo objects.
27
28        :param request_params: Additional request parameters.
29            (provides support for parameters that may be added in the future)
30
31        :return response json
32        """
33
34        params = self.build_dict_from_items(
35            request_params
36        )
37
38        response = self._session.get(self.build_url(), params=params)
39
40        return response.json()

A class used to implement base functionality for Lacework API Endpoints

ContractInfoAPI(session)
12    def __init__(self, session):
13        """
14        Initializes the ContractInfoAPI object.
15
16        :param session: An instance of the HttpSession class
17
18        :return ContractInfoAPI object.
19        """
20
21        super().__init__(session, "ContractInfo")

Initializes the ContractInfoAPI object.

Parameters
  • session: An instance of the HttpSession class

:return ContractInfoAPI object.

def get(self, **request_params):
23    def get(self,
24            **request_params):
25        """
26        A method to get ContractInfo objects.
27
28        :param request_params: Additional request parameters.
29            (provides support for parameters that may be added in the future)
30
31        :return response json
32        """
33
34        params = self.build_dict_from_items(
35            request_params
36        )
37
38        response = self._session.get(self.build_url(), params=params)
39
40        return response.json()

A method to get ContractInfo objects.

Parameters
  • request_params: Additional request parameters. (provides support for parameters that may be added in the future)

:return response json