@@ -607,7 +607,32 @@ func (r *MetadataExifThumbnail) UnmarshalJSON(data []byte) error {
607607 return apijson .UnmarshalRoot (data , r )
608608}
609609
610- type UpdateFileRequestParam struct {
610+ // Only one field can be non-zero.
611+ //
612+ // Use [param.IsOmitted] to confirm if a field is set.
613+ type UpdateFileRequestUnionParam struct {
614+ OfUpdateFileDetails * UpdateFileRequestUpdateFileDetailsParam `json:",omitzero,inline"`
615+ OfChangePublicationStatus * UpdateFileRequestChangePublicationStatusParam `json:",omitzero,inline"`
616+ paramUnion
617+ }
618+
619+ func (u UpdateFileRequestUnionParam ) MarshalJSON () ([]byte , error ) {
620+ return param .MarshalUnion (u , u .OfUpdateFileDetails , u .OfChangePublicationStatus )
621+ }
622+ func (u * UpdateFileRequestUnionParam ) UnmarshalJSON (data []byte ) error {
623+ return apijson .UnmarshalRoot (data , u )
624+ }
625+
626+ func (u * UpdateFileRequestUnionParam ) asAny () any {
627+ if ! param .IsOmitted (u .OfUpdateFileDetails ) {
628+ return u .OfUpdateFileDetails
629+ } else if ! param .IsOmitted (u .OfChangePublicationStatus ) {
630+ return u .OfChangePublicationStatus
631+ }
632+ return nil
633+ }
634+
635+ type UpdateFileRequestUpdateFileDetailsParam struct {
611636 // Define an important area in the image in the format `x,y,width,height` e.g.
612637 // `10,10,100,100`. Send `null` to unset this value.
613638 CustomCoordinates param.Opt [string ] `json:"customCoordinates,omitzero"`
@@ -636,36 +661,36 @@ type UpdateFileRequestParam struct {
636661 //
637662 // Note: The remove operation for `AITags` executes before any of the `extensions`
638663 // are processed.
639- RemoveAITags UpdateFileRequestRemoveAITagsUnionParam `json:"removeAITags,omitzero"`
664+ RemoveAITags UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam `json:"removeAITags,omitzero"`
640665 paramObj
641666}
642667
643- func (r UpdateFileRequestParam ) MarshalJSON () (data []byte , err error ) {
644- type shadow UpdateFileRequestParam
668+ func (r UpdateFileRequestUpdateFileDetailsParam ) MarshalJSON () (data []byte , err error ) {
669+ type shadow UpdateFileRequestUpdateFileDetailsParam
645670 return param .MarshalObject (r , (* shadow )(& r ))
646671}
647- func (r * UpdateFileRequestParam ) UnmarshalJSON (data []byte ) error {
672+ func (r * UpdateFileRequestUpdateFileDetailsParam ) UnmarshalJSON (data []byte ) error {
648673 return apijson .UnmarshalRoot (data , r )
649674}
650675
651676// Only one field can be non-zero.
652677//
653678// Use [param.IsOmitted] to confirm if a field is set.
654- type UpdateFileRequestRemoveAITagsUnionParam struct {
679+ type UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam struct {
655680 OfStringArray []string `json:",omitzero,inline"`
656681 // Construct this variant with constant.ValueOf[constant.All]()
657682 OfAll constant.All `json:",omitzero,inline"`
658683 paramUnion
659684}
660685
661- func (u UpdateFileRequestRemoveAITagsUnionParam ) MarshalJSON () ([]byte , error ) {
686+ func (u UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam ) MarshalJSON () ([]byte , error ) {
662687 return param .MarshalUnion (u , u .OfStringArray , u .OfAll )
663688}
664- func (u * UpdateFileRequestRemoveAITagsUnionParam ) UnmarshalJSON (data []byte ) error {
689+ func (u * UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam ) UnmarshalJSON (data []byte ) error {
665690 return apijson .UnmarshalRoot (data , u )
666691}
667692
668- func (u * UpdateFileRequestRemoveAITagsUnionParam ) asAny () any {
693+ func (u * UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam ) asAny () any {
669694 if ! param .IsOmitted (u .OfStringArray ) {
670695 return & u .OfStringArray
671696 } else if ! param .IsOmitted (u .OfAll ) {
@@ -674,6 +699,40 @@ func (u *UpdateFileRequestRemoveAITagsUnionParam) asAny() any {
674699 return nil
675700}
676701
702+ type UpdateFileRequestChangePublicationStatusParam struct {
703+ // Configure the publication status of a file and its versions.
704+ Publish UpdateFileRequestChangePublicationStatusPublishParam `json:"publish,omitzero"`
705+ paramObj
706+ }
707+
708+ func (r UpdateFileRequestChangePublicationStatusParam ) MarshalJSON () (data []byte , err error ) {
709+ type shadow UpdateFileRequestChangePublicationStatusParam
710+ return param .MarshalObject (r , (* shadow )(& r ))
711+ }
712+ func (r * UpdateFileRequestChangePublicationStatusParam ) UnmarshalJSON (data []byte ) error {
713+ return apijson .UnmarshalRoot (data , r )
714+ }
715+
716+ // Configure the publication status of a file and its versions.
717+ //
718+ // The property IsPublished is required.
719+ type UpdateFileRequestChangePublicationStatusPublishParam struct {
720+ // Set to `true` to publish the file. Set to `false` to unpublish the file.
721+ IsPublished bool `json:"isPublished,required"`
722+ // Set to `true` to publish/unpublish all versions of the file. Set to `false` to
723+ // publish/unpublish only the current version of the file.
724+ IncludeFileVersions param.Opt [bool ] `json:"includeFileVersions,omitzero"`
725+ paramObj
726+ }
727+
728+ func (r UpdateFileRequestChangePublicationStatusPublishParam ) MarshalJSON () (data []byte , err error ) {
729+ type shadow UpdateFileRequestChangePublicationStatusPublishParam
730+ return param .MarshalObject (r , (* shadow )(& r ))
731+ }
732+ func (r * UpdateFileRequestChangePublicationStatusPublishParam ) UnmarshalJSON (data []byte ) error {
733+ return apijson .UnmarshalRoot (data , r )
734+ }
735+
677736// Object containing details of a file or file version.
678737type FileUpdateResponse struct {
679738 ExtensionStatus FileUpdateResponseExtensionStatus `json:"extensionStatus"`
@@ -961,7 +1020,7 @@ func (r *FileUploadResponseVersionInfo) UnmarshalJSON(data []byte) error {
9611020
9621021type FileUpdateParams struct {
9631022 // Schema for update file update request.
964- UpdateFileRequest UpdateFileRequestParam
1023+ UpdateFileRequest UpdateFileRequestUnionParam
9651024 paramObj
9661025}
9671026
0 commit comments