How to use the rwslib.rws_requests.__init__.RWSGetRequest function in rwslib

To help you get started, we’ve selected a few rwslib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mdsol / rwslib / rwslib / rws_requests / __init__.py View on Github external
def make_url(self, *args, **kwargs):
        # Note: Including this in the class as a convenience so that you can get all you need from a RWSObject rather
        # than having to import make_url as an additional import.
        return make_url(*args, **kwargs)


# -----------------------------------------------------------------------------------------------------------------------
# Useful subclasses
# -----------------------------------------------------------------------------------------------------------------------

class RWSGetRequest(RWSRequest):
    method = "GET"


class RWSAuthorizedGetRequest(RWSGetRequest):
    requires_authorization = True


class RWSPostRequest(RWSRequest):
    method = "POST"


class RWSAuthorizedPostRequest(RWSPostRequest):
    requires_authorization = True


class QueryOptionGetRequest(RWSAuthorizedGetRequest):
    """Manages requests that have known query string options"""
    KNOWN_QUERY_OPTIONS = []

    def _querystring(self):
github mdsol / rwslib / rwslib / rws_requests / __init__.py View on Github external
class VersionRequest(RWSGetRequest):
    """Get RWS Version number"""

    def url_path(self):
        return make_url('version')


class BuildVersionRequest(RWSGetRequest):
    """Return the RWS build version number"""

    def url_path(self):
        return make_url('version', 'build')


class CodeNameRequest(RWSGetRequest):
    """Return the RWS version codename"""

    def url_path(self):
        return make_url('version', 'codename')


class DiagnosticsRequest(RWSGetRequest):
    """Return the RWS build version number"""

    def url_path(self):
        return make_url('diagnostics')


class TwoHundredRequest(RWSGetRequest):
    """Return RWS MAuth information"""
github mdsol / rwslib / rwslib / rws_requests / __init__.py View on Github external
class CodeNameRequest(RWSGetRequest):
    """Return the RWS version codename"""

    def url_path(self):
        return make_url('version', 'codename')


class DiagnosticsRequest(RWSGetRequest):
    """Return the RWS build version number"""

    def url_path(self):
        return make_url('diagnostics')


class TwoHundredRequest(RWSGetRequest):
    """Return RWS MAuth information"""

    def url_path(self):
        return make_url('twohundred')


class CacheFlushRequest(RWSAuthorizedGetRequest):
    """Calls RWS cache-flush"""

    def url_path(self):
        return make_url('webservice.aspx?CacheFlush')

    def result(self, request):
        """Return RWSResponse object for success"""
        return RWSResponse(request.text)
github mdsol / rwslib / rwslib / rws_requests / __init__.py View on Github external
kw[key] = val
        return kw


# ---------------------------------------------------------------------------------------------------------------------
# Implementations. These are all standards that have existed for a long time.
# ---------------------------------------------------------------------------------------------------------------------

class VersionRequest(RWSGetRequest):
    """Get RWS Version number"""

    def url_path(self):
        return make_url('version')


class BuildVersionRequest(RWSGetRequest):
    """Return the RWS build version number"""

    def url_path(self):
        return make_url('version', 'build')


class CodeNameRequest(RWSGetRequest):
    """Return the RWS version codename"""

    def url_path(self):
        return make_url('version', 'codename')


class DiagnosticsRequest(RWSGetRequest):
    """Return the RWS build version number"""
github mdsol / rwslib / rwslib / rws_requests / __init__.py View on Github external
class BuildVersionRequest(RWSGetRequest):
    """Return the RWS build version number"""

    def url_path(self):
        return make_url('version', 'build')


class CodeNameRequest(RWSGetRequest):
    """Return the RWS version codename"""

    def url_path(self):
        return make_url('version', 'codename')


class DiagnosticsRequest(RWSGetRequest):
    """Return the RWS build version number"""

    def url_path(self):
        return make_url('diagnostics')


class TwoHundredRequest(RWSGetRequest):
    """Return RWS MAuth information"""

    def url_path(self):
        return make_url('twohundred')


class CacheFlushRequest(RWSAuthorizedGetRequest):
    """Calls RWS cache-flush"""
github mdsol / rwslib / rwslib / rws_requests / __init__.py View on Github external
def _querystring(self):
        """Get additional keyword arguments"""

        kw = {}
        for key in self.KNOWN_QUERY_OPTIONS:
            val = getattr(self, key)
            if val is not None:
                kw[key] = val
        return kw


# ---------------------------------------------------------------------------------------------------------------------
# Implementations. These are all standards that have existed for a long time.
# ---------------------------------------------------------------------------------------------------------------------

class VersionRequest(RWSGetRequest):
    """Get RWS Version number"""

    def url_path(self):
        return make_url('version')


class BuildVersionRequest(RWSGetRequest):
    """Return the RWS build version number"""

    def url_path(self):
        return make_url('version', 'build')


class CodeNameRequest(RWSGetRequest):
    """Return the RWS version codename"""