-
Notifications
You must be signed in to change notification settings - Fork 8
/
vaults.go
38 lines (31 loc) · 912 Bytes
/
vaults.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
// Code generated by op-codegen - DO NOT EDIT
package onepassword
import (
"context"
"encoding/json"
"github.com/1password/onepassword-sdk-go/internal"
)
// The Vaults API holds all the operations the SDK client can perform on 1Password vaults.
type VaultsAPI interface {
// List all vaults
ListAll(ctx context.Context) (*Iterator[VaultOverview], error)
}
type VaultsSource struct {
internal.InnerClient
}
func NewVaultsSource(inner internal.InnerClient) *VaultsSource {
return &VaultsSource{inner}
}
// List all vaults
func (s VaultsSource) ListAll(ctx context.Context) (*Iterator[VaultOverview], error) {
resultString, err := clientInvoke(ctx, s.InnerClient, "VaultsListAll", map[string]interface{}{})
if err != nil {
return nil, err
}
var result []VaultOverview
err = json.Unmarshal([]byte(*resultString), &result)
if err != nil {
return nil, err
}
return NewIterator(result), nil
}