# Path: cpauto/objects/_common.py
# class _CommonClient:
#     def __init__(self, core_client):
#         self.__core_client = core_client
# 
#     def _add(self, endpoint, name='', params={}):
#         payload = { 'name': name }
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _add_with_layer(self, endpoint="", layer="", position="", params={}):
#         payload = { 'layer': layer, 'position': position }
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _post_with_layer(self, endpoint='', layer='', name='', uid='', params={}):
#         payload = { 'layer': layer }
#         if name:
#             payload['name'] = name
#         if uid:
#             payload['uid'] = uid
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _show(self, endpoint, name='', uid='', details_level='', params={}):
#         payload = {}
#         if name:
#             payload['name'] = name
#         if uid:
#             payload['uid'] = uid
#         if details_level:
#             payload['details-level'] = details_level
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _set(self, endpoint, name='', uid='', params={}):
#         payload = {}
#         if name:
#             payload['name'] = name
#         if uid:
#             payload['uid'] = uid
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _delete(self, endpoint, name='', uid='', params={}):
#         payload = {}
#         if name:
#             payload['name'] = name
#         if uid:
#             payload['uid'] = uid
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _show_all(self, endpoint, limit=50, offset=0, order=[], details_level=''):
#         payload = { 'limit': limit, 'offset': offset }
#         if order:
#             payload['order'] = order
#         if details_level:
#             payload['details-level'] = details_level
#         return self.__core_client.http_post(endpoint, payload=payload)


from ._common import _CommonClient

        https://sc1.checkpoint.com/documents/R80/APIs/#web/delete-access-rule

        :param layer: Layer that the rule belongs to identified by name or UID.
        :param name: (optional) The name of an existing access rule.
        :param uid: (optional) The unique identifier of an existing access rule.
        :param params: (optional) A dictionary of additional, supported parameter name$
        :rtype: CoreClientResult
        """
        return self.__common_client._post_with_layer('delete-access-rule', layer, name, uid, params)

    def show_all(self, name='', params={}):
        """Shows all access rules within a layer, section, etc.

        https://sc1.checkpoint.com/documents/R80/APIs/#web/show-access-rulebase

        :param name: The name of an existing access layer, section, etc.
        :param params: (optional) A dictionary of additional, supported parameter name$
        :rtype: CoreClientResult
        """
        payload = { 'name': name }
        if params:
            payload = self.__cc.merge_payloads(payload, params)
        return self.__cc.http_post('show-access-rulebase', payload=payload)

class AccessSection:
    """Manage access sections."""

    def __init__(self, core_client):
        self.__cc = core_client

# Path: cpauto/objects/_common.py
# class _CommonClient:
#     def __init__(self, core_client):
#         self.__core_client = core_client
# 
#     def _add(self, endpoint, name='', params={}):
#         payload = { 'name': name }
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _add_with_layer(self, endpoint="", layer="", position="", params={}):
#         payload = { 'layer': layer, 'position': position }
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _post_with_layer(self, endpoint='', layer='', name='', uid='', params={}):
#         payload = { 'layer': layer }
#         if name:
#             payload['name'] = name
#         if uid:
#             payload['uid'] = uid
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _show(self, endpoint, name='', uid='', details_level='', params={}):
#         payload = {}
#         if name:
#             payload['name'] = name
#         if uid:
#             payload['uid'] = uid
#         if details_level:
#             payload['details-level'] = details_level
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _set(self, endpoint, name='', uid='', params={}):
#         payload = {}
#         if name:
#             payload['name'] = name
#         if uid:
#             payload['uid'] = uid
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _delete(self, endpoint, name='', uid='', params={}):
#         payload = {}
#         if name:
#             payload['name'] = name
#         if uid:
#             payload['uid'] = uid
#         if params:
#             payload = self.__core_client.merge_payloads(payload, params)
#         return self.__core_client.http_post(endpoint, payload=payload)
# 
#     def _show_all(self, endpoint, limit=50, offset=0, order=[], details_level=''):
#         payload = { 'limit': limit, 'offset': offset }
#         if order:
#             payload['order'] = order
#         if details_level:
#             payload['details-level'] = details_level
#         return self.__core_client.http_post(endpoint, payload=payload)


# Path: cpauto/objects/access.py
from ._common import _CommonClient


        https://sc1.checkpoint.com/documents/R80/APIs/#web/delete-access-rule

        :param layer: Layer that the rule belongs to identified by name or UID.
        :param name: (optional) The name of an existing access rule.
        :param uid: (optional) The unique identifier of an existing access rule.
        :param params: (optional) A dictionary of additional, supported parameter name$
        :rtype: CoreClientResult
        """
        return self.__common_client._post_with_layer('delete-access-rule', layer, name, uid, params)

    def show_all(self, name='', params={}):
        """Shows all access rules within a layer, section, etc.

        https://sc1.checkpoint.com/documents/R80/APIs/#web/show-access-rulebase

        :param name: The name of an existing access layer, section, etc.
        :param params: (optional) A dictionary of additional, supported parameter name$
        :rtype: CoreClientResult
        """
        payload = { 'name': name }
        if params:
            payload = self.__cc.merge_payloads(payload, params)
        return self.__cc.http_post('show-access-rulebase', payload=payload)

class AccessSection:
    """Manage access sections."""

    def __init__(self, core_client):
        self.__cc = core_client

        self.__common_client = _CommonClient(core_client)