Skip to content

Commit e1f9c00

Browse files
committed
Make State a required field per response schema
1 parent 5e725fb commit e1f9c00

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

github/github-accessors.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/secret_scanning_custom_patterns.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type SecretScanningCustomPattern struct {
2929

3030
// State is the publish state of the pattern. Possible values are:
3131
// "published" or "unpublished".
32-
State *string `json:"state,omitempty"`
32+
State string `json:"state"`
3333

3434
// PushProtectionEnabled reports whether push protection is enabled for
3535
// this custom pattern.

github/secret_scanning_custom_patterns_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestSecretScanningService_ListCustomPatternsForRepo(t *testing.T) {
6464
Name: "Custom pattern",
6565
Pattern: "[A-Z]{2}-[0-9]{4}",
6666
Slug: "custom-pattern",
67-
State: Ptr("published"),
67+
State: "published",
6868
PushProtectionEnabled: true,
6969
StartDelimiter: Ptr(`\b`),
7070
EndDelimiter: Ptr(`\b`),
@@ -135,7 +135,7 @@ func TestSecretScanningService_CreateCustomPatternsForRepo(t *testing.T) {
135135
Name: "Custom pattern",
136136
Pattern: "[A-Z]{2}-[0-9]{4}",
137137
Slug: "custom-pattern",
138-
State: Ptr("published"),
138+
State: "published",
139139
PushProtectionEnabled: false,
140140
},
141141
},
@@ -191,7 +191,7 @@ func TestSecretScanningService_UpdateCustomPatternForRepo(t *testing.T) {
191191
Name: "Custom pattern",
192192
Pattern: "[A-Z]{3}-[0-9]{4}",
193193
Slug: "custom-pattern",
194-
State: Ptr("published"),
194+
State: "published",
195195
PushProtectionEnabled: false,
196196
CustomPatternVersion: Ptr("v2"),
197197
}

0 commit comments

Comments
 (0)