updated code to use query struct

This commit is contained in:
Guo Huang
2016-04-11 23:28:06 -07:00
parent 4e6ff1a567
commit 6154619924

View File

@@ -49,7 +49,11 @@ func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{
_sling.Set("{{keyParamName}}", a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")
{{/isKeyInHeader}}{{#isKeyInQuery}}
// set key with prefix in querystring
_sling.Set("{{keyParamName}}", a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")
{{#hasKeyParamName}} type KeyQueryParams struct {
{{keyParamName}} string `url:"{{keyParamName}},omitempty"`
}
_sling = _sling.QueryStruct(&KeyQueryParams{ {{keyParamName}}: a.Configuration.GetApiKeyWithPrefix("{{keyParamName}}") })
{{/hasKeyParamName}}
{{/isKeyInQuery}}{{/isApiKey}}
{{#isBasic}}
// http basic authentication required