Skip to content

Commit

Permalink
thunderpay-sdk-go: utils[helpers]
Browse files Browse the repository at this point in the history
  • Loading branch information
krishpranav committed Jan 23, 2025
1 parent e3f86f7 commit 945490d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sdks/thunderpay-sdk-go/utils/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,18 @@ func ParameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri
break
}
}

func ParameterValueToString(obj interface{}, key string) string {
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
return fmt.Sprintf("%v", obj)
}
var param, ok = obj.(MappedNullable)
if !ok {
return ""
}
dataMap, err := param.ToMap()
if err != nil {
return ""
}
return fmt.Sprintf("%v", dataMap[key])
}

0 comments on commit 945490d

Please sign in to comment.