forked from 1Password/onepassword-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvaults.go
33 lines (27 loc) · 823 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
// 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 VaultsSource struct {
innerClient internal.InnerClient
}
func NewVaultsSource(inner internal.InnerClient) *VaultsSource {
return &VaultsSource{innerClient: inner}
}
// List all vaults
func (v VaultsSource) ListAll(ctx context.Context) (*Iterator[VaultOverview], error) {
resultString, err := clientInvoke(ctx, v.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
}