Skip to content

Commit 33e7aed

Browse files
feat(api): manual updates (#23)
1 parent fd57922 commit 33e7aed

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

aliases.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ type Error = apierror.Error
1515
// that the automation should be triggered after the dev container has started.
1616
//
1717
// This is an alias to an internal type.
18-
type AutomationTrigge = shared.AutomationTrigge
18+
type AutomationTrigger = shared.AutomationTrigger
1919

2020
// An AutomationTrigger represents a trigger for an automation action. The
2121
// `post_environment_start` field indicates that the automation should be triggered
2222
// after the environment has started. The `post_devcontainer_start` field indicates
2323
// that the automation should be triggered after the dev container has started.
2424
//
2525
// This is an alias to an internal type.
26-
type AutomationTriggeParam = shared.AutomationTriggeParam
26+
type AutomationTriggerParam = shared.AutomationTriggerParam
2727

2828
// This is an alias to an internal type.
2929
type EnvironmentClass = shared.EnvironmentClass

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Shared Params Types
22

3-
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#AutomationTriggeParam">AutomationTriggeParam</a>
3+
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#AutomationTriggerParam">AutomationTriggerParam</a>
44
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#EnvironmentClassParam">EnvironmentClassParam</a>
55
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#FieldValueParam">FieldValueParam</a>
66
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#OrganizationRole">OrganizationRole</a>
@@ -13,7 +13,7 @@
1313

1414
# Shared Response Types
1515

16-
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#AutomationTrigge">AutomationTrigge</a>
16+
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#AutomationTrigger">AutomationTrigger</a>
1717
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#EnvironmentClass">EnvironmentClass</a>
1818
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#FieldValue">FieldValue</a>
1919
- <a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared">shared</a>.<a href="https://pkg.go.dev/github.com/gitpod-io/gitpod-sdk-go/shared#OrganizationRole">OrganizationRole</a>

environmentautomationservice.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ type ServiceMetadata struct {
244244
// identify the service in user interactions (e.g. the CLI).
245245
Reference string `json:"reference"`
246246
// triggered_by is a list of trigger that start the service.
247-
TriggeredBy []shared.AutomationTrigge `json:"triggeredBy"`
248-
JSON serviceMetadataJSON `json:"-"`
247+
TriggeredBy []shared.AutomationTrigger `json:"triggeredBy"`
248+
JSON serviceMetadataJSON `json:"-"`
249249
}
250250

251251
// serviceMetadataJSON contains the JSON metadata for the struct [ServiceMetadata]
@@ -372,7 +372,7 @@ type ServiceMetadataParam struct {
372372
// identify the service in user interactions (e.g. the CLI).
373373
Reference param.Field[string] `json:"reference"`
374374
// triggered_by is a list of trigger that start the service.
375-
TriggeredBy param.Field[[]shared.AutomationTriggeParam] `json:"triggeredBy"`
375+
TriggeredBy param.Field[[]shared.AutomationTriggerParam] `json:"triggeredBy"`
376376
}
377377

378378
func (r ServiceMetadataParam) MarshalJSON() (data []byte, err error) {
@@ -665,7 +665,7 @@ func (r EnvironmentAutomationServiceUpdateParamsMetadata) MarshalJSON() (data []
665665
}
666666

667667
type EnvironmentAutomationServiceUpdateParamsMetadataTriggeredBy struct {
668-
Trigger param.Field[[]shared.AutomationTriggeParam] `json:"trigger"`
668+
Trigger param.Field[[]shared.AutomationTriggerParam] `json:"trigger"`
669669
}
670670

671671
func (r EnvironmentAutomationServiceUpdateParamsMetadataTriggeredBy) MarshalJSON() (data []byte, err error) {

environmentautomationservice_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestEnvironmentAutomationServiceNewWithOptionalParams(t *testing.T) {
3939
Description: gitpod.F("description"),
4040
Name: gitpod.F("x"),
4141
Reference: gitpod.F("reference"),
42-
TriggeredBy: gitpod.F([]shared.AutomationTriggeParam{{
42+
TriggeredBy: gitpod.F([]shared.AutomationTriggerParam{{
4343
Manual: gitpod.F(true),
4444
PostDevcontainerStart: gitpod.F(true),
4545
PostEnvironmentStart: gitpod.F(true),
@@ -115,7 +115,7 @@ func TestEnvironmentAutomationServiceUpdateWithOptionalParams(t *testing.T) {
115115
Description: gitpod.F("description"),
116116
Name: gitpod.F("x"),
117117
TriggeredBy: gitpod.F(gitpod.EnvironmentAutomationServiceUpdateParamsMetadataTriggeredBy{
118-
Trigger: gitpod.F([]shared.AutomationTriggeParam{{
118+
Trigger: gitpod.F([]shared.AutomationTriggerParam{{
119119
Manual: gitpod.F(true),
120120
PostDevcontainerStart: gitpod.F(true),
121121
PostEnvironmentStart: gitpod.F(true),

environmentautomationtask.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (r EnvironmentAutomationTaskUpdateParamsMetadata) MarshalJSON() (data []byt
210210
}
211211

212212
type EnvironmentAutomationTaskUpdateParamsMetadataTriggeredBy struct {
213-
Trigger param.Field[[]shared.AutomationTriggeParam] `json:"trigger"`
213+
Trigger param.Field[[]shared.AutomationTriggerParam] `json:"trigger"`
214214
}
215215

216216
func (r EnvironmentAutomationTaskUpdateParamsMetadataTriggeredBy) MarshalJSON() (data []byte, err error) {

environmentautomationtask_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestEnvironmentAutomationTaskNewWithOptionalParams(t *testing.T) {
4040
Description: gitpod.F("description"),
4141
Name: gitpod.F("x"),
4242
Reference: gitpod.F("reference"),
43-
TriggeredBy: gitpod.F([]shared.AutomationTriggeParam{{
43+
TriggeredBy: gitpod.F([]shared.AutomationTriggerParam{{
4444
Manual: gitpod.F(true),
4545
PostDevcontainerStart: gitpod.F(true),
4646
PostEnvironmentStart: gitpod.F(true),
@@ -110,7 +110,7 @@ func TestEnvironmentAutomationTaskUpdateWithOptionalParams(t *testing.T) {
110110
Description: gitpod.F("description"),
111111
Name: gitpod.F("x"),
112112
TriggeredBy: gitpod.F(gitpod.EnvironmentAutomationTaskUpdateParamsMetadataTriggeredBy{
113-
Trigger: gitpod.F([]shared.AutomationTriggeParam{{
113+
Trigger: gitpod.F([]shared.AutomationTriggerParam{{
114114
Manual: gitpod.F(true),
115115
PostDevcontainerStart: gitpod.F(true),
116116
PostEnvironmentStart: gitpod.F(true),

shared/shared.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,42 @@ import (
1313
// `post_environment_start` field indicates that the automation should be triggered
1414
// after the environment has started. The `post_devcontainer_start` field indicates
1515
// that the automation should be triggered after the dev container has started.
16-
type AutomationTrigge struct {
17-
Manual bool `json:"manual"`
18-
PostDevcontainerStart bool `json:"postDevcontainerStart"`
19-
PostEnvironmentStart bool `json:"postEnvironmentStart"`
20-
JSON automationTriggeJSON `json:"-"`
16+
type AutomationTrigger struct {
17+
Manual bool `json:"manual"`
18+
PostDevcontainerStart bool `json:"postDevcontainerStart"`
19+
PostEnvironmentStart bool `json:"postEnvironmentStart"`
20+
JSON automationTriggerJSON `json:"-"`
2121
}
2222

23-
// automationTriggeJSON contains the JSON metadata for the struct
24-
// [AutomationTrigge]
25-
type automationTriggeJSON struct {
23+
// automationTriggerJSON contains the JSON metadata for the struct
24+
// [AutomationTrigger]
25+
type automationTriggerJSON struct {
2626
Manual apijson.Field
2727
PostDevcontainerStart apijson.Field
2828
PostEnvironmentStart apijson.Field
2929
raw string
3030
ExtraFields map[string]apijson.Field
3131
}
3232

33-
func (r *AutomationTrigge) UnmarshalJSON(data []byte) (err error) {
33+
func (r *AutomationTrigger) UnmarshalJSON(data []byte) (err error) {
3434
return apijson.UnmarshalRoot(data, r)
3535
}
3636

37-
func (r automationTriggeJSON) RawJSON() string {
37+
func (r automationTriggerJSON) RawJSON() string {
3838
return r.raw
3939
}
4040

4141
// An AutomationTrigger represents a trigger for an automation action. The
4242
// `post_environment_start` field indicates that the automation should be triggered
4343
// after the environment has started. The `post_devcontainer_start` field indicates
4444
// that the automation should be triggered after the dev container has started.
45-
type AutomationTriggeParam struct {
45+
type AutomationTriggerParam struct {
4646
Manual param.Field[bool] `json:"manual"`
4747
PostDevcontainerStart param.Field[bool] `json:"postDevcontainerStart"`
4848
PostEnvironmentStart param.Field[bool] `json:"postEnvironmentStart"`
4949
}
5050

51-
func (r AutomationTriggeParam) MarshalJSON() (data []byte, err error) {
51+
func (r AutomationTriggerParam) MarshalJSON() (data []byte, err error) {
5252
return apijson.MarshalRoot(r)
5353
}
5454

@@ -924,8 +924,8 @@ type TaskMetadata struct {
924924
// the task in user interactions (e.g. the CLI).
925925
Reference string `json:"reference"`
926926
// triggered_by is a list of trigger that start the task.
927-
TriggeredBy []AutomationTrigge `json:"triggeredBy"`
928-
JSON taskMetadataJSON `json:"-"`
927+
TriggeredBy []AutomationTrigger `json:"triggeredBy"`
928+
JSON taskMetadataJSON `json:"-"`
929929
}
930930

931931
// taskMetadataJSON contains the JSON metadata for the struct [TaskMetadata]
@@ -1052,7 +1052,7 @@ type TaskMetadataParam struct {
10521052
// the task in user interactions (e.g. the CLI).
10531053
Reference param.Field[string] `json:"reference"`
10541054
// triggered_by is a list of trigger that start the task.
1055-
TriggeredBy param.Field[[]AutomationTriggeParam] `json:"triggeredBy"`
1055+
TriggeredBy param.Field[[]AutomationTriggerParam] `json:"triggeredBy"`
10561056
}
10571057

10581058
func (r TaskMetadataParam) MarshalJSON() (data []byte, err error) {

0 commit comments

Comments
 (0)