Skip to content

Commit

Permalink
go: Add svix.NullableInt64 (#1542)
Browse files Browse the repository at this point in the history
## Motivation

Without this, it is impossible to create a `NullableInt64` for things
like the payload retention period.

## Solution

Add a "constructor" function like we have for `NullableInt32`,
`NullableBool`, `NullableString`.
  • Loading branch information
svix-jplatte authored Dec 5, 2024
2 parents 633015f + 04fd2e8 commit f579832
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions go/svix.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,27 @@ var defaultHTTPClient = &http.Client{
func String(s string) *string {
return &s
}

func NullableString(s *string) *openapi.NullableString {
return openapi.NewNullableString(s)
}

func StaticNullableString(s string) openapi.NullableString {
return *NullableString(String(s))
}

func NullableInt32(num *int32) *openapi.NullableInt32 {
return openapi.NewNullableInt32(num)
}

func NullableInt64(num *int64) *openapi.NullableInt64 {
return openapi.NewNullableInt64(num)
}

func Int32(i int32) *int32 {
return &i
}

func NullableBool(b *bool) *openapi.NullableBool {
return openapi.NewNullableBool(b)
}
Expand Down

0 comments on commit f579832

Please sign in to comment.