Skip to content

Commit

Permalink
MissingPackageResult field in CheckPackageVersionUpdateInput made Nul…
Browse files Browse the repository at this point in the history
…lable
  • Loading branch information
davidbloss committed Oct 22, 2024
1 parent 7833c1d commit 0647d86
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 40 deletions.
3 changes: 3 additions & 0 deletions .changes/unreleased/Bugfix-20241022-093210.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Bugfix
body: 'BREAKING CHANGE: CheckPackageVersionUpdateInput changed to allow MissingPackageResult to be nullable'
time: 2024-10-22T09:32:10.794966-05:00
68 changes: 34 additions & 34 deletions input.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion new_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NullableString(value *string) *Nullable[string] {
return nil
}
if *value == "" {
return NewNull()
return NewNull[string]()
}
return NewNullableFrom(*value)
}
2 changes: 1 addition & 1 deletion scalar.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func IsID(value string) bool {

// NullableConstraint defines what types can be nullable - keep separated using the union operator (pipe)
type NullableConstraint interface {
string
~string
}

// Nullable can be used to unset a value using an OpsLevel input struct type, should always be instantiated using a constructor.
Expand Down
8 changes: 4 additions & 4 deletions service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ func TestUpdateService(t *testing.T) {
Input: ol.ServiceUpdateInputV2{
Parent: ol.NewIdentifier(),
Id: ol.NewID("123456789"),
Description: ol.NewNull(),
Framework: ol.NewNull(),
TierAlias: ol.NewNull(),
LifecycleAlias: ol.NewNull(),
Description: ol.NewNull[string](),
Framework: ol.NewNull[string](),
TierAlias: ol.NewNull[string](),
LifecycleAlias: ol.NewNull[string](),
},
},
{
Expand Down

0 comments on commit 0647d86

Please sign in to comment.