# Path: cpauto/core/exceptions.py
# class CoreClientError(WebClientError):
#     """Exception raised when an core web client runs into trouble."""
#     pass
# 
# class WaitOnTaskError(CoreClientError):
#     """An error occurred whilst waiting on a task or tasks."""
#     pass
# 
# class ConnectionError(CoreClientError):
#     """A connection error occurred."""
#     pass
# 
# class HTTPError(CoreClientError):
#     """An HTTP error occurred."""
#     pass
# 
# class SSLError(CoreClientError):
#     """An SSL error occurred."""
#     pass
# 
# class Timeout(CoreClientError):
#     """The request timed out."""
#     pass
# 
# class TooManyRedirects(CoreClientError):
#     """Too many redirects."""
#     pass
# 
# class InvalidURL(CoreClientError, ValueError):
#     """The URL provided was invalid."""
#     pass
# 
# 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 .exceptions import (
    CoreClientError,
    WaitOnTaskError,
    ConnectionError,
    HTTPError,
    SSLError,
    Timeout,
    TooManyRedirects,
    InvalidURL
)
from ..objects._common import _CommonClient
import time
import requests
        :rtype: CoreClientResult
        """
        payload = {}
        if uid:
            payload['uid'] = uid
        return self.__core_client.http_post('continue-session-in-smartconsole', payload=payload)

    def show_all(self, limit=50, offset=0, order=[], details_level=''):
        """Shows all sessions with some reasonable limitations.

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

        :param limit: (optional) Limit the total number of sessions shown.
            The default value is 50 and allowed values are in the range 1 to 500.
        :param offset: (optional) Skip a number of sessions in the results
            before they are shown. Default value is 0.
        :param order: (optional) Sort the results by the specified field. The
            default is a random order.
        :param details_level: (optional) The level of detail to show. Default
            value is 'standard' and the other options are: 'uid' or 'full'
        :rtype: CoreClientResult
        """
        return self.__common_client._show_all('show-sessions', limit=limit,
            offset=offset, order=order, details_level=details_level)

class LoginMessage:
    """Manage login message."""

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

# Path: cpauto/core/exceptions.py
# class CoreClientError(WebClientError):
#     """Exception raised when an core web client runs into trouble."""
#     pass
# 
# class WaitOnTaskError(CoreClientError):
#     """An error occurred whilst waiting on a task or tasks."""
#     pass
# 
# class ConnectionError(CoreClientError):
#     """A connection error occurred."""
#     pass
# 
# class HTTPError(CoreClientError):
#     """An HTTP error occurred."""
#     pass
# 
# class SSLError(CoreClientError):
#     """An SSL error occurred."""
#     pass
# 
# class Timeout(CoreClientError):
#     """The request timed out."""
#     pass
# 
# class TooManyRedirects(CoreClientError):
#     """Too many redirects."""
#     pass
# 
# class InvalidURL(CoreClientError, ValueError):
#     """The URL provided was invalid."""
#     pass
# 
# 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/core/sessions.py
from .exceptions import (
    CoreClientError,
    WaitOnTaskError,
    ConnectionError,
    HTTPError,
    SSLError,
    Timeout,
    TooManyRedirects,
    InvalidURL
)
from ..objects._common import _CommonClient
import time
import requests

        :rtype: CoreClientResult
        """
        payload = {}
        if uid:
            payload['uid'] = uid
        return self.__core_client.http_post('continue-session-in-smartconsole', payload=payload)

    def show_all(self, limit=50, offset=0, order=[], details_level=''):
        """Shows all sessions with some reasonable limitations.

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

        :param limit: (optional) Limit the total number of sessions shown.
            The default value is 50 and allowed values are in the range 1 to 500.
        :param offset: (optional) Skip a number of sessions in the results
            before they are shown. Default value is 0.
        :param order: (optional) Sort the results by the specified field. The
            default is a random order.
        :param details_level: (optional) The level of detail to show. Default
            value is 'standard' and the other options are: 'uid' or 'full'
        :rtype: CoreClientResult
        """
        return self.__common_client._show_all('show-sessions', limit=limit,
            offset=offset, order=order, details_level=details_level)

class LoginMessage:
    """Manage login message."""

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

        self.__common_client = _CommonClient(core_client)