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