forked from PinataCloud/pinata-go-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
173 lines (146 loc) · 4.3 KB
/
types.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
package main
type UploadResponse struct {
Data struct {
Id string `json:"id"`
Name string `json:"name"`
Cid string `json:"cid"`
Size int `json:"size"`
NumberOfFiles int `json:"number_of_files"`
MimeType string `json:"mime_type"`
CreatedAt string `json:"created_at"`
GroupId string `json:"group_id,omitempty"`
IsDuplicate bool `json:"is_duplicate,omitempty"`
} `json:"data"`
}
type Options struct {
GroupId string `json:"group_id"`
}
type Metadata struct {
Name string `json:"name"`
}
type File struct {
Id string `json:"id"`
Name string `json:"name"`
Cid string `json:"cid"`
Size int `json:"size"`
NumberOfFiles int `json:"number_of_files"`
MimeType string `json:"mime_type"`
KeyValues map[string]interface{} `json:"keyvalues"`
GroupId *string `json:"group_id,omitempty"`
CreatedAt string `json:"created_at"`
}
type FileUpdateBody struct {
Name string `json:"name"`
}
type GetFileResponse struct {
Data File `json:"data"`
}
type ListFilesData struct {
Files []File `json:"files"`
NextPageToken string `json:"next_page_token"`
}
type ListResponse struct {
Data ListFilesData `json:"data"`
}
type GroupResponseItem struct {
Id string `json:"id"`
IsPublic bool `json:"is_public"`
Name string `json:"name"`
CreatedAt string `json:"created_at"`
}
type GroupListResponse struct {
Data struct {
Groups []GroupResponseItem `json:"groups"`
NextPageToken string `json:"next_page_token"`
} `json:"data"`
}
type GroupCreateResponse struct {
Data struct {
GroupResponseItem
} `json:"data"`
}
type GroupCreateBody struct {
Name string `json:"name"`
IsPublic bool `json:"is_public"`
}
type GetSignedURLBody struct {
URL string `json:"url"`
Expires int `json:"expires"`
Date int64 `json:"date"`
Method string `json:"method"`
}
type GetSignedURLResponse struct {
Data string `json:"data"`
}
type GetGatewayItem struct {
Domain string `json:"domain"`
}
type GetGatewaysResponse struct {
Data struct {
Rows []GetGatewayItem
} `json:"data"`
}
type GetSwapHistoryResponse struct {
Data []struct {
MappedCid string `json:"mapped_cid"`
CreatedAt string `json:"created_at"`
} `json:"data"`
}
type AddSwapBody struct {
SwapCid string `json:"swap_cid"`
}
type AddSwapResponse struct {
Data struct {
MappedCid string `json:"mapped_cid"`
CreatedAt string `json:"created_at"`
} `json:"data"`
}
type CreateKeyResponse struct {
JWT string `json:"JWT"`
PinataAPIKey string `json:"pinata_api_key"`
PinataAPISecret string `json:"pinata_api_secret"`
}
type CreatKeyBody struct {
KeyName string `json:"keyName"`
Permissions Permissions `json:"permissions"`
MaxUses int `json:"maxUses,omitempty"`
}
type Permissions struct {
Admin bool `json:"admin,omitempty"`
Endpoints Endpoints `json:"endpoints,omitempty"`
}
type Endpoints struct {
Data DataEndpoints `json:"data,omitempty"`
Pinning PinningEndpoints `json:"pinning,omitempty"`
}
type DataEndpoints struct {
PinList bool `json:"pinList,omitempty"`
UserPinnedDataTotal bool `json:"userPinnedDataTotal,omitempty"`
}
type PinningEndpoints struct {
HashMetadata bool `json:"hashMetadata,omitempty"`
HashPinPolicy bool `json:"hashPinPolicy,omitempty"`
PinByHash bool `json:"pinByHash,omitempty"`
PinFileToIPFS bool `json:"pinFileToIPFS,omitempty"`
PinJSONToIPFS bool `json:"pinJSONToIPFS,omitempty"`
PinJobs bool `json:"pinJobs,omitempty"`
Unpin bool `json:"unpin,omitempty"`
UserPinPolicy bool `json:"userPinPolicy,omitempty"`
}
type KeyListResponse struct {
Keys []KeyItem `json:"keys"`
Count int `json:"count"`
}
type KeyItem struct {
ID string `json:"id"`
Name string `json:"name"`
Key string `json:"key"`
Secret string `json:"secret"`
MaxUses int `json:"max_uses"`
Uses int `json:"uses"`
UserID string `json:"user_id"`
Scopes Permissions `json:"scopes"`
Revoked bool `json:"revoked"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}