forked from integrations/terraform-provider-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil_v4.go
More file actions
52 lines (44 loc) · 1.15 KB
/
util_v4.go
File metadata and controls
52 lines (44 loc) · 1.15 KB
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
package github
import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/shurcooL/githubv4"
)
type PageInfo struct {
StartCursor githubv4.String
EndCursor githubv4.String
HasNextPage githubv4.Boolean
HasPreviousPage githubv4.Boolean
}
func expandNestedSet(m map[string]any, target string) []string {
res := make([]string, 0)
if v, ok := m[target]; ok {
vL := v.(*schema.Set).List()
for _, v := range vL {
res = append(res, v.(string))
}
}
return res
}
func githubv4StringSliceEmpty(ss []string) []githubv4.String {
vGh4 := make([]githubv4.String, 0)
for _, s := range ss {
vGh4 = append(vGh4, githubv4.String(s))
}
return vGh4
}
func githubv4IDSlice(ss []string) []githubv4.ID {
var vGh4 []githubv4.ID
for _, s := range ss {
vGh4 = append(vGh4, githubv4.ID(s))
}
return vGh4
}
func githubv4IDSliceEmpty(ss []string) []githubv4.ID {
vGh4 := make([]githubv4.ID, 0)
for _, s := range ss {
vGh4 = append(vGh4, githubv4.ID(s))
}
return vGh4
}
func githubv4NewStringSlice(v []githubv4.String) *[]githubv4.String { return &v }
func githubv4NewIDSlice(v []githubv4.ID) *[]githubv4.ID { return &v }