@dryv/go-client-sdkv0.1.0
A standard-library Go HTTP client SDK with typed models, enums and operations.
dryv pack add @dryv/go-client-sdk// Code generated by Dryv. DO NOT EDIT.
package {{ pack.inputs.package_name }}
{%- for first in property.enum.values %}
{%- if loop.first %}
// {{ file.symbol }} represents {{ property.enum.description or property.enum.name.title }}.
{%- if first.value is boolean %}
type {{ file.symbol }} bool
{%- elif first.value is integer %}
type {{ file.symbol }} int64
{%- elif first.value is number %}
type {{ file.symbol }} float64
{%- elif first.value is string %}
type {{ file.symbol }} string
{%- else %}
type {{ file.symbol }} any
{%- endif %}
{%- if first.value is boolean or first.value is integer or first.value is number or first.value is string %}
const (
{%- for item in property.enum.values %}
{{ file.symbol }}{{ item.name.pascal }} {{ file.symbol }} = {{ item.value_json }}
{%- endfor %}
)
{%- else %}
var (
{%- for item in property.enum.values %}
{{ file.symbol }}{{ item.name.pascal }} {{ file.symbol }} = {{ item.value_json }}
{%- endfor %}
)
{%- endif %}
{%- endif %}
{%- endfor %}
func (value {{ file.symbol }}) IsValid() bool {
switch value {
{%- for item in property.enum.values %}
case {{ file.symbol }}{{ item.name.pascal }}:
return true
{%- endfor %}
default:
return false
}
}