shared

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL