mirror of
https://github.com/openai/openai-go.git
synced 2026-04-01 17:17:14 +09:00
fix(client)!: rename file array param variant
This commit is contained in:
10
image.go
10
image.go
@@ -316,13 +316,13 @@ func (r ImageEditParams) MarshalMultipart() (data []byte, contentType string, er
|
||||
//
|
||||
// Use [param.IsOmitted] to confirm if a field is set.
|
||||
type ImageEditParamsImageUnion struct {
|
||||
OfFile io.Reader `json:",omitzero,inline"`
|
||||
OfBinaryArray []io.Reader `json:",omitzero,inline"`
|
||||
OfFile io.Reader `json:",omitzero,inline"`
|
||||
OfFileArray []io.Reader `json:",omitzero,inline"`
|
||||
paramUnion
|
||||
}
|
||||
|
||||
func (u ImageEditParamsImageUnion) MarshalJSON() ([]byte, error) {
|
||||
return param.MarshalUnion[ImageEditParamsImageUnion](u.OfFile, u.OfBinaryArray)
|
||||
return param.MarshalUnion[ImageEditParamsImageUnion](u.OfFile, u.OfFileArray)
|
||||
}
|
||||
func (u *ImageEditParamsImageUnion) UnmarshalJSON(data []byte) error {
|
||||
return apijson.UnmarshalRoot(data, u)
|
||||
@@ -331,8 +331,8 @@ func (u *ImageEditParamsImageUnion) UnmarshalJSON(data []byte) error {
|
||||
func (u *ImageEditParamsImageUnion) asAny() any {
|
||||
if !param.IsOmitted(u.OfFile) {
|
||||
return &u.OfFile
|
||||
} else if !param.IsOmitted(u.OfBinaryArray) {
|
||||
return &u.OfBinaryArray
|
||||
} else if !param.IsOmitted(u.OfFileArray) {
|
||||
return &u.OfFileArray
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user