Documentation
¶
Index ¶
- type JsonValueUnion
- func (u JsonValueUnion) AsAnyArray() (v []any)
- func (u JsonValueUnion) AsBool() (v bool)
- func (u JsonValueUnion) AsFloat() (v float64)
- func (u JsonValueUnion) AsString() (v string)
- func (u JsonValueUnion) RawJSON() string
- func (r JsonValueUnion) ToParam() JsonValueUnionParam
- func (r *JsonValueUnion) UnmarshalJSON(data []byte) error
- type JsonValueUnionParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonValueUnion ¶
type JsonValueUnion struct {
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
// This field will be present if the value is a [float64] instead of an object.
OfFloat float64 `json:",inline"`
// This field will be present if the value is a [bool] instead of an object.
OfBool bool `json:",inline"`
// This field will be present if the value is a [[]any] instead of an object.
OfAnyArray []any `json:",inline"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
OfAnyArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
JsonValueUnion contains all possible properties and values from [string], [float64], [bool], [[]any].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfFloat OfBool OfAnyArray]
func (JsonValueUnion) AsAnyArray ¶
func (u JsonValueUnion) AsAnyArray() (v []any)
func (JsonValueUnion) AsBool ¶
func (u JsonValueUnion) AsBool() (v bool)
func (JsonValueUnion) AsFloat ¶
func (u JsonValueUnion) AsFloat() (v float64)
func (JsonValueUnion) AsString ¶
func (u JsonValueUnion) AsString() (v string)
func (JsonValueUnion) RawJSON ¶
func (u JsonValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (JsonValueUnion) ToParam ¶
func (r JsonValueUnion) ToParam() JsonValueUnionParam
ToParam converts this JsonValueUnion to a JsonValueUnionParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with JsonValueUnionParam.Overrides()
func (*JsonValueUnion) UnmarshalJSON ¶
func (r *JsonValueUnion) UnmarshalJSON(data []byte) error
type JsonValueUnionParam ¶
type JsonValueUnionParam struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `json:",omitzero,inline"`
OfAnyArray []any `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (JsonValueUnionParam) MarshalJSON ¶
func (u JsonValueUnionParam) MarshalJSON() ([]byte, error)
func (*JsonValueUnionParam) UnmarshalJSON ¶
func (u *JsonValueUnionParam) UnmarshalJSON(data []byte) error