-
Notifications
You must be signed in to change notification settings - Fork 0
/
templates.go
131 lines (112 loc) · 5.52 KB
/
templates.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/StackGuardian/sg-sdk-go/core"
)
type CreateTemplateRevisionRequest struct {
// Current organization name of the user, e.g. my-sg-org
SgOrgid string `json:"-" url:"-"`
Body *Template `json:"-" url:"-"`
}
func (c *CreateTemplateRevisionRequest) UnmarshalJSON(data []byte) error {
body := new(Template)
if err := json.Unmarshal(data, &body); err != nil {
return err
}
c.Body = body
return nil
}
func (c *CreateTemplateRevisionRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(c.Body)
}
type DeleteTemplateRevisionRequest struct {
// Current organization name of the user, e.g. my-sg-org
SgOrgid string `json:"-" url:"-"`
}
type ListAllTemplatesRequest struct {
// Current organization name of the user, e.g. my-sg-org
SgOrgid string `json:"-" url:"-"`
// Pass 0 for private and 1 for public
IsPublic *string `json:"-" url:"IsPublic,omitempty"`
// Comma separated list of Organizations which own the template
OwnerOrgs *string `json:"-" url:"OwnerOrgs,omitempty"`
// Search using the name, tags or description of template
SearchQuery *string `json:"-" url:"SearchQuery,omitempty"`
// Parent Template Id to list all revisions
TemplateId *string `json:"-" url:"TemplateId,omitempty"`
}
type ReadSubscriptionRequest struct {
// Choose a type of template like IAC, IaC Group, Policy, Workflow Step to get subscriptions for
SubscriptionType ReadSubscriptionRequestSubscriptionType `json:"-" url:"subscriptionType"`
}
type ReadTemplateRevisionRequest struct {
// Current organization name of the user, e.g. my-sg-org
SgOrgid string `json:"-" url:"-"`
}
type PatchedTemplateUpdate struct {
// Current organization name of the user, e.g. my-sg-org
SgOrgid string `json:"-" url:"-"`
IsPublic *core.Optional[IsArchiveEnum] `json:"IsPublic,omitempty" url:"-"`
LongDescription *core.Optional[string] `json:"LongDescription,omitempty" url:"-"`
ShortDescription *core.Optional[string] `json:"ShortDescription,omitempty" url:"-"`
Deprecation *core.Optional[Deprecation] `json:"Deprecation,omitempty" url:"-"`
SharedOrgsList *core.Optional[[]string] `json:"SharedOrgsList,omitempty" url:"-"`
InputSchemas *core.Optional[[]*InputSchemas] `json:"InputSchemas,omitempty" url:"-"`
Templates *core.Optional[[]*Templates] `json:"Templates,omitempty" url:"-"`
Tags *core.Optional[[]string] `json:"Tags,omitempty" url:"-"`
GitHubComSync *core.Optional[map[string]interface{}] `json:"GitHubComSync,omitempty" url:"-"`
VcsTriggers *core.Optional[VcsTriggers] `json:"VCSTriggers,omitempty" url:"-"`
TerraformIntelligence *core.Optional[map[string]interface{}] `json:"TerraformIntelligence,omitempty" url:"-"`
DefaultSchema *core.Optional[string] `json:"DefaultSchema,omitempty" url:"-"`
RuntimeSource *core.Optional[RuntimeSource] `json:"RuntimeSource,omitempty" url:"-"`
}
type ListAllTemplatesRequestTemplateType string
const (
ListAllTemplatesRequestTemplateTypeIac ListAllTemplatesRequestTemplateType = "IAC"
ListAllTemplatesRequestTemplateTypeIacGroup ListAllTemplatesRequestTemplateType = "IAC_GROUP"
ListAllTemplatesRequestTemplateTypeIacPolicy ListAllTemplatesRequestTemplateType = "IAC_POLICY"
ListAllTemplatesRequestTemplateTypeWorkflowStep ListAllTemplatesRequestTemplateType = "WORKFLOW_STEP"
)
func NewListAllTemplatesRequestTemplateTypeFromString(s string) (ListAllTemplatesRequestTemplateType, error) {
switch s {
case "IAC":
return ListAllTemplatesRequestTemplateTypeIac, nil
case "IAC_GROUP":
return ListAllTemplatesRequestTemplateTypeIacGroup, nil
case "IAC_POLICY":
return ListAllTemplatesRequestTemplateTypeIacPolicy, nil
case "WORKFLOW_STEP":
return ListAllTemplatesRequestTemplateTypeWorkflowStep, nil
}
var t ListAllTemplatesRequestTemplateType
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (l ListAllTemplatesRequestTemplateType) Ptr() *ListAllTemplatesRequestTemplateType {
return &l
}
type ReadSubscriptionRequestSubscriptionType string
const (
ReadSubscriptionRequestSubscriptionTypeIacGroupSubscriptions ReadSubscriptionRequestSubscriptionType = "IACGroupSubscriptions"
ReadSubscriptionRequestSubscriptionTypeIacSubscriptions ReadSubscriptionRequestSubscriptionType = "IACSubscriptions"
ReadSubscriptionRequestSubscriptionTypePolicySubscriptions ReadSubscriptionRequestSubscriptionType = "PolicySubscriptions"
ReadSubscriptionRequestSubscriptionTypeWfStepSubscriptions ReadSubscriptionRequestSubscriptionType = "WfStepSubscriptions"
)
func NewReadSubscriptionRequestSubscriptionTypeFromString(s string) (ReadSubscriptionRequestSubscriptionType, error) {
switch s {
case "IACGroupSubscriptions":
return ReadSubscriptionRequestSubscriptionTypeIacGroupSubscriptions, nil
case "IACSubscriptions":
return ReadSubscriptionRequestSubscriptionTypeIacSubscriptions, nil
case "PolicySubscriptions":
return ReadSubscriptionRequestSubscriptionTypePolicySubscriptions, nil
case "WfStepSubscriptions":
return ReadSubscriptionRequestSubscriptionTypeWfStepSubscriptions, nil
}
var t ReadSubscriptionRequestSubscriptionType
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (r ReadSubscriptionRequestSubscriptionType) Ptr() *ReadSubscriptionRequestSubscriptionType {
return &r
}