tensorbay.client.struct

User, Commit, Tag, Branch and Draft classes.

User defines the basic concept of a user with an action.

Commit defines the structure of a commit.

Tag defines the structure of a commit tag.

Branch defines the structure of a branch.

Draft defines the structure of a draft.

class tensorbay.client.struct.TeamInfo(name: str, *, email: Optional[str] = None, description: str = '')[source]

Bases: tensorbay.utility.name.NameMixin

This class defines the basic concept of a TensorBay team.

Parameters
  • name – The name of the team.

  • email – The email of the team.

  • description – The description of the team.

classmethod loads(contents: Dict[str, Any]) tensorbay.client.struct._T[source]

Loads a TeamInfo instance from the given contents.

Parameters

contents

A dict containing all the information of the commit:

{
    "name": <str>
    "email": <str>
    "description": <str>
}

Returns

A TeamInfo instance containing all the information in the given contents.

dumps() Dict[str, Any][source]

Dumps all the information into a dict.

Returns

A dict containing all the information of the team:

{
        "name": <str>
        "email": <str>
        "description": <str>
}

class tensorbay.client.struct.UserInfo(name: str, *, email: Optional[str] = None, mobile: Optional[str] = None, description: str = '', team: Optional[tensorbay.client.struct.TeamInfo] = None)[source]

Bases: tensorbay.utility.name.NameMixin

This class defines the basic concept of a TensorBay user.

Parameters
  • name – The nickname of the user.

  • email – The email of the user.

  • mobile – The mobile of the user.

  • description – The description of the user.

  • team – The team of the user.

classmethod loads(contents: Dict[str, Any]) tensorbay.client.struct._T[source]

Loads a UserInfo instance from the given contents.

Parameters

contents

A dict containing all the information of the commit:

{
    "name": <str>
    "email": <str>
    "mobile": <str>
    "description": <str>
    "team": {  <dict>
        "name": <str>
        "email": <str>
        "description": <str>
    }
}

Returns

A UserInfo instance containing all the information in the given contents.

dumps() Dict[str, Any][source]

Dumps all the information into a dict.

Returns

A dict containing all the information of the user:

{
        "name": <str>
        "email": <str>
        "mobile": <str>
        "description": <str>
        "team": {  <dict>
            "name": <str>
            "email": <str>
            "description": <str>
        }
}

class tensorbay.client.struct.User(name: str, date: int)[source]

Bases: tensorbay.utility.attr.AttrsMixin, tensorbay.utility.repr.ReprMixin

This class defines the basic concept of a user with an action.

Parameters
  • name – The name of the user.

  • date – The date of the user action.

classmethod loads(contents: Dict[str, Any]) tensorbay.client.struct._T[source]

Loads a User instance from the given contents.

Parameters

contents

A dict containing all the information of the commit:

{
    "name": <str>
    "date": <int>
}

Returns

A User instance containing all the information in the given contents.

dumps() Dict[str, Any][source]

Dumps all the user information into a dict.

Returns

A dict containing all the information of the user:

{
    "name": <str>
    "date": <int>
}

class tensorbay.client.struct.Commit(commit_id: str, parent_commit_id: Optional[str], title: str, description: str, committer: tensorbay.client.struct.User)[source]

Bases: tensorbay.utility.attr.AttrsMixin, tensorbay.utility.repr.ReprMixin

This class defines the structure of a commit.

Parameters
  • commit_id – The commit id.

  • parent_commit_id – The parent commit id.

  • title – The commit title.

  • description – The commit description.

  • committer – The commit user.

classmethod loads(contents: Dict[str, Any]) tensorbay.client.struct._T[source]

Loads a Commit instance for the given contents.

Parameters

contents

A dict containing all the information of the commit:

{
    "commitId": <str>
    "parentCommitId": <str> or None
    "title": <str>
    "description": <str>
    "committer": {
        "name": <str>
        "date": <int>
    }
}

Returns

A Commit instance containing all the information in the given contents.

dumps() Dict[str, Any][source]

Dumps all the commit information into a dict.

Returns

A dict containing all the information of the commit:

{
    "commitId": <str>
    "parentCommitId": <str> or None
    "title": <str>
    "description": <str>
    "committer": {
        "name": <str>
        "date": <int>
    }
}

class tensorbay.client.struct.Tag(name: str, commit_id: str, parent_commit_id: Optional[str], title: str, description: str, committer: tensorbay.client.struct.User)[source]

Bases: tensorbay.client.struct._NamedCommit

This class defines the structure of the tag of a commit.

Parameters
  • name – The name of the tag.

  • commit_id – The commit id.

  • parent_commit_id – The parent commit id.

  • title – The commit title.

  • description – The commit description.

  • committer – The commit user.

class tensorbay.client.struct.Branch(name: str, commit_id: str, parent_commit_id: Optional[str], title: str, description: str, committer: tensorbay.client.struct.User)[source]

Bases: tensorbay.client.struct._NamedCommit

This class defines the structure of a branch.

Parameters
  • name – The name of the branch.

  • commit_id – The commit id.

  • parent_commit_id – The parent commit id.

  • title – The commit title.

  • description – The commit description.

  • committer – The commit user.

class tensorbay.client.struct.Draft(number: int, title: str, branch_name: str, status: str, description: str = '')[source]

Bases: tensorbay.utility.attr.AttrsMixin, tensorbay.utility.repr.ReprMixin

This class defines the basic structure of a draft.

Parameters
  • number – The number of the draft.

  • title – The title of the draft.

  • branch_name – The branch name.

  • status – The status of the draft.

  • description – The draft description.

classmethod loads(contents: Dict[str, Any]) tensorbay.client.struct._T[source]

Loads a Draft instance from the given contents.

Parameters

contents

A dict containing all the information of the draft:

{
    "number": <int>
    "title": <str>
    "branchName": <str>
    "status": "OPEN", "CLOSED" or "COMMITTED"
    "description": <str>
}

Returns

A Draft instance containing all the information in the given contents.

dumps() Dict[str, Any][source]

Dumps all the information of the draft into a dict.

Returns

A dict containing all the information of the draft:

{
    "number": <int>
    "title": <str>
    "branchName": <str>
    "status": "OPEN", "CLOSED" or "COMMITTED"
    "description": <str>
}