/
ssh_key.go
50 lines (42 loc) · 1.46 KB
/
ssh_key.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package schema
import "time"
// SSHKey defines the schema of a SSH key.
type SSHKey struct {
ID int64 `json:"id"`
Name string `json:"name"`
Fingerprint string `json:"fingerprint"`
PublicKey string `json:"public_key"`
Labels map[string]string `json:"labels"`
Created time.Time `json:"created"`
}
// SSHKeyCreateRequest defines the schema of the request
// to create a SSH key.
type SSHKeyCreateRequest struct {
Name string `json:"name"`
PublicKey string `json:"public_key"`
Labels *map[string]string `json:"labels,omitempty"`
}
// SSHKeyCreateResponse defines the schema of the response
// when creating a SSH key.
type SSHKeyCreateResponse struct {
SSHKey SSHKey `json:"ssh_key"`
}
// SSHKeyListResponse defines the schema of the response
// when listing SSH keys.
type SSHKeyListResponse struct {
SSHKeys []SSHKey `json:"ssh_keys"`
}
// SSHKeyGetResponse defines the schema of the response
// when retrieving a single SSH key.
type SSHKeyGetResponse struct {
SSHKey SSHKey `json:"ssh_key"`
}
// SSHKeyUpdateRequest defines the schema of the request to update a SSH key.
type SSHKeyUpdateRequest struct {
Name string `json:"name,omitempty"`
Labels *map[string]string `json:"labels,omitempty"`
}
// SSHKeyUpdateResponse defines the schema of the response when updating a SSH key.
type SSHKeyUpdateResponse struct {
SSHKey SSHKey `json:"ssh_key"`
}