Skip to content

Commit

Permalink
Merge pull request #79 from gfleury/pr-25
Browse files Browse the repository at this point in the history
Pr 25
  • Loading branch information
gfleury authored Aug 30, 2023
2 parents eb18f6f + 8c5c25a commit 7336cc1
Show file tree
Hide file tree
Showing 3 changed files with 377 additions and 21 deletions.
17 changes: 17 additions & 0 deletions api_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,23 @@ func (p PermissionRepository) String() string {
return string(p)
}

type AccessTokenResponse struct {
ID string `json:"id"`
CreatedDate int64 `json:"createdDate"`
LastAuthenticated int64 `json:"lastAuthenticated"`
Name string `json:"name"`
Permissions []string `json:"permissions"`
User User `json:"user"`
Token string `json:"token"`
}

// GetAccessTokenResponse cast AccessTokenResponse into structure
func GetAccessTokenResponse(r *APIResponse) (AccessTokenResponse, error) {
var m AccessTokenResponse
err := mapstructure.Decode(r.Values, &m)
return m, err
}

func (k *SSHKey) String() string {
parts := make([]string, 1, 2)
parts[0] = strings.TrimSpace(k.Text)
Expand Down
Loading

0 comments on commit 7336cc1

Please sign in to comment.