1// Package publicapi is an internal package containing code generated from the 2// Exoscale API OpenAPI specs, as well as helpers and transition types exposed 3// in the public-facing package. 4package publicapi 5 6//go:generate oapi-codegen -generate types,client -package publicapi -o public-api.gen.go ../../../public-api.json 7 8// OptionalString returns the dereferenced string value of v if not nil, otherwise an empty string. 9func OptionalString(v *string) string { 10 if v != nil { 11 return *v 12 } 13 14 return "" 15} 16 17// OptionalInt64 returns the dereferenced int64 value of v if not nil, otherwise 0. 18func OptionalInt64(v *int64) int64 { 19 if v != nil { 20 return *v 21 } 22 23 return 0 24} 25 26// OptionalBool returns the dereferenced bool value of v if not nil, otherwise false. 27func OptionalBool(v *bool) bool { 28 if v != nil { 29 return *v 30 } 31 32 return false 33} 34