Release / update-version (push) Has been cancelled
Release / build-frontend (push) Has been cancelled
Release / release (push) Has been cancelled
Release / sync-version-file (push) Has been cancelled
CI / shell (push) Canceled after 0s
CI / test (push) Canceled after 0s
CI / frontend (push) Canceled after 0s
CI / golangci-lint (push) Canceled after 0s
Security Scan / backend-security (push) Canceled after 0s
Security Scan / frontend-security (push) Canceled after 0s
33 lines
588 B
Go
33 lines
588 B
Go
package service
|
|
|
|
import "strings"
|
|
|
|
func optionalTrimmedStringPtr(raw string) *string {
|
|
trimmed := strings.TrimSpace(raw)
|
|
if trimmed == "" {
|
|
return nil
|
|
}
|
|
return &trimmed
|
|
}
|
|
|
|
func optionalStringValue(value *string) string {
|
|
if value == nil {
|
|
return ""
|
|
}
|
|
return strings.TrimSpace(*value)
|
|
}
|
|
|
|
func forwardResultBillingModel(requestedModel, upstreamModel string) string {
|
|
if trimmed := strings.TrimSpace(requestedModel); trimmed != "" {
|
|
return trimmed
|
|
}
|
|
return strings.TrimSpace(upstreamModel)
|
|
}
|
|
|
|
func optionalInt64Ptr(v int64) *int64 {
|
|
if v == 0 {
|
|
return nil
|
|
}
|
|
return &v
|
|
}
|