Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIObject ¶
type APIObject struct {
// contains filtered or unexported fields
}
APIObject should be embedded in api object fields, preferably using an alias to make private
func (APIObject) ExtraFields ¶
func (m APIObject) ExtraFields() map[string]interface{}
ExtraFields returns the extra fields added to the JSON object.
func (APIObject) Overrides ¶
func (m APIObject) Overrides() (interface{}, bool)
Overrides returns the value of the struct when it is created with [Override], the second argument helps differentiate an explicit null.
func (*APIObject) SetExtraFields ¶
func (m *APIObject) SetExtraFields(extraFields map[string]interface{})
SetExtraFields adds extra fields to the JSON object.
SetExtraFields will override any existing fields with the same key. For security reasons, ensure this is only used with trusted input data.
To intentionally omit a required field, use [Omit].
foo.SetExtraFields(map[string]any{"bar": Omit})
If the struct already contains the field ExtraFields, then this method will have no effect.
type APIUnion ¶
type APIUnion struct {
// contains filtered or unexported fields
}
APIUnion should be embedded in all api unions fields, preferably using an alias to make private
func (APIUnion) ExtraFields ¶
func (m APIUnion) ExtraFields() map[string]interface{}
ExtraFields returns the extra fields added to the JSON object.
func (APIUnion) Overrides ¶
func (m APIUnion) Overrides() (interface{}, bool)
Overrides returns the value of the struct when it is created with [Override], the second argument helps differentiate an explicit null.
func (*APIUnion) SetExtraFields ¶
func (m *APIUnion) SetExtraFields(extraFields map[string]interface{})
SetExtraFields adds extra fields to the JSON object.
SetExtraFields will override any existing fields with the same key. For security reasons, ensure this is only used with trusted input data.
To intentionally omit a required field, use [Omit].
foo.SetExtraFields(map[string]any{"bar": Omit})
If the struct already contains the field ExtraFields, then this method will have no effect.
type ParamNullable ¶
type ParamNullable interface {
// contains filtered or unexported methods
}
ParamNullable encapsulates all structs in parameters, and all [Opt] types in parameters.
type ParamStruct ¶
type ParamStruct interface {
Overrides() (interface{}, bool)
// contains filtered or unexported methods
}
ParamStruct represents the set of all structs that are used in API parameters, by convention these usually end in "Params" or "Param".