<filename>secrethub/secrethub.py
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _secrethub
else:
    import _secrethub

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


class Client(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        _secrethub.Client_swiginit(self, _secrethub.new_Client())
    __swig_destroy__ = _secrethub.delete_Client

    def read(self, path):
        return _secrethub.Client_read(self, path)

    def read_string(self, path):
        return _secrethub.Client_read_string(self, path)

    def resolve(self, path):
        return _secrethub.Client_resolve(self, path)

    def resolve_env(self):
        return _secrethub.Client_resolve_env(self)

    def exists(self, path):
        return _secrethub.Client_exists(self, path)

    def remove(self, path):
        return _secrethub.Client_remove(self, path)

    def write(self, path, secret):
        return _secrethub.Client_write(self, path, secret)

# Register Client in _secrethub:
_secrethub.Client_swigregister(Client)

class Secret(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    secret_id = property(_secrethub.Secret_secret_id_get)
    dir_id = property(_secrethub.Secret_dir_id_get)
    repo_id = property(_secrethub.Secret_repo_id_get)
    name = property(_secrethub.Secret_name_get)
    blind_name = property(_secrethub.Secret_blind_name_get)
    version_count = property(_secrethub.Secret_version_count_get)
    latest_version = property(_secrethub.Secret_latest_version_get)
    status = property(_secrethub.Secret_status_get)
    created_at = property(_secrethub.Secret_created_at_get)
    __swig_destroy__ = _secrethub.delete_Secret

# Register Secret in _secrethub:
_secrethub.Secret_swigregister(Secret)

class SecretVersion(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    secret_version_id = property(_secrethub.SecretVersion_secret_version_id_get)
    secret = property(_secrethub.SecretVersion_secret_get)
    version = property(_secrethub.SecretVersion_version_get)
    data = property(_secrethub.SecretVersion_data_get)
    created_at = property(_secrethub.SecretVersion_created_at_get)
    status = property(_secrethub.SecretVersion_status_get)
    __swig_destroy__ = _secrethub.delete_SecretVersion

# Register SecretVersion in _secrethub:
_secrethub.SecretVersion_swigregister(SecretVersion)


import os

def export_env(self, env):
    for key, value in env.items():
        os.environ[key] = value
Client.export_env = export_env

def resolve_env(self):
    res = {}
    for key, value in os.environ.items():
        res[key] = self.resolve(value)
    return res
Client.resolve_env = resolve_env




<filename>secrethub/secrethub.py
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _secrethub
else:
    import _secrethub

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


class Client(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        _secrethub.Client_swiginit(self, _secrethub.new_Client())
    __swig_destroy__ = _secrethub.delete_Client

    def read(self, path):
        return _secrethub.Client_read(self, path)

    def read_string(self, path):
        return _secrethub.Client_read_string(self, path)

    def resolve(self, path):
        return _secrethub.Client_resolve(self, path)

    def resolve_env(self):
        return _secrethub.Client_resolve_env(self)

    def exists(self, path):
        return _secrethub.Client_exists(self, path)

    def remove(self, path):
        return _secrethub.Client_remove(self, path)

    def write(self, path, secret):
        return _secrethub.Client_write(self, path, secret)

# Register Client in _secrethub:
_secrethub.Client_swigregister(Client)

class Secret(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    secret_id = property(_secrethub.Secret_secret_id_get)
    dir_id = property(_secrethub.Secret_dir_id_get)
    repo_id = property(_secrethub.Secret_repo_id_get)
    name = property(_secrethub.Secret_name_get)
    blind_name = property(_secrethub.Secret_blind_name_get)
    version_count = property(_secrethub.Secret_version_count_get)
    latest_version = property(_secrethub.Secret_latest_version_get)
    status = property(_secrethub.Secret_status_get)
    created_at = property(_secrethub.Secret_created_at_get)
    __swig_destroy__ = _secrethub.delete_Secret

# Register Secret in _secrethub:
_secrethub.Secret_swigregister(Secret)

class SecretVersion(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    secret_version_id = property(_secrethub.SecretVersion_secret_version_id_get)
    secret = property(_secrethub.SecretVersion_secret_get)
    version = property(_secrethub.SecretVersion_version_get)
    data = property(_secrethub.SecretVersion_data_get)
    created_at = property(_secrethub.SecretVersion_created_at_get)
    status = property(_secrethub.SecretVersion_status_get)
    __swig_destroy__ = _secrethub.delete_SecretVersion

# Register SecretVersion in _secrethub:
_secrethub.SecretVersion_swigregister(SecretVersion)


import os

def export_env(self, env):
    for key, value in env.items():
        os.environ[key] = value
Client.export_env = export_env

def resolve_env(self):
    res = {}
    for key, value in os.environ.items():
        res[key] = self.resolve(value)
    return res
Client.resolve_env = resolve_env




# This file was automatically generated by SWIG (http://www.swig.org). # Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. # Import the low-level C/C++ module Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass Meta class to enforce nondynamic attributes (no new attributes) for a class # Register Client in _secrethub: # Register Secret in _secrethub: # Register SecretVersion in _secrethub: