-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
77 lines (70 loc) · 2.83 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
// Code generated by typeshare 1.9.2. DO NOT EDIT.
package onepassword
type ItemCategory string
const (
ItemCategoryLogin ItemCategory = "Login"
ItemCategorySecureNote ItemCategory = "SecureNote"
ItemCategoryCreditCard ItemCategory = "CreditCard"
ItemCategoryCryptoWallet ItemCategory = "CryptoWallet"
ItemCategoryIdentity ItemCategory = "Identity"
ItemCategoryPassword ItemCategory = "Password"
ItemCategoryDocument ItemCategory = "Document"
ItemCategoryApiCredentials ItemCategory = "ApiCredentials"
ItemCategoryBankAccount ItemCategory = "BankAccount"
ItemCategoryDatabase ItemCategory = "Database"
ItemCategoryDriverLicense ItemCategory = "DriverLicense"
ItemCategoryEmail ItemCategory = "Email"
ItemCategoryMedicalRecord ItemCategory = "MedicalRecord"
ItemCategoryMembership ItemCategory = "Membership"
ItemCategoryOutdoorLicense ItemCategory = "OutdoorLicense"
ItemCategoryPassport ItemCategory = "Passport"
ItemCategoryRewards ItemCategory = "Rewards"
ItemCategoryRouter ItemCategory = "Router"
ItemCategoryServer ItemCategory = "Server"
ItemCategorySshKey ItemCategory = "SshKey"
ItemCategorySocialSecurityNumber ItemCategory = "SocialSecurityNumber"
ItemCategorySoftwareLicense ItemCategory = "SoftwareLicense"
ItemCategoryPerson ItemCategory = "Person"
ItemCategoryUnsupported ItemCategory = "Unsupported"
)
type ItemFieldType string
const (
ItemFieldTypeText ItemFieldType = "Text"
ItemFieldTypeConcealed ItemFieldType = "Concealed"
ItemFieldTypeUnsupported ItemFieldType = "Unsupported"
)
// Stores a field's title and value.
type ItemField struct {
// The field's ID
ID string `json:"id"`
// The field's title
Title string `json:"title"`
// The ID of the section containing the field. Designated fields such as usernames and passwords don't need to specify a section.
SectionID *string `json:"section_id,omitempty"`
// The type of value stored in the field
FieldType ItemFieldType `json:"field_type"`
// The string representation of the field's value
Value string `json:"value"`
}
// A section groups together multiple fields in an item.
type ItemSection struct {
// The section's ID
ID string `json:"id"`
// The section's name
Title string `json:"title"`
}
// Represents a 1Password item.
type Item struct {
// The item's unique ID
ID string `json:"id"`
// The item's title
Title string `json:"title"`
// The item's category
Category ItemCategory `json:"category"`
// The ID of the vault where the item is saved
VaultID string `json:"vault_id"`
// The item's fields
Fields []ItemField `json:"fields"`
// The item's sections
Sections []ItemSection `json:"sections"`
}