-
Notifications
You must be signed in to change notification settings - Fork 7
/
ListSharedReposDetails.go
35 lines (30 loc) · 1.1 KB
/
ListSharedReposDetails.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
package domains
import (
golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
)
type ListSharedReposOpts struct {
// Image repository name.
Name string `q:"name,omitempty"`
// self: images shared by you.
// thirdparty: images shared with you by others.
Center string `q:"center,omitempty"`
// Number of returned records. Ensure that the offset and limit parameters are used together.
Limit int `q:"limit,omitempty"`
// Start index. Ensure that the offset and limit parameters are used together.
Offset int `q:"offset,omitempty"`
}
func ListSharedReposDetails(client *golangsdk.ServiceClient, opts ListSharedReposOpts) ([]AccessDomain, error) {
url, err := golangsdk.NewURLBuilder().WithEndpoints("manage", "shared-repositories").WithQueryParams(&opts).Build()
if err != nil {
return nil, err
}
// GET /v2/manage/shared-repositories
raw, err := client.Get(client.ServiceURL(url.String()), nil, nil)
if err != nil {
return nil, err
}
var res []AccessDomain
err = extract.IntoSlicePtr(raw.Body, &res, "")
return res, err
}