How to use the trains.backend_api.session.Response function in trains

To help you get started, weโ€™ve selected a few trains 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 allegroai / trains / trains / backend_api / services / v2_1 / auth.py View on Github external
Note: Only credential keys are returned.

    """

    _service = "auth"
    _action = "get_credentials"
    _version = "1.5"
    _schema = {
        'additionalProperties': False,
        'definitions': {},
        'properties': {},
        'type': 'object',
    }


class GetCredentialsResponse(Response):
    """
    Response of auth.get_credentials endpoint.

    :param credentials: List of credentials, each with an empty secret field.
    :type credentials: Sequence[CredentialKey]
    """
    _service = "auth"
    _action = "get_credentials"
    _version = "1.5"

    _schema = {
        'definitions': {
            'credential_key': {
                'properties': {
                    'access_key': {'description': '', 'type': ['string', 'null']},
                },
github allegroai / trains / trains / backend_api / services / v2_3 / auth.py View on Github external
    @schema_property('role')
    def role(self):
        return self._property_role

    @role.setter
    def role(self, value):
        if value is None:
            self._property_role = None
            return

        self.assert_isinstance(value, "role", six.string_types)
        self._property_role = value


class EditUserResponse(Response):
    """
    Response of auth.edit_user endpoint.

    :param updated: Number of users updated (0 or 1)
    :type updated: float
    :param fields: Updated fields names and values
    :type fields: dict
    """
    _service = "auth"
    _action = "edit_user"
    _version = "1.9"

    _schema = {
        'definitions': {},
        'properties': {
            'fields': {
github allegroai / trains / trains / backend_api / services / v2_1 / auth.py View on Github external
    @schema_property('access_key')
    def access_key(self):
        return self._property_access_key

    @access_key.setter
    def access_key(self, value):
        if value is None:
            self._property_access_key = None
            return
        
        self.assert_isinstance(value, "access_key", six.string_types)
        self._property_access_key = value


class RevokeCredentialsResponse(Response):
    """
    Response of auth.revoke_credentials endpoint.

    :param revoked: Number of credentials revoked
    :type revoked: int
    """
    _service = "auth"
    _action = "revoke_credentials"
    _version = "1.5"

    _schema = {
        'definitions': {},
        'properties': {
            'revoked': {
                'description': 'Number of credentials revoked',
                'enum': [0, 1],
github allegroai / trains / trains / backend_api / services / v2_1 / projects.py View on Github external
    @schema_property('force')
    def force(self):
        return self._property_force

    @force.setter
    def force(self, value):
        if value is None:
            self._property_force = None
            return
        
        self.assert_isinstance(value, "force", (bool,))
        self._property_force = value


class DeleteResponse(Response):
    """
    Response of projects.delete endpoint.

    :param deleted: Number of projects deleted (0 or 1)
    :type deleted: int
    :param disassociated_tasks: Number of tasks disassociated from the deleted
        project
    :type disassociated_tasks: int
    """
    _service = "projects"
    _action = "delete"
    _version = "1.5"

    _schema = {
        'definitions': {},
        'properties': {
github allegroai / trains / trains / backend_api / services / v2_1 / projects.py View on Github external
    @schema_property('default_output_destination')
    def default_output_destination(self):
        return self._property_default_output_destination

    @default_output_destination.setter
    def default_output_destination(self, value):
        if value is None:
            self._property_default_output_destination = None
            return
        
        self.assert_isinstance(value, "default_output_destination", six.string_types)
        self._property_default_output_destination = value


class UpdateResponse(Response):
    """
    Response of projects.update endpoint.

    :param updated: Number of projects updated (0 or 1)
    :type updated: int
    :param fields: Updated fields names and values
    :type fields: dict
    """
    _service = "projects"
    _action = "update"
    _version = "1.5"

    _schema = {
        'definitions': {},
        'properties': {
            'fields': {
github allegroai / trains / trains / backend_api / services / v2_1 / auth.py View on Github external
    @schema_property('user')
    def user(self):
        return self._property_user

    @user.setter
    def user(self, value):
        if value is None:
            self._property_user = None
            return
        
        self.assert_isinstance(value, "user", six.string_types)
        self._property_user = value


class DeleteUserResponse(Response):
    """
    Response of auth.delete_user endpoint.

    :param deleted: True if user was successfully deleted, False otherwise
    :type deleted: bool
    """
    _service = "auth"
    _action = "delete_user"
    _version = "1.5"

    _schema = {
        'definitions': {},
        'properties': {
            'deleted': {
                'description': 'True if user was successfully deleted, False otherwise',
                'type': ['boolean', 'null'],
github allegroai / trains / trains / backend_api / services / v2_1 / projects.py View on Github external
def _any_(self):
        return self._property__any_

    @_any_.setter
    def _any_(self, value):
        if value is None:
            self._property__any_ = None
            return
        if isinstance(value, dict):
            value = MultiFieldPatternData.from_dict(value)
        else:
            self.assert_isinstance(value, "_any_", MultiFieldPatternData)
        self._property__any_ = value


class GetAllResponse(Response):
    """
    Response of projects.get_all endpoint.

    :param projects: Projects list
    :type projects: Sequence[ProjectsGetAllResponseSingle]
    """
    _service = "projects"
    _action = "get_all"
    _version = "1.5"

    _schema = {
        'definitions': {
            'project_tags_enum': {'enum': ['archived', 'public', 'default'], 'type': 'string'},
            'projects_get_all_response_single': {
                'properties': {
                    'company': {
github allegroai / trains / trains / backend_api / services / v2_1 / auth.py View on Github external
    @schema_property('role')
    def role(self):
        return self._property_role

    @role.setter
    def role(self, value):
        if value is None:
            self._property_role = None
            return
        
        self.assert_isinstance(value, "role", six.string_types)
        self._property_role = value


class EditUserResponse(Response):
    """
    Response of auth.edit_user endpoint.

    :param updated: Number of users updated (0 or 1)
    :type updated: float
    :param fields: Updated fields names and values
    :type fields: dict
    """
    _service = "auth"
    _action = "edit_user"
    _version = "1.9"

    _schema = {
        'definitions': {},
        'properties': {
            'fields': {
github allegroai / trains / trains / backend_api / services / v2_3 / auth.py View on Github external
    @schema_property('access_key')
    def access_key(self):
        return self._property_access_key

    @access_key.setter
    def access_key(self, value):
        if value is None:
            self._property_access_key = None
            return

        self.assert_isinstance(value, "access_key", six.string_types)
        self._property_access_key = value


class RevokeCredentialsResponse(Response):
    """
    Response of auth.revoke_credentials endpoint.

    :param revoked: Number of credentials revoked
    :type revoked: int
    """
    _service = "auth"
    _action = "revoke_credentials"
    _version = "1.5"

    _schema = {
        'definitions': {},
        'properties': {
            'revoked': {
                'description': 'Number of credentials revoked',
                'enum': [0, 1],
github allegroai / trains / trains / backend_api / services / v2_1 / projects.py View on Github external
    @schema_property('default_output_destination')
    def default_output_destination(self):
        return self._property_default_output_destination

    @default_output_destination.setter
    def default_output_destination(self, value):
        if value is None:
            self._property_default_output_destination = None
            return
        
        self.assert_isinstance(value, "default_output_destination", six.string_types)
        self._property_default_output_destination = value


class CreateResponse(Response):
    """
    Response of projects.create endpoint.

    :param id: Project id
    :type id: str
    """
    _service = "projects"
    _action = "create"
    _version = "1.5"

    _schema = {
        'definitions': {},
        'properties': {
            'id': {'description': 'Project id', 'type': ['string', 'null']},
        },
        'type': 'object',