Documentation
¶
Index ¶
- Constants
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func NewFile(rdr io.Reader, filename string, contentType string) file
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AccountOriginNewParams
- type AccountOriginService
- func (r *AccountOriginService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *AccountOriginService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *OriginResponseUnion, err error)
- func (r *AccountOriginService) List(ctx context.Context, opts ...option.RequestOption) (res *[]OriginResponseUnion, err error)
- func (r *AccountOriginService) New(ctx context.Context, body AccountOriginNewParams, opts ...option.RequestOption) (res *OriginResponseUnion, err error)
- func (r *AccountOriginService) Update(ctx context.Context, id string, body AccountOriginUpdateParams, ...) (res *OriginResponseUnion, err error)
- type AccountOriginUpdateParams
- type AccountService
- type AccountURLEndpointNewParams
- type AccountURLEndpointService
- func (r *AccountURLEndpointService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *AccountURLEndpointService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *URLEndpointResponse, err error)
- func (r *AccountURLEndpointService) List(ctx context.Context, opts ...option.RequestOption) (res *[]URLEndpointResponse, err error)
- func (r *AccountURLEndpointService) New(ctx context.Context, body AccountURLEndpointNewParams, ...) (res *URLEndpointResponse, err error)
- func (r *AccountURLEndpointService) Update(ctx context.Context, id string, body AccountURLEndpointUpdateParams, ...) (res *URLEndpointResponse, err error)
- type AccountURLEndpointUpdateParams
- type AccountUsageGetParams
- type AccountUsageGetResponse
- type AccountUsageService
- type AssetListParams
- type AssetListParamsFileType
- type AssetListParamsSort
- type AssetListParamsType
- type AssetListResponseUnion
- type AssetService
- type BaseOverlayParam
- type BaseWebhookEvent
- type BetaService
- type BetaV2FileService
- type BetaV2FileUploadParams
- type BetaV2FileUploadParamsTransformation
- type BetaV2FileUploadParamsTransformationPostAbs
- type BetaV2FileUploadParamsTransformationPostGifToVideo
- type BetaV2FileUploadParamsTransformationPostThumbnail
- type BetaV2FileUploadParamsTransformationPostTransformation
- type BetaV2FileUploadParamsTransformationPostUnion
- func (u BetaV2FileUploadParamsTransformationPostUnion) GetProtocol() *string
- func (u BetaV2FileUploadParamsTransformationPostUnion) GetType() *string
- func (u BetaV2FileUploadParamsTransformationPostUnion) GetValue() *string
- func (u BetaV2FileUploadParamsTransformationPostUnion) MarshalJSON() ([]byte, error)
- func (u *BetaV2FileUploadParamsTransformationPostUnion) UnmarshalJSON(data []byte) error
- type BetaV2FileUploadResponse
- type BetaV2FileUploadResponseAITag
- type BetaV2FileUploadResponseExtensionStatus
- type BetaV2FileUploadResponseSelectedFieldsSchema
- type BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString() (v string)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON() string
- func (r *BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
- type BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsBool() (v bool)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsFloat() (v float64)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsMixed() (v []BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsString() (v string)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) RawJSON() string
- func (r *BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
- type BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsFloat() (v float64)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsString() (v string)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) RawJSON() string
- func (r *BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
- type BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsFloat() (v float64)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsString() (v string)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) RawJSON() string
- func (r *BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) UnmarshalJSON(data []byte) error
- type BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsBool() (v bool)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsFloat() (v float64)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsString() (v string)
- func (u BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) RawJSON() string
- func (r *BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
- type BetaV2FileUploadResponseVersionInfo
- type BetaV2Service
- type CacheInvalidationGetResponse
- type CacheInvalidationGetResponseStatus
- type CacheInvalidationNewParams
- type CacheInvalidationNewResponse
- type CacheInvalidationService
- type CacheService
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CustomMetadataField
- type CustomMetadataFieldDeleteResponse
- type CustomMetadataFieldListParams
- type CustomMetadataFieldNewParams
- type CustomMetadataFieldNewParamsSchema
- type CustomMetadataFieldNewParamsSchemaDefaultValueMixedItemUnion
- type CustomMetadataFieldNewParamsSchemaDefaultValueUnion
- type CustomMetadataFieldNewParamsSchemaMaxValueUnion
- type CustomMetadataFieldNewParamsSchemaMinValueUnion
- type CustomMetadataFieldNewParamsSchemaSelectOptionUnion
- type CustomMetadataFieldSchema
- type CustomMetadataFieldSchemaDefaultValueMixedItemUnion
- func (u CustomMetadataFieldSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
- func (u CustomMetadataFieldSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
- func (u CustomMetadataFieldSchemaDefaultValueMixedItemUnion) AsString() (v string)
- func (u CustomMetadataFieldSchemaDefaultValueMixedItemUnion) RawJSON() string
- func (r *CustomMetadataFieldSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
- type CustomMetadataFieldSchemaDefaultValueUnion
- func (u CustomMetadataFieldSchemaDefaultValueUnion) AsBool() (v bool)
- func (u CustomMetadataFieldSchemaDefaultValueUnion) AsFloat() (v float64)
- func (u CustomMetadataFieldSchemaDefaultValueUnion) AsMixed() (v []CustomMetadataFieldSchemaDefaultValueMixedItemUnion)
- func (u CustomMetadataFieldSchemaDefaultValueUnion) AsString() (v string)
- func (u CustomMetadataFieldSchemaDefaultValueUnion) RawJSON() string
- func (r *CustomMetadataFieldSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
- type CustomMetadataFieldSchemaMaxValueUnion
- type CustomMetadataFieldSchemaMinValueUnion
- type CustomMetadataFieldSchemaSelectOptionUnion
- func (u CustomMetadataFieldSchemaSelectOptionUnion) AsBool() (v bool)
- func (u CustomMetadataFieldSchemaSelectOptionUnion) AsFloat() (v float64)
- func (u CustomMetadataFieldSchemaSelectOptionUnion) AsString() (v string)
- func (u CustomMetadataFieldSchemaSelectOptionUnion) RawJSON() string
- func (r *CustomMetadataFieldSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
- type CustomMetadataFieldService
- func (r *CustomMetadataFieldService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *CustomMetadataFieldDeleteResponse, err error)
- func (r *CustomMetadataFieldService) List(ctx context.Context, query CustomMetadataFieldListParams, ...) (res *[]CustomMetadataField, err error)
- func (r *CustomMetadataFieldService) New(ctx context.Context, body CustomMetadataFieldNewParams, ...) (res *CustomMetadataField, err error)
- func (r *CustomMetadataFieldService) Update(ctx context.Context, id string, body CustomMetadataFieldUpdateParams, ...) (res *CustomMetadataField, err error)
- type CustomMetadataFieldUpdateParams
- type CustomMetadataFieldUpdateParamsSchema
- type CustomMetadataFieldUpdateParamsSchemaDefaultValueMixedItemUnion
- type CustomMetadataFieldUpdateParamsSchemaDefaultValueUnion
- type CustomMetadataFieldUpdateParamsSchemaMaxValueUnion
- type CustomMetadataFieldUpdateParamsSchemaMinValueUnion
- type CustomMetadataFieldUpdateParamsSchemaSelectOptionUnion
- type DummyNewParams
- type DummyService
- type Error
- type ExtensionAIAutoDescriptionParam
- type ExtensionAutoTaggingParam
- type ExtensionRemoveBgOptionsParam
- type ExtensionRemoveBgParam
- type ExtensionUnionParam
- type ExtensionsParam
- type File
- type FileAITag
- type FileBulkAddTagsParams
- type FileBulkAddTagsResponse
- type FileBulkDeleteParams
- type FileBulkDeleteResponse
- type FileBulkRemoveAITagsParams
- type FileBulkRemoveAITagsResponse
- type FileBulkRemoveTagsParams
- type FileBulkRemoveTagsResponse
- type FileBulkService
- func (r *FileBulkService) AddTags(ctx context.Context, body FileBulkAddTagsParams, opts ...option.RequestOption) (res *FileBulkAddTagsResponse, err error)
- func (r *FileBulkService) Delete(ctx context.Context, body FileBulkDeleteParams, opts ...option.RequestOption) (res *FileBulkDeleteResponse, err error)
- func (r *FileBulkService) RemoveAITags(ctx context.Context, body FileBulkRemoveAITagsParams, ...) (res *FileBulkRemoveAITagsResponse, err error)
- func (r *FileBulkService) RemoveTags(ctx context.Context, body FileBulkRemoveTagsParams, ...) (res *FileBulkRemoveTagsResponse, err error)
- type FileCopyParams
- type FileCopyResponse
- type FileMetadataGetFromURLParams
- type FileMetadataService
- type FileMoveParams
- type FileMoveResponse
- type FileRenameParams
- type FileRenameResponse
- type FileSelectedFieldsSchema
- type FileSelectedFieldsSchemaDefaultValueMixedItemUnion
- func (u FileSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
- func (u FileSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
- func (u FileSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString() (v string)
- func (u FileSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON() string
- func (r *FileSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
- type FileSelectedFieldsSchemaDefaultValueUnion
- func (u FileSelectedFieldsSchemaDefaultValueUnion) AsBool() (v bool)
- func (u FileSelectedFieldsSchemaDefaultValueUnion) AsFloat() (v float64)
- func (u FileSelectedFieldsSchemaDefaultValueUnion) AsMixed() (v []FileSelectedFieldsSchemaDefaultValueMixedItemUnion)
- func (u FileSelectedFieldsSchemaDefaultValueUnion) AsString() (v string)
- func (u FileSelectedFieldsSchemaDefaultValueUnion) RawJSON() string
- func (r *FileSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
- type FileSelectedFieldsSchemaMaxValueUnion
- type FileSelectedFieldsSchemaMinValueUnion
- type FileSelectedFieldsSchemaSelectOptionUnion
- func (u FileSelectedFieldsSchemaSelectOptionUnion) AsBool() (v bool)
- func (u FileSelectedFieldsSchemaSelectOptionUnion) AsFloat() (v float64)
- func (u FileSelectedFieldsSchemaSelectOptionUnion) AsString() (v string)
- func (u FileSelectedFieldsSchemaSelectOptionUnion) RawJSON() string
- func (r *FileSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
- type FileService
- func (r *FileService) Copy(ctx context.Context, body FileCopyParams, opts ...option.RequestOption) (res *FileCopyResponse, err error)
- func (r *FileService) Delete(ctx context.Context, fileID string, opts ...option.RequestOption) (err error)
- func (r *FileService) Get(ctx context.Context, fileID string, opts ...option.RequestOption) (res *File, err error)
- func (r *FileService) Move(ctx context.Context, body FileMoveParams, opts ...option.RequestOption) (res *FileMoveResponse, err error)
- func (r *FileService) Rename(ctx context.Context, body FileRenameParams, opts ...option.RequestOption) (res *FileRenameResponse, err error)
- func (r *FileService) Update(ctx context.Context, fileID string, body FileUpdateParams, ...) (res *FileUpdateResponse, err error)
- func (r *FileService) Upload(ctx context.Context, body FileUploadParams, opts ...option.RequestOption) (res *FileUploadResponse, err error)
- type FileType
- type FileUpdateParams
- type FileUpdateResponse
- type FileUpdateResponseExtensionStatus
- type FileUploadParams
- type FileUploadParamsTransformation
- type FileUploadParamsTransformationPostAbs
- type FileUploadParamsTransformationPostGifToVideo
- type FileUploadParamsTransformationPostThumbnail
- type FileUploadParamsTransformationPostTransformation
- type FileUploadParamsTransformationPostUnion
- func (u FileUploadParamsTransformationPostUnion) GetProtocol() *string
- func (u FileUploadParamsTransformationPostUnion) GetType() *string
- func (u FileUploadParamsTransformationPostUnion) GetValue() *string
- func (u FileUploadParamsTransformationPostUnion) MarshalJSON() ([]byte, error)
- func (u *FileUploadParamsTransformationPostUnion) UnmarshalJSON(data []byte) error
- type FileUploadResponse
- type FileUploadResponseAITag
- type FileUploadResponseExtensionStatus
- type FileUploadResponseSelectedFieldsSchema
- type FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion
- func (u FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
- func (u FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
- func (u FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString() (v string)
- func (u FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON() string
- func (r *FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
- type FileUploadResponseSelectedFieldsSchemaDefaultValueUnion
- func (u FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsBool() (v bool)
- func (u FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsFloat() (v float64)
- func (u FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsMixed() (v []FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion)
- func (u FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsString() (v string)
- func (u FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) RawJSON() string
- func (r *FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
- type FileUploadResponseSelectedFieldsSchemaMaxValueUnion
- func (u FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsFloat() (v float64)
- func (u FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsString() (v string)
- func (u FileUploadResponseSelectedFieldsSchemaMaxValueUnion) RawJSON() string
- func (r *FileUploadResponseSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
- type FileUploadResponseSelectedFieldsSchemaMinValueUnion
- func (u FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsFloat() (v float64)
- func (u FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsString() (v string)
- func (u FileUploadResponseSelectedFieldsSchemaMinValueUnion) RawJSON() string
- func (r *FileUploadResponseSelectedFieldsSchemaMinValueUnion) UnmarshalJSON(data []byte) error
- type FileUploadResponseSelectedFieldsSchemaSelectOptionUnion
- func (u FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsBool() (v bool)
- func (u FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsFloat() (v float64)
- func (u FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsString() (v string)
- func (u FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) RawJSON() string
- func (r *FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
- type FileUploadResponseVersionInfo
- type FileVersionDeleteParams
- type FileVersionDeleteResponse
- type FileVersionGetParams
- type FileVersionInfo
- type FileVersionRestoreParams
- type FileVersionService
- func (r *FileVersionService) Delete(ctx context.Context, versionID string, body FileVersionDeleteParams, ...) (res *FileVersionDeleteResponse, err error)
- func (r *FileVersionService) Get(ctx context.Context, versionID string, query FileVersionGetParams, ...) (res *File, err error)
- func (r *FileVersionService) List(ctx context.Context, fileID string, opts ...option.RequestOption) (res *[]File, err error)
- func (r *FileVersionService) Restore(ctx context.Context, versionID string, body FileVersionRestoreParams, ...) (res *File, err error)
- type Folder
- type FolderCopyParams
- type FolderCopyResponse
- type FolderDeleteParams
- type FolderDeleteResponse
- type FolderJobGetResponse
- type FolderJobGetResponseStatus
- type FolderJobGetResponseType
- type FolderJobService
- type FolderMoveParams
- type FolderMoveResponse
- type FolderNewParams
- type FolderNewResponse
- type FolderRenameParams
- type FolderRenameResponse
- type FolderService
- func (r *FolderService) Copy(ctx context.Context, body FolderCopyParams, opts ...option.RequestOption) (res *FolderCopyResponse, err error)
- func (r *FolderService) Delete(ctx context.Context, body FolderDeleteParams, opts ...option.RequestOption) (res *FolderDeleteResponse, err error)
- func (r *FolderService) Move(ctx context.Context, body FolderMoveParams, opts ...option.RequestOption) (res *FolderMoveResponse, err error)
- func (r *FolderService) New(ctx context.Context, body FolderNewParams, opts ...option.RequestOption) (res *FolderNewResponse, err error)
- func (r *FolderService) Rename(ctx context.Context, body FolderRenameParams, opts ...option.RequestOption) (res *FolderRenameResponse, err error)
- type FolderType
- type ImageOverlayParam
- type Metadata
- type MetadataExif
- type MetadataExifExif
- type MetadataExifGps
- type MetadataExifImage
- type MetadataExifInteroperability
- type MetadataExifThumbnail
- type OriginRequestAkeneoPimParam
- type OriginRequestAzureBlobParam
- type OriginRequestCloudinaryBackupParam
- type OriginRequestGcsParam
- type OriginRequestS3CompatibleParam
- type OriginRequestS3Param
- type OriginRequestUnionParam
- func (u OriginRequestUnionParam) GetAccessKey() *string
- func (u OriginRequestUnionParam) GetAccountName() *string
- func (u OriginRequestUnionParam) GetBaseURL() *string
- func (u OriginRequestUnionParam) GetBaseURLForCanonicalHeader() *string
- func (u OriginRequestUnionParam) GetBucket() *string
- func (u OriginRequestUnionParam) GetClientEmail() *string
- func (u OriginRequestUnionParam) GetClientID() *string
- func (u OriginRequestUnionParam) GetClientSecret() *string
- func (u OriginRequestUnionParam) GetContainer() *string
- func (u OriginRequestUnionParam) GetEndpoint() *string
- func (u OriginRequestUnionParam) GetForwardHostHeaderToOrigin() *bool
- func (u OriginRequestUnionParam) GetIncludeCanonicalHeader() *bool
- func (u OriginRequestUnionParam) GetName() *string
- func (u OriginRequestUnionParam) GetPassword() *string
- func (u OriginRequestUnionParam) GetPrefix() *string
- func (u OriginRequestUnionParam) GetPrivateKey() *string
- func (u OriginRequestUnionParam) GetS3ForcePathStyle() *bool
- func (u OriginRequestUnionParam) GetSasToken() *string
- func (u OriginRequestUnionParam) GetSecretKey() *string
- func (u OriginRequestUnionParam) GetType() *string
- func (u OriginRequestUnionParam) GetUsername() *string
- func (u OriginRequestUnionParam) MarshalJSON() ([]byte, error)
- func (u *OriginRequestUnionParam) UnmarshalJSON(data []byte) error
- type OriginRequestWebFolderParam
- type OriginRequestWebProxyParam
- type OriginResponseAkeneoPim
- type OriginResponseAzureBlob
- type OriginResponseCloudinaryBackup
- type OriginResponseGcs
- type OriginResponseS3
- type OriginResponseS3Compatible
- type OriginResponseUnion
- func (u OriginResponseUnion) AsAkeneoPim() (v OriginResponseAkeneoPim)
- func (u OriginResponseUnion) AsAny() anyOriginResponse
- func (u OriginResponseUnion) AsAzureBlob() (v OriginResponseAzureBlob)
- func (u OriginResponseUnion) AsCloudinaryBackup() (v OriginResponseCloudinaryBackup)
- func (u OriginResponseUnion) AsGcs() (v OriginResponseGcs)
- func (u OriginResponseUnion) AsS3() (v OriginResponseS3)
- func (u OriginResponseUnion) AsS3Compatible() (v OriginResponseS3Compatible)
- func (u OriginResponseUnion) AsWebFolder() (v OriginResponseWebFolder)
- func (u OriginResponseUnion) AsWebProxy() (v OriginResponseWebProxy)
- func (u OriginResponseUnion) RawJSON() string
- func (r *OriginResponseUnion) UnmarshalJSON(data []byte) error
- type OriginResponseWebFolder
- type OriginResponseWebProxy
- type OverlayPositionFocus
- type OverlayPositionParam
- type OverlayPositionXUnionParam
- type OverlayPositionYUnionParam
- type OverlayTimingDurationUnionParam
- type OverlayTimingEndUnionParam
- type OverlayTimingParam
- type OverlayTimingStartUnionParam
- type OverlayUnionParam
- type SolidColorOverlayParam
- type SolidColorOverlayTransformationGradientBoolean
- type SolidColorOverlayTransformationGradientUnionParam
- type SolidColorOverlayTransformationHeightUnionParam
- type SolidColorOverlayTransformationParam
- type SolidColorOverlayTransformationRadiusUnionParam
- type SolidColorOverlayTransformationWidthUnionParam
- type SrcOptionsParam
- type StreamingResolution
- type SubtitleOverlayParam
- type SubtitleOverlayTransformationParam
- type SubtitleOverlayTransformationTypography
- type TextOverlayParam
- type TextOverlayTransformationFlip
- type TextOverlayTransformationFontSizeUnionParam
- type TextOverlayTransformationInnerAlignment
- type TextOverlayTransformationLineHeightUnionParam
- type TextOverlayTransformationPaddingUnionParam
- type TextOverlayTransformationParam
- type TextOverlayTransformationRadiusUnionParam
- type TextOverlayTransformationRotationUnionParam
- type TextOverlayTransformationWidthUnionParam
- type TransformationAIDropShadowBoolean
- type TransformationAIDropShadowUnionParam
- type TransformationAspectRatioUnionParam
- type TransformationAudioCodec
- type TransformationCrop
- type TransformationCropMode
- type TransformationDurationUnionParam
- type TransformationEndOffsetUnionParam
- type TransformationFlip
- type TransformationFormat
- type TransformationGradientBoolean
- type TransformationGradientUnionParam
- type TransformationHeightUnionParam
- type TransformationPageUnionParam
- type TransformationParam
- type TransformationPosition
- type TransformationRadiusUnionParam
- type TransformationRotationUnionParam
- type TransformationShadowBoolean
- type TransformationShadowUnionParam
- type TransformationSharpenBoolean
- type TransformationSharpenUnionParam
- type TransformationStartOffsetUnionParam
- type TransformationTrimBoolean
- type TransformationTrimUnionParam
- type TransformationUnsharpMaskBoolean
- type TransformationUnsharpMaskUnionParam
- type TransformationVideoCodec
- type TransformationWidthUnionParam
- type TransformationXCenterUnionParam
- type TransformationXUnionParam
- type TransformationYCenterUnionParam
- type TransformationYUnionParam
- type URLEndpointRequestParam
- type URLEndpointRequestURLRewriterAkamaiParam
- type URLEndpointRequestURLRewriterCloudinaryParam
- type URLEndpointRequestURLRewriterImgixParam
- type URLEndpointRequestURLRewriterUnionParam
- func (u URLEndpointRequestURLRewriterUnionParam) GetPreserveAssetDeliveryTypes() *bool
- func (u URLEndpointRequestURLRewriterUnionParam) GetType() *string
- func (u URLEndpointRequestURLRewriterUnionParam) MarshalJSON() ([]byte, error)
- func (u *URLEndpointRequestURLRewriterUnionParam) UnmarshalJSON(data []byte) error
- type URLEndpointResponse
- type URLEndpointResponseURLRewriterAkamai
- type URLEndpointResponseURLRewriterCloudinary
- type URLEndpointResponseURLRewriterImgix
- type URLEndpointResponseURLRewriterUnion
- func (u URLEndpointResponseURLRewriterUnion) AsAkamai() (v URLEndpointResponseURLRewriterAkamai)
- func (u URLEndpointResponseURLRewriterUnion) AsAny() anyURLEndpointResponseURLRewriter
- func (u URLEndpointResponseURLRewriterUnion) AsCloudinary() (v URLEndpointResponseURLRewriterCloudinary)
- func (u URLEndpointResponseURLRewriterUnion) AsImgix() (v URLEndpointResponseURLRewriterImgix)
- func (u URLEndpointResponseURLRewriterUnion) RawJSON() string
- func (r *URLEndpointResponseURLRewriterUnion) UnmarshalJSON(data []byte) error
- type UnsafeUnwrapWebhookEventUnion
- func (u UnsafeUnwrapWebhookEventUnion) AsUploadPostTransformErrorEvent() (v UploadPostTransformErrorEvent)
- func (u UnsafeUnwrapWebhookEventUnion) AsUploadPostTransformSuccessEvent() (v UploadPostTransformSuccessEvent)
- func (u UnsafeUnwrapWebhookEventUnion) AsUploadPreTransformErrorEvent() (v UploadPreTransformErrorEvent)
- func (u UnsafeUnwrapWebhookEventUnion) AsUploadPreTransformSuccessEvent() (v UploadPreTransformSuccessEvent)
- func (u UnsafeUnwrapWebhookEventUnion) AsVideoTransformationAcceptedEvent() (v VideoTransformationAcceptedEvent)
- func (u UnsafeUnwrapWebhookEventUnion) AsVideoTransformationErrorEvent() (v VideoTransformationErrorEvent)
- func (u UnsafeUnwrapWebhookEventUnion) AsVideoTransformationReadyEvent() (v VideoTransformationReadyEvent)
- func (u UnsafeUnwrapWebhookEventUnion) RawJSON() string
- func (r *UnsafeUnwrapWebhookEventUnion) UnmarshalJSON(data []byte) error
- type UnsafeUnwrapWebhookEventUnionData
- type UnsafeUnwrapWebhookEventUnionDataAsset
- type UnsafeUnwrapWebhookEventUnionDataTransformation
- type UnsafeUnwrapWebhookEventUnionDataTransformationError
- type UnsafeUnwrapWebhookEventUnionDataTransformationOptions
- type UnsafeUnwrapWebhookEventUnionRequest
- type UnsafeUnwrapWebhookEventUnionRequestTransformation
- type UnwrapWebhookEventUnion
- func (u UnwrapWebhookEventUnion) AsUploadPostTransformErrorEvent() (v UploadPostTransformErrorEvent)
- func (u UnwrapWebhookEventUnion) AsUploadPostTransformSuccessEvent() (v UploadPostTransformSuccessEvent)
- func (u UnwrapWebhookEventUnion) AsUploadPreTransformErrorEvent() (v UploadPreTransformErrorEvent)
- func (u UnwrapWebhookEventUnion) AsUploadPreTransformSuccessEvent() (v UploadPreTransformSuccessEvent)
- func (u UnwrapWebhookEventUnion) AsVideoTransformationAcceptedEvent() (v VideoTransformationAcceptedEvent)
- func (u UnwrapWebhookEventUnion) AsVideoTransformationErrorEvent() (v VideoTransformationErrorEvent)
- func (u UnwrapWebhookEventUnion) AsVideoTransformationReadyEvent() (v VideoTransformationReadyEvent)
- func (u UnwrapWebhookEventUnion) RawJSON() string
- func (r *UnwrapWebhookEventUnion) UnmarshalJSON(data []byte) error
- type UnwrapWebhookEventUnionData
- type UnwrapWebhookEventUnionDataAsset
- type UnwrapWebhookEventUnionDataTransformation
- type UnwrapWebhookEventUnionDataTransformationError
- type UnwrapWebhookEventUnionDataTransformationOptions
- type UnwrapWebhookEventUnionRequest
- type UnwrapWebhookEventUnionRequestTransformation
- type UpdateFileRequestChangePublicationStatusParam
- type UpdateFileRequestChangePublicationStatusPublishParam
- type UpdateFileRequestUnionParam
- type UpdateFileRequestUpdateFileDetailsParam
- type UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam
- type UploadPostTransformErrorEvent
- type UploadPostTransformErrorEventData
- type UploadPostTransformErrorEventDataTransformation
- type UploadPostTransformErrorEventDataTransformationError
- type UploadPostTransformErrorEventRequest
- type UploadPostTransformErrorEventRequestTransformation
- type UploadPostTransformSuccessEvent
- type UploadPostTransformSuccessEventData
- type UploadPostTransformSuccessEventRequest
- type UploadPostTransformSuccessEventRequestTransformation
- type UploadPreTransformErrorEvent
- type UploadPreTransformErrorEventData
- type UploadPreTransformErrorEventDataTransformation
- type UploadPreTransformErrorEventDataTransformationError
- type UploadPreTransformErrorEventRequest
- type UploadPreTransformSuccessEvent
- type UploadPreTransformSuccessEventData
- type UploadPreTransformSuccessEventDataAITag
- type UploadPreTransformSuccessEventDataExtensionStatus
- type UploadPreTransformSuccessEventDataSelectedFieldsSchema
- type UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString() (v string)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON() string
- func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
- type UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsBool() (v bool)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsFloat() (v float64)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsMixed() (...)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsString() (v string)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) RawJSON() string
- func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
- type UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) AsFloat() (v float64)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) AsString() (v string)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) RawJSON() string
- func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
- type UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) AsFloat() (v float64)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) AsString() (v string)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) RawJSON() string
- func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) UnmarshalJSON(data []byte) error
- type UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) AsBool() (v bool)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) AsFloat() (v float64)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) AsString() (v string)
- func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) RawJSON() string
- func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
- type UploadPreTransformSuccessEventDataVersionInfo
- type UploadPreTransformSuccessEventRequest
- type VideoOverlayParam
- type VideoTransformationAcceptedEvent
- type VideoTransformationAcceptedEventData
- type VideoTransformationAcceptedEventDataAsset
- type VideoTransformationAcceptedEventDataTransformation
- type VideoTransformationAcceptedEventDataTransformationOptions
- type VideoTransformationAcceptedEventRequest
- type VideoTransformationErrorEvent
- type VideoTransformationErrorEventData
- type VideoTransformationErrorEventDataAsset
- type VideoTransformationErrorEventDataTransformation
- type VideoTransformationErrorEventDataTransformationError
- type VideoTransformationErrorEventDataTransformationOptions
- type VideoTransformationErrorEventRequest
- type VideoTransformationReadyEvent
- type VideoTransformationReadyEventData
- type VideoTransformationReadyEventDataAsset
- type VideoTransformationReadyEventDataTransformation
- type VideoTransformationReadyEventDataTransformationOptions
- type VideoTransformationReadyEventDataTransformationOutput
- type VideoTransformationReadyEventDataTransformationOutputVideoMetadata
- type VideoTransformationReadyEventRequest
- type VideoTransformationReadyEventTimings
- type WebhookService
Constants ¶
const OverlayPositionFocusBottom = shared.OverlayPositionFocusBottom
Equals "bottom"
const OverlayPositionFocusBottomLeft = shared.OverlayPositionFocusBottomLeft
Equals "bottom_left"
const OverlayPositionFocusBottomRight = shared.OverlayPositionFocusBottomRight
Equals "bottom_right"
const OverlayPositionFocusCenter = shared.OverlayPositionFocusCenter
Equals "center"
const OverlayPositionFocusLeft = shared.OverlayPositionFocusLeft
Equals "left"
const OverlayPositionFocusRight = shared.OverlayPositionFocusRight
Equals "right"
const OverlayPositionFocusTop = shared.OverlayPositionFocusTop
Equals "top"
const OverlayPositionFocusTopLeft = shared.OverlayPositionFocusTopLeft
Equals "top_left"
const OverlayPositionFocusTopRight = shared.OverlayPositionFocusTopRight
Equals "top_right"
const StreamingResolution1080 = shared.StreamingResolution1080
Equals "1080"
const StreamingResolution1440 = shared.StreamingResolution1440
Equals "1440"
const StreamingResolution2160 = shared.StreamingResolution2160
Equals "2160"
const StreamingResolution240 = shared.StreamingResolution240
Equals "240"
const StreamingResolution360 = shared.StreamingResolution360
Equals "360"
const StreamingResolution480 = shared.StreamingResolution480
Equals "480"
const StreamingResolution720 = shared.StreamingResolution720
Equals "720"
const SubtitleOverlayTransformationTypographyB = shared.SubtitleOverlayTransformationTypographyB
Equals "b"
const SubtitleOverlayTransformationTypographyBI = shared.SubtitleOverlayTransformationTypographyBI
Equals "b_i"
const SubtitleOverlayTransformationTypographyI = shared.SubtitleOverlayTransformationTypographyI
Equals "i"
const TextOverlayTransformationFlipH = shared.TextOverlayTransformationFlipH
Equals "h"
const TextOverlayTransformationFlipHV = shared.TextOverlayTransformationFlipHV
Equals "h_v"
const TextOverlayTransformationFlipV = shared.TextOverlayTransformationFlipV
Equals "v"
const TextOverlayTransformationFlipVH = shared.TextOverlayTransformationFlipVH
Equals "v_h"
const TextOverlayTransformationInnerAlignmentCenter = shared.TextOverlayTransformationInnerAlignmentCenter
Equals "center"
const TextOverlayTransformationInnerAlignmentLeft = shared.TextOverlayTransformationInnerAlignmentLeft
Equals "left"
const TextOverlayTransformationInnerAlignmentRight = shared.TextOverlayTransformationInnerAlignmentRight
Equals "right"
const TransformationAudioCodecAac = shared.TransformationAudioCodecAac
Equals "aac"
const TransformationAudioCodecNone = shared.TransformationAudioCodecNone
Equals "none"
const TransformationAudioCodecOpus = shared.TransformationAudioCodecOpus
Equals "opus"
const TransformationCropAtLeast = shared.TransformationCropAtLeast
Equals "at_least"
const TransformationCropAtMax = shared.TransformationCropAtMax
Equals "at_max"
const TransformationCropAtMaxEnlarge = shared.TransformationCropAtMaxEnlarge
Equals "at_max_enlarge"
const TransformationCropForce = shared.TransformationCropForce
Equals "force"
const TransformationCropMaintainRatio = shared.TransformationCropMaintainRatio
Equals "maintain_ratio"
const TransformationCropModeExtract = shared.TransformationCropModeExtract
Equals "extract"
const TransformationCropModePadExtract = shared.TransformationCropModePadExtract
Equals "pad_extract"
const TransformationCropModePadResize = shared.TransformationCropModePadResize
Equals "pad_resize"
const TransformationFlipH = shared.TransformationFlipH
Equals "h"
const TransformationFlipHV = shared.TransformationFlipHV
Equals "h_v"
const TransformationFlipV = shared.TransformationFlipV
Equals "v"
const TransformationFlipVH = shared.TransformationFlipVH
Equals "v_h"
const TransformationFormatAuto = shared.TransformationFormatAuto
Equals "auto"
const TransformationFormatAvif = shared.TransformationFormatAvif
Equals "avif"
const TransformationFormatGif = shared.TransformationFormatGif
Equals "gif"
const TransformationFormatJpeg = shared.TransformationFormatJpeg
Equals "jpeg"
const TransformationFormatJpg = shared.TransformationFormatJpg
Equals "jpg"
const TransformationFormatMP4 = shared.TransformationFormatMP4
Equals "mp4"
const TransformationFormatOrig = shared.TransformationFormatOrig
Equals "orig"
const TransformationFormatPng = shared.TransformationFormatPng
Equals "png"
const TransformationFormatSvg = shared.TransformationFormatSvg
Equals "svg"
const TransformationFormatWebm = shared.TransformationFormatWebm
Equals "webm"
const TransformationFormatWebp = shared.TransformationFormatWebp
Equals "webp"
const TransformationPositionPath = shared.TransformationPositionPath
Equals "path"
const TransformationPositionQuery = shared.TransformationPositionQuery
Equals "query"
const TransformationVideoCodecAv1 = shared.TransformationVideoCodecAv1
Equals "av1"
const TransformationVideoCodecH264 = shared.TransformationVideoCodecH264
Equals "h264"
const TransformationVideoCodecNone = shared.TransformationVideoCodecNone
Equals "none"
const TransformationVideoCodecVp9 = shared.TransformationVideoCodecVp9
Equals "vp9"
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (IMAGEKIT_PRIVATE_KEY, OPTIONAL_IMAGEKIT_IGNORES_THIS, IMAGEKIT_WEBHOOK_SECRET, IMAGE_KIT_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AccountOriginNewParams ¶
type AccountOriginNewParams struct {
// Schema for origin request resources.
OriginRequest OriginRequestUnionParam
// contains filtered or unexported fields
}
func (AccountOriginNewParams) MarshalJSON ¶
func (r AccountOriginNewParams) MarshalJSON() (data []byte, err error)
func (*AccountOriginNewParams) UnmarshalJSON ¶
func (r *AccountOriginNewParams) UnmarshalJSON(data []byte) error
type AccountOriginService ¶
type AccountOriginService struct {
Options []option.RequestOption
}
AccountOriginService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccountOriginService method instead.
func NewAccountOriginService ¶
func NewAccountOriginService(opts ...option.RequestOption) (r AccountOriginService)
NewAccountOriginService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AccountOriginService) Delete ¶
func (r *AccountOriginService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
**Note:** This API is currently in beta. Permanently removes the origin identified by `id`. If the origin is in use by any URL‑endpoints, the API will return an error.
func (*AccountOriginService) Get ¶
func (r *AccountOriginService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *OriginResponseUnion, err error)
**Note:** This API is currently in beta. Retrieves the origin identified by `id`.
func (*AccountOriginService) List ¶
func (r *AccountOriginService) List(ctx context.Context, opts ...option.RequestOption) (res *[]OriginResponseUnion, err error)
**Note:** This API is currently in beta. Returns an array of all configured origins for the current account.
func (*AccountOriginService) New ¶
func (r *AccountOriginService) New(ctx context.Context, body AccountOriginNewParams, opts ...option.RequestOption) (res *OriginResponseUnion, err error)
**Note:** This API is currently in beta. Creates a new origin and returns the origin object.
func (*AccountOriginService) Update ¶
func (r *AccountOriginService) Update(ctx context.Context, id string, body AccountOriginUpdateParams, opts ...option.RequestOption) (res *OriginResponseUnion, err error)
**Note:** This API is currently in beta. Updates the origin identified by `id` and returns the updated origin object.
type AccountOriginUpdateParams ¶
type AccountOriginUpdateParams struct {
// Schema for origin request resources.
OriginRequest OriginRequestUnionParam
// contains filtered or unexported fields
}
func (AccountOriginUpdateParams) MarshalJSON ¶
func (r AccountOriginUpdateParams) MarshalJSON() (data []byte, err error)
func (*AccountOriginUpdateParams) UnmarshalJSON ¶
func (r *AccountOriginUpdateParams) UnmarshalJSON(data []byte) error
type AccountService ¶
type AccountService struct {
Options []option.RequestOption
Usage AccountUsageService
Origins AccountOriginService
URLEndpoints AccountURLEndpointService
}
AccountService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccountService method instead.
func NewAccountService ¶
func NewAccountService(opts ...option.RequestOption) (r AccountService)
NewAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type AccountURLEndpointNewParams ¶
type AccountURLEndpointNewParams struct {
// Schema for URL endpoint resource.
URLEndpointRequest URLEndpointRequestParam
// contains filtered or unexported fields
}
func (AccountURLEndpointNewParams) MarshalJSON ¶
func (r AccountURLEndpointNewParams) MarshalJSON() (data []byte, err error)
func (*AccountURLEndpointNewParams) UnmarshalJSON ¶
func (r *AccountURLEndpointNewParams) UnmarshalJSON(data []byte) error
type AccountURLEndpointService ¶
type AccountURLEndpointService struct {
Options []option.RequestOption
}
AccountURLEndpointService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccountURLEndpointService method instead.
func NewAccountURLEndpointService ¶
func NewAccountURLEndpointService(opts ...option.RequestOption) (r AccountURLEndpointService)
NewAccountURLEndpointService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AccountURLEndpointService) Delete ¶
func (r *AccountURLEndpointService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
**Note:** This API is currently in beta. Deletes the URL‑endpoint identified by `id`. You cannot delete the default URL‑endpoint created by ImageKit during account creation.
func (*AccountURLEndpointService) Get ¶
func (r *AccountURLEndpointService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *URLEndpointResponse, err error)
**Note:** This API is currently in beta. Retrieves the URL‑endpoint identified by `id`.
func (*AccountURLEndpointService) List ¶
func (r *AccountURLEndpointService) List(ctx context.Context, opts ...option.RequestOption) (res *[]URLEndpointResponse, err error)
**Note:** This API is currently in beta. Returns an array of all URL‑endpoints configured including the default URL-endpoint generated by ImageKit during account creation.
func (*AccountURLEndpointService) New ¶
func (r *AccountURLEndpointService) New(ctx context.Context, body AccountURLEndpointNewParams, opts ...option.RequestOption) (res *URLEndpointResponse, err error)
**Note:** This API is currently in beta. Creates a new URL‑endpoint and returns the resulting object.
func (*AccountURLEndpointService) Update ¶
func (r *AccountURLEndpointService) Update(ctx context.Context, id string, body AccountURLEndpointUpdateParams, opts ...option.RequestOption) (res *URLEndpointResponse, err error)
**Note:** This API is currently in beta. Updates the URL‑endpoint identified by `id` and returns the updated object.
type AccountURLEndpointUpdateParams ¶
type AccountURLEndpointUpdateParams struct {
// Schema for URL endpoint resource.
URLEndpointRequest URLEndpointRequestParam
// contains filtered or unexported fields
}
func (AccountURLEndpointUpdateParams) MarshalJSON ¶
func (r AccountURLEndpointUpdateParams) MarshalJSON() (data []byte, err error)
func (*AccountURLEndpointUpdateParams) UnmarshalJSON ¶
func (r *AccountURLEndpointUpdateParams) UnmarshalJSON(data []byte) error
type AccountUsageGetParams ¶
type AccountUsageGetParams struct {
// Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`.
// The difference between `startDate` and `endDate` should be less than 90 days.
EndDate time.Time `query:"endDate,required" format:"date" json:"-"`
// Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`.
// The difference between `startDate` and `endDate` should be less than 90 days.
StartDate time.Time `query:"startDate,required" format:"date" json:"-"`
// contains filtered or unexported fields
}
func (AccountUsageGetParams) URLQuery ¶
func (r AccountUsageGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes AccountUsageGetParams's query parameters as `url.Values`.
type AccountUsageGetResponse ¶
type AccountUsageGetResponse struct {
// Amount of bandwidth used in bytes.
BandwidthBytes int64 `json:"bandwidthBytes"`
// Number of extension units used.
ExtensionUnitsCount int64 `json:"extensionUnitsCount"`
// Storage used by media library in bytes.
MediaLibraryStorageBytes int64 `json:"mediaLibraryStorageBytes"`
// Storage used by the original cache in bytes.
OriginalCacheStorageBytes int64 `json:"originalCacheStorageBytes"`
// Number of video processing units used.
VideoProcessingUnitsCount int64 `json:"videoProcessingUnitsCount"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BandwidthBytes respjson.Field
ExtensionUnitsCount respjson.Field
MediaLibraryStorageBytes respjson.Field
OriginalCacheStorageBytes respjson.Field
VideoProcessingUnitsCount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountUsageGetResponse) RawJSON ¶
func (r AccountUsageGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountUsageGetResponse) UnmarshalJSON ¶
func (r *AccountUsageGetResponse) UnmarshalJSON(data []byte) error
type AccountUsageService ¶
type AccountUsageService struct {
Options []option.RequestOption
}
AccountUsageService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccountUsageService method instead.
func NewAccountUsageService ¶
func NewAccountUsageService(opts ...option.RequestOption) (r AccountUsageService)
NewAccountUsageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AccountUsageService) Get ¶
func (r *AccountUsageService) Get(ctx context.Context, query AccountUsageGetParams, opts ...option.RequestOption) (res *AccountUsageGetResponse, err error)
Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date.
type AssetListParams ¶
type AssetListParams struct {
// The maximum number of results to return in response.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Folder path if you want to limit the search within a specific folder. For
// example, `/sales-banner/` will only search in folder sales-banner.
//
// Note : If your use case involves searching within a folder as well as its
// subfolders, you can use `path` parameter in `searchQuery` with appropriate
// operator. Checkout
// [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters)
// for more information.
Path param.Opt[string] `query:"path,omitzero" json:"-"`
// Query string in a Lucene-like query language e.g. `createdAt > "7d"`.
//
// Note : When the searchQuery parameter is present, the following query parameters
// will have no effect on the result:
//
// 1. `tags`
// 2. `type`
// 3. `name`
//
// [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries)
// from examples.
SearchQuery param.Opt[string] `query:"searchQuery,omitzero" json:"-"`
// The number of results to skip before returning results.
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Filter results by file type.
//
// - `all` — include all file types
// - `image` — include only image files
// - `non-image` — include only non-image files (e.g., JS, CSS, video)
//
// Any of "all", "image", "non-image".
FileType AssetListParamsFileType `query:"fileType,omitzero" json:"-"`
// Sort the results by one of the supported fields in ascending or descending
// order.
//
// Any of "ASC_NAME", "DESC_NAME", "ASC_CREATED", "DESC_CREATED", "ASC_UPDATED",
// "DESC_UPDATED", "ASC_HEIGHT", "DESC_HEIGHT", "ASC_WIDTH", "DESC_WIDTH",
// "ASC_SIZE", "DESC_SIZE", "ASC_RELEVANCE", "DESC_RELEVANCE".
Sort AssetListParamsSort `query:"sort,omitzero" json:"-"`
// Filter results by asset type.
//
// - `file` — returns only files
// - `file-version` — returns specific file versions
// - `folder` — returns only folders
// - `all` — returns both files and folders (excludes `file-version`)
//
// Any of "file", "file-version", "folder", "all".
Type AssetListParamsType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AssetListParams) URLQuery ¶
func (r AssetListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AssetListParams's query parameters as `url.Values`.
type AssetListParamsFileType ¶
type AssetListParamsFileType string
Filter results by file type.
- `all` — include all file types - `image` — include only image files - `non-image` — include only non-image files (e.g., JS, CSS, video)
const ( AssetListParamsFileTypeAll AssetListParamsFileType = "all" AssetListParamsFileTypeImage AssetListParamsFileType = "image" AssetListParamsFileTypeNonImage AssetListParamsFileType = "non-image" )
type AssetListParamsSort ¶
type AssetListParamsSort string
Sort the results by one of the supported fields in ascending or descending order.
const ( AssetListParamsSortAscName AssetListParamsSort = "ASC_NAME" AssetListParamsSortDescName AssetListParamsSort = "DESC_NAME" AssetListParamsSortAscCreated AssetListParamsSort = "ASC_CREATED" AssetListParamsSortDescCreated AssetListParamsSort = "DESC_CREATED" AssetListParamsSortAscUpdated AssetListParamsSort = "ASC_UPDATED" AssetListParamsSortDescUpdated AssetListParamsSort = "DESC_UPDATED" AssetListParamsSortAscHeight AssetListParamsSort = "ASC_HEIGHT" AssetListParamsSortDescHeight AssetListParamsSort = "DESC_HEIGHT" AssetListParamsSortAscWidth AssetListParamsSort = "ASC_WIDTH" AssetListParamsSortDescWidth AssetListParamsSort = "DESC_WIDTH" AssetListParamsSortAscSize AssetListParamsSort = "ASC_SIZE" AssetListParamsSortDescSize AssetListParamsSort = "DESC_SIZE" AssetListParamsSortAscRelevance AssetListParamsSort = "ASC_RELEVANCE" AssetListParamsSortDescRelevance AssetListParamsSort = "DESC_RELEVANCE" )
type AssetListParamsType ¶
type AssetListParamsType string
Filter results by asset type.
- `file` — returns only files - `file-version` — returns specific file versions - `folder` — returns only folders - `all` — returns both files and folders (excludes `file-version`)
const ( AssetListParamsTypeFile AssetListParamsType = "file" AssetListParamsTypeFileVersion AssetListParamsType = "file-version" AssetListParamsTypeFolder AssetListParamsType = "folder" AssetListParamsTypeAll AssetListParamsType = "all" )
type AssetListResponseUnion ¶
type AssetListResponseUnion struct {
// This field is from variant [File].
AITags []FileAITag `json:"AITags"`
CreatedAt time.Time `json:"createdAt"`
// This field is from variant [File].
CustomCoordinates string `json:"customCoordinates"`
// This field is from variant [File].
CustomMetadata map[string]any `json:"customMetadata"`
// This field is from variant [File].
Description string `json:"description"`
// This field is from variant [File].
FileID string `json:"fileId"`
// This field is from variant [File].
FilePath string `json:"filePath"`
// This field is from variant [File].
FileType string `json:"fileType"`
// This field is from variant [File].
HasAlpha bool `json:"hasAlpha"`
// This field is from variant [File].
Height float64 `json:"height"`
// This field is from variant [File].
IsPrivateFile bool `json:"isPrivateFile"`
// This field is from variant [File].
IsPublished bool `json:"isPublished"`
// This field is from variant [File].
Mime string `json:"mime"`
Name string `json:"name"`
// This field is from variant [File].
SelectedFieldsSchema map[string]FileSelectedFieldsSchema `json:"selectedFieldsSchema"`
// This field is from variant [File].
Size float64 `json:"size"`
// This field is from variant [File].
Tags []string `json:"tags"`
// This field is from variant [File].
Thumbnail string `json:"thumbnail"`
// Any of nil, "folder".
Type string `json:"type"`
UpdatedAt time.Time `json:"updatedAt"`
// This field is from variant [File].
URL string `json:"url"`
// This field is from variant [File].
VersionInfo FileVersionInfo `json:"versionInfo"`
// This field is from variant [File].
Width float64 `json:"width"`
// This field is from variant [Folder].
FolderID string `json:"folderId"`
// This field is from variant [Folder].
FolderPath string `json:"folderPath"`
JSON struct {
AITags respjson.Field
CreatedAt respjson.Field
CustomCoordinates respjson.Field
CustomMetadata respjson.Field
Description respjson.Field
FileID respjson.Field
FilePath respjson.Field
FileType respjson.Field
HasAlpha respjson.Field
Height respjson.Field
IsPrivateFile respjson.Field
IsPublished respjson.Field
Mime respjson.Field
Name respjson.Field
SelectedFieldsSchema respjson.Field
Size respjson.Field
Tags respjson.Field
Thumbnail respjson.Field
Type respjson.Field
UpdatedAt respjson.Field
URL respjson.Field
VersionInfo respjson.Field
Width respjson.Field
FolderID respjson.Field
FolderPath respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
AssetListResponseUnion contains all possible properties and values from File, Folder.
Use the [AssetListResponseUnion.AsAny] method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (AssetListResponseUnion) AsFileFileVersion ¶
func (u AssetListResponseUnion) AsFileFileVersion() (v File)
func (AssetListResponseUnion) AsFolder ¶
func (u AssetListResponseUnion) AsFolder() (v Folder)
func (AssetListResponseUnion) RawJSON ¶
func (u AssetListResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetListResponseUnion) UnmarshalJSON ¶
func (r *AssetListResponseUnion) UnmarshalJSON(data []byte) error
type AssetService ¶
type AssetService struct {
Options []option.RequestOption
}
AssetService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAssetService method instead.
func NewAssetService ¶
func NewAssetService(opts ...option.RequestOption) (r AssetService)
NewAssetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AssetService) List ¶
func (r *AssetService) List(ctx context.Context, query AssetListParams, opts ...option.RequestOption) (res *[]AssetListResponseUnion, err error)
This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`.
type BaseOverlayParam ¶
type BaseOverlayParam = shared.BaseOverlayParam
This is an alias to an internal type.
type BaseWebhookEvent ¶
type BaseWebhookEvent struct {
// Unique identifier for the event.
ID string `json:"id,required"`
// The type of webhook event.
Type string `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BaseWebhookEvent) RawJSON ¶
func (r BaseWebhookEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*BaseWebhookEvent) UnmarshalJSON ¶
func (r *BaseWebhookEvent) UnmarshalJSON(data []byte) error
type BetaService ¶
type BetaService struct {
Options []option.RequestOption
V2 BetaV2Service
}
BetaService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaService method instead.
func NewBetaService ¶
func NewBetaService(opts ...option.RequestOption) (r BetaService)
NewBetaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type BetaV2FileService ¶
type BetaV2FileService struct {
Options []option.RequestOption
}
BetaV2FileService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaV2FileService method instead.
func NewBetaV2FileService ¶
func NewBetaV2FileService(opts ...option.RequestOption) (r BetaV2FileService)
NewBetaV2FileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BetaV2FileService) Upload ¶
func (r *BetaV2FileService) Upload(ctx context.Context, body BetaV2FileUploadParams, opts ...option.RequestOption) (res *BetaV2FileUploadResponse, err error)
The V2 API enhances security by verifying the entire payload using JWT. This API is in beta.
ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file-v2#how-to-implement-secure-client-side-file-upload) about how to implement secure client-side file upload.
**File size limit** \ On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files, and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files, and 2GB for videos. These limits can be further increased with higher-tier plans.
**Version limit** \ A file can have a maximum of 100 versions.
**Demo applications**
- A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more.
- [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies.
type BetaV2FileUploadParams ¶
type BetaV2FileUploadParams struct {
// File is the upload payload. It MUST be a non-nil io.Reader (e.g., *os.File,
// *bytes.Reader, *bytes.Buffer, *strings.Reader, or any stream).
File io.Reader `json:"file,omitzero,required" format:"binary"`
// The name with which the file has to be uploaded.
FileName string `json:"fileName,required"`
// This is the client-generated JSON Web Token (JWT). The ImageKit.io server uses
// it to authenticate and check that the upload request parameters have not been
// tampered with after the token has been generated. Learn how to create the token
// on the page below. This field is only required for authentication when uploading
// a file from the client side.
//
// **Note**: Sending a JWT that has been used in the past will result in a
// validation error. Even if your previous request resulted in an error, you should
// always send a new token.
//
// **⚠️Warning**: JWT must be generated on the server-side because it is generated
// using your account's private API key. This field is required for authentication
// when uploading a file from the client-side.
Token param.Opt[string] `json:"token,omitzero"`
// Server-side checks to run on the asset. Read more about
// [Upload API checks](/docs/api-reference/upload-file/upload-file-v2#upload-api-checks).
Checks param.Opt[string] `json:"checks,omitzero"`
// Define an important area in the image. This is only relevant for image type
// files.
//
// - To be passed as a string with the x and y coordinates of the top-left corner,
// and width and height of the area of interest in the format `x,y,width,height`.
// For example - `10,10,100,100`
// - Can be used with fo-customtransformation.
// - If this field is not specified and the file is overwritten, then
// customCoordinates will be removed.
CustomCoordinates param.Opt[string] `json:"customCoordinates,omitzero"`
// Optional text to describe the contents of the file.
Description param.Opt[string] `json:"description,omitzero"`
// The folder path in which the image has to be uploaded. If the folder(s) didn't
// exist before, a new folder(s) is created. Using multiple `/` creates a nested
// folder.
Folder param.Opt[string] `json:"folder,omitzero"`
// Whether to mark the file as private or not.
//
// If `true`, the file is marked as private and is accessible only using named
// transformation or signed URL.
IsPrivateFile param.Opt[bool] `json:"isPrivateFile,omitzero"`
// Whether to upload file as published or not.
//
// If `false`, the file is marked as unpublished, which restricts access to the
// file only via the media library. Files in draft or unpublished state can only be
// publicly accessed after being published.
//
// The option to upload in draft state is only available in custom enterprise
// pricing plans.
IsPublished param.Opt[bool] `json:"isPublished,omitzero"`
// If set to `true` and a file already exists at the exact location, its AITags
// will be removed. Set `overwriteAITags` to `false` to preserve AITags.
OverwriteAITags param.Opt[bool] `json:"overwriteAITags,omitzero"`
// If the request does not have `customMetadata`, and a file already exists at the
// exact location, existing customMetadata will be removed.
OverwriteCustomMetadata param.Opt[bool] `json:"overwriteCustomMetadata,omitzero"`
// If `false` and `useUniqueFileName` is also `false`, and a file already exists at
// the exact location, upload API will return an error immediately.
OverwriteFile param.Opt[bool] `json:"overwriteFile,omitzero"`
// If the request does not have `tags`, and a file already exists at the exact
// location, existing tags will be removed.
OverwriteTags param.Opt[bool] `json:"overwriteTags,omitzero"`
// Whether to use a unique filename for this file or not.
//
// If `true`, ImageKit.io will add a unique suffix to the filename parameter to get
// a unique filename.
//
// If `false`, then the image is uploaded with the provided filename parameter, and
// any existing file with the same name is replaced.
UseUniqueFileName param.Opt[bool] `json:"useUniqueFileName,omitzero"`
// The final status of extensions after they have completed execution will be
// delivered to this endpoint as a POST request.
// [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure)
// about the webhook payload structure.
WebhookURL param.Opt[string] `json:"webhookUrl,omitzero" format:"uri"`
// JSON key-value pairs to associate with the asset. Create the custom metadata
// fields before setting these values.
CustomMetadata map[string]any `json:"customMetadata,omitzero"`
// Array of extensions to be applied to the asset. Each extension can be configured
// with specific parameters based on the extension type.
Extensions shared.ExtensionsParam `json:"extensions,omitzero"`
// Array of response field keys to include in the API response body.
//
// Any of "tags", "customCoordinates", "isPrivateFile", "embeddedMetadata",
// "isPublished", "customMetadata", "metadata", "selectedFieldsSchema".
ResponseFields []string `json:"responseFields,omitzero"`
// Set the tags while uploading the file. Provide an array of tag strings (e.g.
// `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not
// exceed 500, and the `%` character is not allowed. If this field is not specified
// and the file is overwritten, the existing tags will be removed.
Tags []string `json:"tags,omitzero"`
// Configure pre-processing (`pre`) and post-processing (`post`) transformations.
//
// - `pre` — applied before the file is uploaded to the Media Library.
// Useful for reducing file size or applying basic optimizations upfront (e.g.,
// resize, compress).
//
// - `post` — applied immediately after upload.
// Ideal for generating transformed versions (like video encodes or thumbnails)
// in advance, so they're ready for delivery without delay.
//
// You can mix and match any combination of post-processing types.
Transformation BetaV2FileUploadParamsTransformation `json:"transformation,omitzero"`
// contains filtered or unexported fields
}
func (BetaV2FileUploadParams) MarshalMultipart ¶
func (r BetaV2FileUploadParams) MarshalMultipart() (data []byte, contentType string, err error)
type BetaV2FileUploadParamsTransformation ¶
type BetaV2FileUploadParamsTransformation struct {
// Transformation string to apply before uploading the file to the Media Library.
// Useful for optimizing files at ingestion.
Pre param.Opt[string] `json:"pre,omitzero"`
// List of transformations to apply _after_ the file is uploaded.
// Each item must match one of the following types: `transformation`,
// `gif-to-video`, `thumbnail`, `abs`.
Post []BetaV2FileUploadParamsTransformationPostUnion `json:"post,omitzero"`
// contains filtered or unexported fields
}
Configure pre-processing (`pre`) and post-processing (`post`) transformations.
`pre` — applied before the file is uploaded to the Media Library. Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress).
`post` — applied immediately after upload. Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay.
You can mix and match any combination of post-processing types.
func (BetaV2FileUploadParamsTransformation) MarshalJSON ¶
func (r BetaV2FileUploadParamsTransformation) MarshalJSON() (data []byte, err error)
func (*BetaV2FileUploadParamsTransformation) UnmarshalJSON ¶
func (r *BetaV2FileUploadParamsTransformation) UnmarshalJSON(data []byte) error
type BetaV2FileUploadParamsTransformationPostAbs ¶
type BetaV2FileUploadParamsTransformationPostAbs struct {
// Streaming protocol to use (`hls` or `dash`).
//
// Any of "hls", "dash".
Protocol string `json:"protocol,omitzero,required"`
// List of different representations you want to create separated by an underscore.
Value string `json:"value,required"`
// Adaptive Bitrate Streaming (ABS) setup.
//
// This field can be elided, and will marshal its zero value as "abs".
Type constant.Abs `json:"type,required"`
// contains filtered or unexported fields
}
The properties Protocol, Type, Value are required.
func (BetaV2FileUploadParamsTransformationPostAbs) MarshalJSON ¶
func (r BetaV2FileUploadParamsTransformationPostAbs) MarshalJSON() (data []byte, err error)
func (*BetaV2FileUploadParamsTransformationPostAbs) UnmarshalJSON ¶
func (r *BetaV2FileUploadParamsTransformationPostAbs) UnmarshalJSON(data []byte) error
type BetaV2FileUploadParamsTransformationPostGifToVideo ¶
type BetaV2FileUploadParamsTransformationPostGifToVideo struct {
// Optional transformation string to apply to the output video.
// **Example**: `q-80`
Value param.Opt[string] `json:"value,omitzero"`
// Converts an animated GIF into an MP4.
//
// This field can be elided, and will marshal its zero value as "gif-to-video".
Type constant.GifToVideo `json:"type,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (BetaV2FileUploadParamsTransformationPostGifToVideo) MarshalJSON ¶
func (r BetaV2FileUploadParamsTransformationPostGifToVideo) MarshalJSON() (data []byte, err error)
func (*BetaV2FileUploadParamsTransformationPostGifToVideo) UnmarshalJSON ¶
func (r *BetaV2FileUploadParamsTransformationPostGifToVideo) UnmarshalJSON(data []byte) error
type BetaV2FileUploadParamsTransformationPostThumbnail ¶
type BetaV2FileUploadParamsTransformationPostThumbnail struct {
// Optional transformation string.
// **Example**: `w-150,h-150`
Value param.Opt[string] `json:"value,omitzero"`
// Generates a thumbnail image.
//
// This field can be elided, and will marshal its zero value as "thumbnail".
Type constant.Thumbnail `json:"type,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (BetaV2FileUploadParamsTransformationPostThumbnail) MarshalJSON ¶
func (r BetaV2FileUploadParamsTransformationPostThumbnail) MarshalJSON() (data []byte, err error)
func (*BetaV2FileUploadParamsTransformationPostThumbnail) UnmarshalJSON ¶
func (r *BetaV2FileUploadParamsTransformationPostThumbnail) UnmarshalJSON(data []byte) error
type BetaV2FileUploadParamsTransformationPostTransformation ¶
type BetaV2FileUploadParamsTransformationPostTransformation struct {
// Transformation string (e.g. `w-200,h-200`).
// Same syntax as ImageKit URL-based transformations.
Value string `json:"value,required"`
// Transformation type.
//
// This field can be elided, and will marshal its zero value as "transformation".
Type constant.Transformation `json:"type,required"`
// contains filtered or unexported fields
}
The properties Type, Value are required.
func (BetaV2FileUploadParamsTransformationPostTransformation) MarshalJSON ¶
func (r BetaV2FileUploadParamsTransformationPostTransformation) MarshalJSON() (data []byte, err error)
func (*BetaV2FileUploadParamsTransformationPostTransformation) UnmarshalJSON ¶
func (r *BetaV2FileUploadParamsTransformationPostTransformation) UnmarshalJSON(data []byte) error
type BetaV2FileUploadParamsTransformationPostUnion ¶
type BetaV2FileUploadParamsTransformationPostUnion struct {
OfTransformation *BetaV2FileUploadParamsTransformationPostTransformation `json:",omitzero,inline"`
OfGifToVideo *BetaV2FileUploadParamsTransformationPostGifToVideo `json:",omitzero,inline"`
OfThumbnail *BetaV2FileUploadParamsTransformationPostThumbnail `json:",omitzero,inline"`
OfAbs *BetaV2FileUploadParamsTransformationPostAbs `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 (BetaV2FileUploadParamsTransformationPostUnion) GetProtocol ¶
func (u BetaV2FileUploadParamsTransformationPostUnion) GetProtocol() *string
Returns a pointer to the underlying variant's property, if present.
func (BetaV2FileUploadParamsTransformationPostUnion) GetType ¶
func (u BetaV2FileUploadParamsTransformationPostUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (BetaV2FileUploadParamsTransformationPostUnion) GetValue ¶
func (u BetaV2FileUploadParamsTransformationPostUnion) GetValue() *string
Returns a pointer to the underlying variant's property, if present.
func (BetaV2FileUploadParamsTransformationPostUnion) MarshalJSON ¶
func (u BetaV2FileUploadParamsTransformationPostUnion) MarshalJSON() ([]byte, error)
func (*BetaV2FileUploadParamsTransformationPostUnion) UnmarshalJSON ¶
func (u *BetaV2FileUploadParamsTransformationPostUnion) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponse ¶
type BetaV2FileUploadResponse struct {
// An array of tags assigned to the uploaded file by auto tagging.
AITags []BetaV2FileUploadResponseAITag `json:"AITags,nullable"`
// The audio codec used in the video (only for video).
AudioCodec string `json:"audioCodec"`
// The bit rate of the video in kbps (only for video).
BitRate int64 `json:"bitRate"`
// Value of custom coordinates associated with the image in the format
// `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`.
// Send `customCoordinates` in `responseFields` in API request to get the value of
// this field.
CustomCoordinates string `json:"customCoordinates,nullable"`
// A key-value data associated with the asset. Use `responseField` in API request
// to get `customMetadata` in the upload API response. Before setting any custom
// metadata on an asset, you have to create the field using custom metadata fields
// API. Send `customMetadata` in `responseFields` in API request to get the value
// of this field.
CustomMetadata map[string]any `json:"customMetadata"`
// Optional text to describe the contents of the file. Can be set by the user or
// the ai-auto-description extension.
Description string `json:"description"`
// The duration of the video in seconds (only for video).
Duration int64 `json:"duration"`
// Consolidated embedded metadata associated with the file. It includes exif, iptc,
// and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get
// embeddedMetadata in the upload API response.
EmbeddedMetadata map[string]any `json:"embeddedMetadata"`
// Extension names with their processing status at the time of completion of the
// request. It could have one of the following status values:
//
// `success`: The extension has been successfully applied. `failed`: The extension
// has failed and will not be retried. `pending`: The extension will finish
// processing in some time. On completion, the final status (success / failed) will
// be sent to the `webhookUrl` provided.
//
// If no extension was requested, then this parameter is not returned.
ExtensionStatus BetaV2FileUploadResponseExtensionStatus `json:"extensionStatus"`
// Unique fileId. Store this fileld in your database, as this will be used to
// perform update action on this file.
FileID string `json:"fileId"`
// The relative path of the file in the media library e.g.
// `/marketing-assets/new-banner.jpg`.
FilePath string `json:"filePath"`
// Type of the uploaded file. Possible values are `image`, `non-image`.
FileType string `json:"fileType"`
// Height of the image in pixels (Only for images)
Height float64 `json:"height"`
// Is the file marked as private. It can be either `true` or `false`. Send
// `isPrivateFile` in `responseFields` in API request to get the value of this
// field.
IsPrivateFile bool `json:"isPrivateFile"`
// Is the file published or in draft state. It can be either `true` or `false`.
// Send `isPublished` in `responseFields` in API request to get the value of this
// field.
IsPublished bool `json:"isPublished"`
// Legacy metadata. Send `metadata` in `responseFields` in API request to get
// metadata in the upload API response.
Metadata Metadata `json:"metadata"`
// Name of the asset.
Name string `json:"name"`
// This field is included in the response only if the Path policy feature is
// available in the plan. It contains schema definitions for the custom metadata
// fields selected for the specified file path. Field selection can only be done
// when the Path policy feature is enabled.
//
// Keys are the names of the custom metadata fields; the value object has details
// about the custom metadata schema.
SelectedFieldsSchema map[string]BetaV2FileUploadResponseSelectedFieldsSchema `json:"selectedFieldsSchema"`
// Size of the image file in Bytes.
Size float64 `json:"size"`
// The array of tags associated with the asset. If no tags are set, it will be
// `null`. Send `tags` in `responseFields` in API request to get the value of this
// field.
Tags []string `json:"tags,nullable"`
// In the case of an image, a small thumbnail URL.
ThumbnailURL string `json:"thumbnailUrl"`
// A publicly accessible URL of the file.
URL string `json:"url"`
// An object containing the file or file version's `id` (versionId) and `name`.
VersionInfo BetaV2FileUploadResponseVersionInfo `json:"versionInfo"`
// The video codec used in the video (only for video).
VideoCodec string `json:"videoCodec"`
// Width of the image in pixels (Only for Images)
Width float64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AITags respjson.Field
AudioCodec respjson.Field
BitRate respjson.Field
CustomCoordinates respjson.Field
CustomMetadata respjson.Field
Description respjson.Field
Duration respjson.Field
EmbeddedMetadata respjson.Field
ExtensionStatus respjson.Field
FileID respjson.Field
FilePath respjson.Field
FileType respjson.Field
Height respjson.Field
IsPrivateFile respjson.Field
IsPublished respjson.Field
Metadata respjson.Field
Name respjson.Field
SelectedFieldsSchema respjson.Field
Size respjson.Field
Tags respjson.Field
ThumbnailURL respjson.Field
URL respjson.Field
VersionInfo respjson.Field
VideoCodec respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object containing details of a successful upload.
func (BetaV2FileUploadResponse) RawJSON ¶
func (r BetaV2FileUploadResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponse) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponse) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponseAITag ¶
type BetaV2FileUploadResponseAITag struct {
// Confidence score of the tag.
Confidence float64 `json:"confidence"`
// Name of the tag.
Name string `json:"name"`
// Array of `AITags` associated with the image. If no `AITags` are set, it will be
// null. These tags can be added using the `google-auto-tagging` or
// `aws-auto-tagging` extensions.
Source string `json:"source"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Confidence respjson.Field
Name respjson.Field
Source respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BetaV2FileUploadResponseAITag) RawJSON ¶
func (r BetaV2FileUploadResponseAITag) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponseAITag) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponseAITag) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponseExtensionStatus ¶
type BetaV2FileUploadResponseExtensionStatus struct {
// Any of "success", "pending", "failed".
AIAutoDescription string `json:"ai-auto-description"`
// Any of "success", "pending", "failed".
AwsAutoTagging string `json:"aws-auto-tagging"`
// Any of "success", "pending", "failed".
GoogleAutoTagging string `json:"google-auto-tagging"`
// Any of "success", "pending", "failed".
RemoveBg string `json:"remove-bg"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AIAutoDescription respjson.Field
AwsAutoTagging respjson.Field
GoogleAutoTagging respjson.Field
RemoveBg respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Extension names with their processing status at the time of completion of the request. It could have one of the following status values:
`success`: The extension has been successfully applied. `failed`: The extension has failed and will not be retried. `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided.
If no extension was requested, then this parameter is not returned.
func (BetaV2FileUploadResponseExtensionStatus) RawJSON ¶
func (r BetaV2FileUploadResponseExtensionStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponseExtensionStatus) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponseExtensionStatus) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponseSelectedFieldsSchema ¶
type BetaV2FileUploadResponseSelectedFieldsSchema struct {
// Type of the custom metadata field.
//
// Any of "Text", "Textarea", "Number", "Date", "Boolean", "SingleSelect",
// "MultiSelect".
Type string `json:"type,required"`
// The default value for this custom metadata field. The value should match the
// `type` of custom metadata field.
DefaultValue BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion `json:"defaultValue"`
// Specifies if the custom metadata field is required or not.
IsValueRequired bool `json:"isValueRequired"`
// Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
MaxLength float64 `json:"maxLength"`
// Maximum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MaxValue BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion `json:"maxValue"`
// Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
MinLength float64 `json:"minLength"`
// Minimum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MinValue BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion `json:"minValue"`
// Indicates whether the custom metadata field is read only. A read only field
// cannot be modified after being set. This field is configurable only via the
// **Path policy** feature.
ReadOnly bool `json:"readOnly"`
// An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
SelectOptions []BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion `json:"selectOptions"`
// Specifies if the selectOptions array is truncated. It is truncated when number
// of options are > 100.
SelectOptionsTruncated bool `json:"selectOptionsTruncated"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
DefaultValue respjson.Field
IsValueRequired respjson.Field
MaxLength respjson.Field
MaxValue respjson.Field
MinLength respjson.Field
MinValue respjson.Field
ReadOnly respjson.Field
SelectOptions respjson.Field
SelectOptionsTruncated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BetaV2FileUploadResponseSelectedFieldsSchema) RawJSON ¶
func (r BetaV2FileUploadResponseSelectedFieldsSchema) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponseSelectedFieldsSchema) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponseSelectedFieldsSchema) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion ¶
type BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
func (BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
func (BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString() (v string)
func (BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion ¶
type BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion 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
// [[]BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion]
// instead of an object.
OfMixed []BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
OfMixed respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion contains all possible properties and values from [string], [float64], [bool], [[]BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion].
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 OfMixed]
func (BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsBool ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsBool() (v bool)
func (BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsFloat ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsFloat() (v float64)
func (BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsString ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsString() (v string)
func (BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) RawJSON ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion ¶
type BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion contains all possible properties and values from [string], [float64].
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]
func (BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsFloat ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsFloat() (v float64)
func (BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsString ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsString() (v string)
func (BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) RawJSON ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponseSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion ¶
type BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion contains all possible properties and values from [string], [float64].
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]
func (BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsFloat ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsFloat() (v float64)
func (BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsString ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsString() (v string)
func (BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) RawJSON ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponseSelectedFieldsSchemaMinValueUnion) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion ¶
type BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsBool ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsBool() (v bool)
func (BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsFloat ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsFloat() (v float64)
func (BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsString ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsString() (v string)
func (BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) RawJSON ¶
func (u BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
type BetaV2FileUploadResponseVersionInfo ¶
type BetaV2FileUploadResponseVersionInfo struct {
// Unique identifier of the file version.
ID string `json:"id"`
// Name of the file version.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An object containing the file or file version's `id` (versionId) and `name`.
func (BetaV2FileUploadResponseVersionInfo) RawJSON ¶
func (r BetaV2FileUploadResponseVersionInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*BetaV2FileUploadResponseVersionInfo) UnmarshalJSON ¶
func (r *BetaV2FileUploadResponseVersionInfo) UnmarshalJSON(data []byte) error
type BetaV2Service ¶
type BetaV2Service struct {
Options []option.RequestOption
Files BetaV2FileService
}
BetaV2Service contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaV2Service method instead.
func NewBetaV2Service ¶
func NewBetaV2Service(opts ...option.RequestOption) (r BetaV2Service)
NewBetaV2Service generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type CacheInvalidationGetResponse ¶
type CacheInvalidationGetResponse struct {
// Status of the purge request.
//
// Any of "Pending", "Completed".
Status CacheInvalidationGetResponseStatus `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CacheInvalidationGetResponse) RawJSON ¶
func (r CacheInvalidationGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CacheInvalidationGetResponse) UnmarshalJSON ¶
func (r *CacheInvalidationGetResponse) UnmarshalJSON(data []byte) error
type CacheInvalidationGetResponseStatus ¶
type CacheInvalidationGetResponseStatus string
Status of the purge request.
const ( CacheInvalidationGetResponseStatusPending CacheInvalidationGetResponseStatus = "Pending" CacheInvalidationGetResponseStatusCompleted CacheInvalidationGetResponseStatus = "Completed" )
type CacheInvalidationNewParams ¶
type CacheInvalidationNewParams struct {
// The full URL of the file to be purged.
URL string `json:"url,required" format:"uri"`
// contains filtered or unexported fields
}
func (CacheInvalidationNewParams) MarshalJSON ¶
func (r CacheInvalidationNewParams) MarshalJSON() (data []byte, err error)
func (*CacheInvalidationNewParams) UnmarshalJSON ¶
func (r *CacheInvalidationNewParams) UnmarshalJSON(data []byte) error
type CacheInvalidationNewResponse ¶
type CacheInvalidationNewResponse struct {
// Unique identifier of the purge request. This can be used to check the status of
// the purge request.
RequestID string `json:"requestId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
RequestID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CacheInvalidationNewResponse) RawJSON ¶
func (r CacheInvalidationNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CacheInvalidationNewResponse) UnmarshalJSON ¶
func (r *CacheInvalidationNewResponse) UnmarshalJSON(data []byte) error
type CacheInvalidationService ¶
type CacheInvalidationService struct {
Options []option.RequestOption
}
CacheInvalidationService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCacheInvalidationService method instead.
func NewCacheInvalidationService ¶
func NewCacheInvalidationService(opts ...option.RequestOption) (r CacheInvalidationService)
NewCacheInvalidationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CacheInvalidationService) Get ¶
func (r *CacheInvalidationService) Get(ctx context.Context, requestID string, opts ...option.RequestOption) (res *CacheInvalidationGetResponse, err error)
This API returns the status of a purge cache request.
func (*CacheInvalidationService) New ¶
func (r *CacheInvalidationService) New(ctx context.Context, body CacheInvalidationNewParams, opts ...option.RequestOption) (res *CacheInvalidationNewResponse, err error)
This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes.
type CacheService ¶
type CacheService struct {
Options []option.RequestOption
Invalidation CacheInvalidationService
}
CacheService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCacheService method instead.
func NewCacheService ¶
func NewCacheService(opts ...option.RequestOption) (r CacheService)
NewCacheService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type Client ¶
type Client struct {
Options []option.RequestOption
Dummy DummyService
CustomMetadataFields CustomMetadataFieldService
Files FileService
Assets AssetService
Cache CacheService
Folders FolderService
Accounts AccountService
Beta BetaService
Webhooks WebhookService
Helper lib.HelperService
}
Client creates a struct with services and top level methods that help with interacting with the ImageKit API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (IMAGEKIT_PRIVATE_KEY, OPTIONAL_IMAGEKIT_IGNORES_THIS, IMAGEKIT_WEBHOOK_SECRET, IMAGE_KIT_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CustomMetadataField ¶
type CustomMetadataField struct {
// Unique identifier for the custom metadata field. Use this to update the field.
ID string `json:"id,required"`
// Human readable name of the custom metadata field. This name is displayed as form
// field label to the users while setting field value on the asset in the media
// library UI.
Label string `json:"label,required"`
// API name of the custom metadata field. This becomes the key while setting
// `customMetadata` (key-value object) for an asset using upload or update API.
Name string `json:"name,required"`
// An object that describes the rules for the custom metadata field value.
Schema CustomMetadataFieldSchema `json:"schema,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Label respjson.Field
Name respjson.Field
Schema respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object containing details of a custom metadata field.
func (CustomMetadataField) RawJSON ¶
func (r CustomMetadataField) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomMetadataField) UnmarshalJSON ¶
func (r *CustomMetadataField) UnmarshalJSON(data []byte) error
type CustomMetadataFieldDeleteResponse ¶
type CustomMetadataFieldDeleteResponse struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CustomMetadataFieldDeleteResponse) RawJSON ¶
func (r CustomMetadataFieldDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomMetadataFieldDeleteResponse) UnmarshalJSON ¶
func (r *CustomMetadataFieldDeleteResponse) UnmarshalJSON(data []byte) error
type CustomMetadataFieldListParams ¶
type CustomMetadataFieldListParams struct {
// The folder path (e.g., `/path/to/folder`) for which to retrieve applicable
// custom metadata fields. Useful for determining path-specific field selections
// when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in
// use.
FolderPath param.Opt[string] `query:"folderPath,omitzero" json:"-"`
// Set it to `true` to include deleted field objects in the API response.
IncludeDeleted param.Opt[bool] `query:"includeDeleted,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CustomMetadataFieldListParams) URLQuery ¶
func (r CustomMetadataFieldListParams) URLQuery() (v url.Values, err error)
URLQuery serializes CustomMetadataFieldListParams's query parameters as `url.Values`.
type CustomMetadataFieldNewParams ¶
type CustomMetadataFieldNewParams struct {
// Human readable name of the custom metadata field. This should be unique across
// all non deleted custom metadata fields. This name is displayed as form field
// label to the users while setting field value on an asset in the media library
// UI.
Label string `json:"label,required"`
// API name of the custom metadata field. This should be unique across all
// (including deleted) custom metadata fields.
Name string `json:"name,required"`
Schema CustomMetadataFieldNewParamsSchema `json:"schema,omitzero,required"`
// contains filtered or unexported fields
}
func (CustomMetadataFieldNewParams) MarshalJSON ¶
func (r CustomMetadataFieldNewParams) MarshalJSON() (data []byte, err error)
func (*CustomMetadataFieldNewParams) UnmarshalJSON ¶
func (r *CustomMetadataFieldNewParams) UnmarshalJSON(data []byte) error
type CustomMetadataFieldNewParamsSchema ¶
type CustomMetadataFieldNewParamsSchema struct {
// Type of the custom metadata field.
//
// Any of "Text", "Textarea", "Number", "Date", "Boolean", "SingleSelect",
// "MultiSelect".
Type string `json:"type,omitzero,required"`
// Sets this custom metadata field as required. Setting custom metadata fields on
// an asset will throw error if the value for all required fields are not present
// in upload or update asset API request body.
IsValueRequired param.Opt[bool] `json:"isValueRequired,omitzero"`
// Maximum length of string. Only set this property if `type` is set to `Text` or
// `Textarea`.
MaxLength param.Opt[float64] `json:"maxLength,omitzero"`
// Minimum length of string. Only set this property if `type` is set to `Text` or
// `Textarea`.
MinLength param.Opt[float64] `json:"minLength,omitzero"`
// The default value for this custom metadata field. This property is only required
// if `isValueRequired` property is set to `true`. The value should match the
// `type` of custom metadata field.
DefaultValue CustomMetadataFieldNewParamsSchemaDefaultValueUnion `json:"defaultValue,omitzero"`
// Maximum value of the field. Only set this property if field type is `Date` or
// `Number`. For `Date` type field, set the minimum date in ISO8601 string format.
// For `Number` type field, set the minimum numeric value.
MaxValue CustomMetadataFieldNewParamsSchemaMaxValueUnion `json:"maxValue,omitzero"`
// Minimum value of the field. Only set this property if field type is `Date` or
// `Number`. For `Date` type field, set the minimum date in ISO8601 string format.
// For `Number` type field, set the minimum numeric value.
MinValue CustomMetadataFieldNewParamsSchemaMinValueUnion `json:"minValue,omitzero"`
// An array of allowed values. This property is only required if `type` property is
// set to `SingleSelect` or `MultiSelect`.
SelectOptions []CustomMetadataFieldNewParamsSchemaSelectOptionUnion `json:"selectOptions,omitzero"`
// contains filtered or unexported fields
}
The property Type is required.
func (CustomMetadataFieldNewParamsSchema) MarshalJSON ¶
func (r CustomMetadataFieldNewParamsSchema) MarshalJSON() (data []byte, err error)
func (*CustomMetadataFieldNewParamsSchema) UnmarshalJSON ¶
func (r *CustomMetadataFieldNewParamsSchema) UnmarshalJSON(data []byte) error
type CustomMetadataFieldNewParamsSchemaDefaultValueMixedItemUnion ¶
type CustomMetadataFieldNewParamsSchemaDefaultValueMixedItemUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `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 (CustomMetadataFieldNewParamsSchemaDefaultValueMixedItemUnion) MarshalJSON ¶
func (u CustomMetadataFieldNewParamsSchemaDefaultValueMixedItemUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldNewParamsSchemaDefaultValueMixedItemUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldNewParamsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldNewParamsSchemaDefaultValueUnion ¶
type CustomMetadataFieldNewParamsSchemaDefaultValueUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `json:",omitzero,inline"`
OfMixed []CustomMetadataFieldNewParamsSchemaDefaultValueMixedItemUnion `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 (CustomMetadataFieldNewParamsSchemaDefaultValueUnion) MarshalJSON ¶
func (u CustomMetadataFieldNewParamsSchemaDefaultValueUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldNewParamsSchemaDefaultValueUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldNewParamsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldNewParamsSchemaMaxValueUnion ¶
type CustomMetadataFieldNewParamsSchemaMaxValueUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `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 (CustomMetadataFieldNewParamsSchemaMaxValueUnion) MarshalJSON ¶
func (u CustomMetadataFieldNewParamsSchemaMaxValueUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldNewParamsSchemaMaxValueUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldNewParamsSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldNewParamsSchemaMinValueUnion ¶
type CustomMetadataFieldNewParamsSchemaMinValueUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `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 (CustomMetadataFieldNewParamsSchemaMinValueUnion) MarshalJSON ¶
func (u CustomMetadataFieldNewParamsSchemaMinValueUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldNewParamsSchemaMinValueUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldNewParamsSchemaMinValueUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldNewParamsSchemaSelectOptionUnion ¶
type CustomMetadataFieldNewParamsSchemaSelectOptionUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `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 (CustomMetadataFieldNewParamsSchemaSelectOptionUnion) MarshalJSON ¶
func (u CustomMetadataFieldNewParamsSchemaSelectOptionUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldNewParamsSchemaSelectOptionUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldNewParamsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldSchema ¶
type CustomMetadataFieldSchema struct {
// Type of the custom metadata field.
//
// Any of "Text", "Textarea", "Number", "Date", "Boolean", "SingleSelect",
// "MultiSelect".
Type string `json:"type,required"`
// The default value for this custom metadata field. Data type of default value
// depends on the field type.
DefaultValue CustomMetadataFieldSchemaDefaultValueUnion `json:"defaultValue"`
// Specifies if the this custom metadata field is required or not.
IsValueRequired bool `json:"isValueRequired"`
// Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
MaxLength float64 `json:"maxLength"`
// Maximum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MaxValue CustomMetadataFieldSchemaMaxValueUnion `json:"maxValue"`
// Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
MinLength float64 `json:"minLength"`
// Minimum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MinValue CustomMetadataFieldSchemaMinValueUnion `json:"minValue"`
// An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
SelectOptions []CustomMetadataFieldSchemaSelectOptionUnion `json:"selectOptions"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
DefaultValue respjson.Field
IsValueRequired respjson.Field
MaxLength respjson.Field
MaxValue respjson.Field
MinLength respjson.Field
MinValue respjson.Field
SelectOptions respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An object that describes the rules for the custom metadata field value.
func (CustomMetadataFieldSchema) RawJSON ¶
func (r CustomMetadataFieldSchema) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomMetadataFieldSchema) UnmarshalJSON ¶
func (r *CustomMetadataFieldSchema) UnmarshalJSON(data []byte) error
type CustomMetadataFieldSchemaDefaultValueMixedItemUnion ¶
type CustomMetadataFieldSchemaDefaultValueMixedItemUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CustomMetadataFieldSchemaDefaultValueMixedItemUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (CustomMetadataFieldSchemaDefaultValueMixedItemUnion) AsBool ¶
func (u CustomMetadataFieldSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
func (CustomMetadataFieldSchemaDefaultValueMixedItemUnion) AsFloat ¶
func (u CustomMetadataFieldSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
func (CustomMetadataFieldSchemaDefaultValueMixedItemUnion) AsString ¶
func (u CustomMetadataFieldSchemaDefaultValueMixedItemUnion) AsString() (v string)
func (CustomMetadataFieldSchemaDefaultValueMixedItemUnion) RawJSON ¶
func (u CustomMetadataFieldSchemaDefaultValueMixedItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomMetadataFieldSchemaDefaultValueMixedItemUnion) UnmarshalJSON ¶
func (r *CustomMetadataFieldSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldSchemaDefaultValueUnion ¶
type CustomMetadataFieldSchemaDefaultValueUnion 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
// [[]CustomMetadataFieldSchemaDefaultValueMixedItemUnion] instead of an object.
OfMixed []CustomMetadataFieldSchemaDefaultValueMixedItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
OfMixed respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CustomMetadataFieldSchemaDefaultValueUnion contains all possible properties and values from [string], [float64], [bool], [[]CustomMetadataFieldSchemaDefaultValueMixedItemUnion].
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 OfMixed]
func (CustomMetadataFieldSchemaDefaultValueUnion) AsBool ¶
func (u CustomMetadataFieldSchemaDefaultValueUnion) AsBool() (v bool)
func (CustomMetadataFieldSchemaDefaultValueUnion) AsFloat ¶
func (u CustomMetadataFieldSchemaDefaultValueUnion) AsFloat() (v float64)
func (CustomMetadataFieldSchemaDefaultValueUnion) AsMixed ¶
func (u CustomMetadataFieldSchemaDefaultValueUnion) AsMixed() (v []CustomMetadataFieldSchemaDefaultValueMixedItemUnion)
func (CustomMetadataFieldSchemaDefaultValueUnion) AsString ¶
func (u CustomMetadataFieldSchemaDefaultValueUnion) AsString() (v string)
func (CustomMetadataFieldSchemaDefaultValueUnion) RawJSON ¶
func (u CustomMetadataFieldSchemaDefaultValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomMetadataFieldSchemaDefaultValueUnion) UnmarshalJSON ¶
func (r *CustomMetadataFieldSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldSchemaMaxValueUnion ¶
type CustomMetadataFieldSchemaMaxValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CustomMetadataFieldSchemaMaxValueUnion contains all possible properties and values from [string], [float64].
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]
func (CustomMetadataFieldSchemaMaxValueUnion) AsFloat ¶
func (u CustomMetadataFieldSchemaMaxValueUnion) AsFloat() (v float64)
func (CustomMetadataFieldSchemaMaxValueUnion) AsString ¶
func (u CustomMetadataFieldSchemaMaxValueUnion) AsString() (v string)
func (CustomMetadataFieldSchemaMaxValueUnion) RawJSON ¶
func (u CustomMetadataFieldSchemaMaxValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomMetadataFieldSchemaMaxValueUnion) UnmarshalJSON ¶
func (r *CustomMetadataFieldSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldSchemaMinValueUnion ¶
type CustomMetadataFieldSchemaMinValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CustomMetadataFieldSchemaMinValueUnion contains all possible properties and values from [string], [float64].
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]
func (CustomMetadataFieldSchemaMinValueUnion) AsFloat ¶
func (u CustomMetadataFieldSchemaMinValueUnion) AsFloat() (v float64)
func (CustomMetadataFieldSchemaMinValueUnion) AsString ¶
func (u CustomMetadataFieldSchemaMinValueUnion) AsString() (v string)
func (CustomMetadataFieldSchemaMinValueUnion) RawJSON ¶
func (u CustomMetadataFieldSchemaMinValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomMetadataFieldSchemaMinValueUnion) UnmarshalJSON ¶
func (r *CustomMetadataFieldSchemaMinValueUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldSchemaSelectOptionUnion ¶
type CustomMetadataFieldSchemaSelectOptionUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CustomMetadataFieldSchemaSelectOptionUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (CustomMetadataFieldSchemaSelectOptionUnion) AsBool ¶
func (u CustomMetadataFieldSchemaSelectOptionUnion) AsBool() (v bool)
func (CustomMetadataFieldSchemaSelectOptionUnion) AsFloat ¶
func (u CustomMetadataFieldSchemaSelectOptionUnion) AsFloat() (v float64)
func (CustomMetadataFieldSchemaSelectOptionUnion) AsString ¶
func (u CustomMetadataFieldSchemaSelectOptionUnion) AsString() (v string)
func (CustomMetadataFieldSchemaSelectOptionUnion) RawJSON ¶
func (u CustomMetadataFieldSchemaSelectOptionUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CustomMetadataFieldSchemaSelectOptionUnion) UnmarshalJSON ¶
func (r *CustomMetadataFieldSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldService ¶
type CustomMetadataFieldService struct {
Options []option.RequestOption
}
CustomMetadataFieldService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomMetadataFieldService method instead.
func NewCustomMetadataFieldService ¶
func NewCustomMetadataFieldService(opts ...option.RequestOption) (r CustomMetadataFieldService)
NewCustomMetadataFieldService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CustomMetadataFieldService) Delete ¶
func (r *CustomMetadataFieldService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *CustomMetadataFieldDeleteResponse, err error)
This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name.
func (*CustomMetadataFieldService) List ¶
func (r *CustomMetadataFieldService) List(ctx context.Context, query CustomMetadataFieldListParams, opts ...option.RequestOption) (res *[]CustomMetadataField, err error)
This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response.
You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path.
func (*CustomMetadataFieldService) New ¶
func (r *CustomMetadataFieldService) New(ctx context.Context, body CustomMetadataFieldNewParams, opts ...option.RequestOption) (res *CustomMetadataField, err error)
This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API.
func (*CustomMetadataFieldService) Update ¶
func (r *CustomMetadataFieldService) Update(ctx context.Context, id string, body CustomMetadataFieldUpdateParams, opts ...option.RequestOption) (res *CustomMetadataField, err error)
This API updates the label or schema of an existing custom metadata field.
type CustomMetadataFieldUpdateParams ¶
type CustomMetadataFieldUpdateParams struct {
// Human readable name of the custom metadata field. This should be unique across
// all non deleted custom metadata fields. This name is displayed as form field
// label to the users while setting field value on an asset in the media library
// UI. This parameter is required if `schema` is not provided.
Label param.Opt[string] `json:"label,omitzero"`
// An object that describes the rules for the custom metadata key. This parameter
// is required if `label` is not provided. Note: `type` cannot be updated and will
// be ignored if sent with the `schema`. The schema will be validated as per the
// existing `type`.
Schema CustomMetadataFieldUpdateParamsSchema `json:"schema,omitzero"`
// contains filtered or unexported fields
}
func (CustomMetadataFieldUpdateParams) MarshalJSON ¶
func (r CustomMetadataFieldUpdateParams) MarshalJSON() (data []byte, err error)
func (*CustomMetadataFieldUpdateParams) UnmarshalJSON ¶
func (r *CustomMetadataFieldUpdateParams) UnmarshalJSON(data []byte) error
type CustomMetadataFieldUpdateParamsSchema ¶
type CustomMetadataFieldUpdateParamsSchema struct {
// Sets this custom metadata field as required. Setting custom metadata fields on
// an asset will throw error if the value for all required fields are not present
// in upload or update asset API request body.
IsValueRequired param.Opt[bool] `json:"isValueRequired,omitzero"`
// Maximum length of string. Only set this property if `type` is set to `Text` or
// `Textarea`.
MaxLength param.Opt[float64] `json:"maxLength,omitzero"`
// Minimum length of string. Only set this property if `type` is set to `Text` or
// `Textarea`.
MinLength param.Opt[float64] `json:"minLength,omitzero"`
// The default value for this custom metadata field. This property is only required
// if `isValueRequired` property is set to `true`. The value should match the
// `type` of custom metadata field.
DefaultValue CustomMetadataFieldUpdateParamsSchemaDefaultValueUnion `json:"defaultValue,omitzero"`
// Maximum value of the field. Only set this property if field type is `Date` or
// `Number`. For `Date` type field, set the minimum date in ISO8601 string format.
// For `Number` type field, set the minimum numeric value.
MaxValue CustomMetadataFieldUpdateParamsSchemaMaxValueUnion `json:"maxValue,omitzero"`
// Minimum value of the field. Only set this property if field type is `Date` or
// `Number`. For `Date` type field, set the minimum date in ISO8601 string format.
// For `Number` type field, set the minimum numeric value.
MinValue CustomMetadataFieldUpdateParamsSchemaMinValueUnion `json:"minValue,omitzero"`
// An array of allowed values. This property is only required if `type` property is
// set to `SingleSelect` or `MultiSelect`.
SelectOptions []CustomMetadataFieldUpdateParamsSchemaSelectOptionUnion `json:"selectOptions,omitzero"`
// contains filtered or unexported fields
}
An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`.
func (CustomMetadataFieldUpdateParamsSchema) MarshalJSON ¶
func (r CustomMetadataFieldUpdateParamsSchema) MarshalJSON() (data []byte, err error)
func (*CustomMetadataFieldUpdateParamsSchema) UnmarshalJSON ¶
func (r *CustomMetadataFieldUpdateParamsSchema) UnmarshalJSON(data []byte) error
type CustomMetadataFieldUpdateParamsSchemaDefaultValueMixedItemUnion ¶
type CustomMetadataFieldUpdateParamsSchemaDefaultValueMixedItemUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `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 (CustomMetadataFieldUpdateParamsSchemaDefaultValueMixedItemUnion) MarshalJSON ¶
func (u CustomMetadataFieldUpdateParamsSchemaDefaultValueMixedItemUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldUpdateParamsSchemaDefaultValueMixedItemUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldUpdateParamsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldUpdateParamsSchemaDefaultValueUnion ¶
type CustomMetadataFieldUpdateParamsSchemaDefaultValueUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `json:",omitzero,inline"`
OfMixed []CustomMetadataFieldUpdateParamsSchemaDefaultValueMixedItemUnion `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 (CustomMetadataFieldUpdateParamsSchemaDefaultValueUnion) MarshalJSON ¶
func (u CustomMetadataFieldUpdateParamsSchemaDefaultValueUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldUpdateParamsSchemaDefaultValueUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldUpdateParamsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldUpdateParamsSchemaMaxValueUnion ¶
type CustomMetadataFieldUpdateParamsSchemaMaxValueUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `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 (CustomMetadataFieldUpdateParamsSchemaMaxValueUnion) MarshalJSON ¶
func (u CustomMetadataFieldUpdateParamsSchemaMaxValueUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldUpdateParamsSchemaMaxValueUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldUpdateParamsSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldUpdateParamsSchemaMinValueUnion ¶
type CustomMetadataFieldUpdateParamsSchemaMinValueUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `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 (CustomMetadataFieldUpdateParamsSchemaMinValueUnion) MarshalJSON ¶
func (u CustomMetadataFieldUpdateParamsSchemaMinValueUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldUpdateParamsSchemaMinValueUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldUpdateParamsSchemaMinValueUnion) UnmarshalJSON(data []byte) error
type CustomMetadataFieldUpdateParamsSchemaSelectOptionUnion ¶
type CustomMetadataFieldUpdateParamsSchemaSelectOptionUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfBool param.Opt[bool] `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 (CustomMetadataFieldUpdateParamsSchemaSelectOptionUnion) MarshalJSON ¶
func (u CustomMetadataFieldUpdateParamsSchemaSelectOptionUnion) MarshalJSON() ([]byte, error)
func (*CustomMetadataFieldUpdateParamsSchemaSelectOptionUnion) UnmarshalJSON ¶
func (u *CustomMetadataFieldUpdateParamsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
type DummyNewParams ¶
type DummyNewParams struct {
BaseOverlay shared.BaseOverlayParam `json:"baseOverlay,omitzero"`
// Array of extensions to be applied to the asset. Each extension can be configured
// with specific parameters based on the extension type.
Extensions shared.ExtensionsParam `json:"extensions,omitzero"`
ImageOverlay shared.ImageOverlayParam `json:"imageOverlay,omitzero"`
// Specifies an overlay to be applied on the parent image or video. ImageKit
// supports overlays including images, text, videos, subtitles, and solid colors.
// See
// [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers).
Overlay shared.OverlayUnionParam `json:"overlay,omitzero"`
OverlayPosition shared.OverlayPositionParam `json:"overlayPosition,omitzero"`
OverlayTiming shared.OverlayTimingParam `json:"overlayTiming,omitzero"`
SolidColorOverlay shared.SolidColorOverlayParam `json:"solidColorOverlay,omitzero"`
SolidColorOverlayTransformation shared.SolidColorOverlayTransformationParam `json:"solidColorOverlayTransformation,omitzero"`
// Options for generating ImageKit URLs with transformations. See the
// [Transformations guide](https://imagekit.io/docs/transformations).
SrcOptions shared.SrcOptionsParam `json:"srcOptions,omitzero"`
// Available streaming resolutions for
// [adaptive bitrate streaming](https://imagekit.io/docs/adaptive-bitrate-streaming)
//
// Any of "240", "360", "480", "720", "1080", "1440", "2160".
StreamingResolution shared.StreamingResolution `json:"streamingResolution,omitzero"`
SubtitleOverlay shared.SubtitleOverlayParam `json:"subtitleOverlay,omitzero"`
// Subtitle styling options.
// [Learn more](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer)
// from the docs.
SubtitleOverlayTransformation shared.SubtitleOverlayTransformationParam `json:"subtitleOverlayTransformation,omitzero"`
TextOverlay shared.TextOverlayParam `json:"textOverlay,omitzero"`
TextOverlayTransformation shared.TextOverlayTransformationParam `json:"textOverlayTransformation,omitzero"`
// The SDK provides easy-to-use names for transformations. These names are
// converted to the corresponding transformation string before being added to the
// URL. SDKs are updated regularly to support new transformations. If you want to
// use a transformation that is not supported by the SDK, You can use the `raw`
// parameter to pass the transformation string directly. See the
// [Transformations documentation](https://imagekit.io/docs/transformations).
Transformation shared.TransformationParam `json:"transformation,omitzero"`
// By default, the transformation string is added as a query parameter in the URL,
// e.g., `?tr=w-100,h-100`. If you want to add the transformation string in the
// path of the URL, set this to `path`. Learn more in the
// [Transformations guide](https://imagekit.io/docs/transformations).
//
// Any of "path", "query".
TransformationPosition shared.TransformationPosition `json:"transformationPosition,omitzero"`
VideoOverlay shared.VideoOverlayParam `json:"videoOverlay,omitzero"`
// contains filtered or unexported fields
}
func (DummyNewParams) MarshalJSON ¶
func (r DummyNewParams) MarshalJSON() (data []byte, err error)
func (*DummyNewParams) UnmarshalJSON ¶
func (r *DummyNewParams) UnmarshalJSON(data []byte) error
type DummyService ¶
type DummyService struct {
Options []option.RequestOption
}
DummyService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDummyService method instead.
func NewDummyService ¶
func NewDummyService(opts ...option.RequestOption) (r DummyService)
NewDummyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DummyService) New ¶
func (r *DummyService) New(ctx context.Context, body DummyNewParams, opts ...option.RequestOption) (err error)
Internal test endpoint for SDK generation purposes only. This endpoint demonstrates usage of all shared models defined in the Stainless configuration and is not intended for public consumption.
type ExtensionAIAutoDescriptionParam ¶
type ExtensionAIAutoDescriptionParam = shared.ExtensionAIAutoDescriptionParam
This is an alias to an internal type.
type ExtensionAutoTaggingParam ¶
type ExtensionAutoTaggingParam = shared.ExtensionAutoTaggingParam
This is an alias to an internal type.
type ExtensionRemoveBgOptionsParam ¶
type ExtensionRemoveBgOptionsParam = shared.ExtensionRemoveBgOptionsParam
This is an alias to an internal type.
type ExtensionRemoveBgParam ¶
type ExtensionRemoveBgParam = shared.ExtensionRemoveBgParam
This is an alias to an internal type.
type ExtensionUnionParam ¶
type ExtensionUnionParam = shared.ExtensionUnionParam
This is an alias to an internal type.
type ExtensionsParam ¶
type ExtensionsParam = shared.ExtensionsParam
Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type.
This is an alias to an internal type.
type File ¶
type File struct {
// An array of tags assigned to the file by auto tagging.
AITags []FileAITag `json:"AITags,nullable"`
// Date and time when the file was uploaded. The date and time is in ISO8601
// format.
CreatedAt time.Time `json:"createdAt" format:"date-time"`
// An string with custom coordinates of the file.
CustomCoordinates string `json:"customCoordinates,nullable"`
// An object with custom metadata for the file.
CustomMetadata map[string]any `json:"customMetadata"`
// Optional text to describe the contents of the file. Can be set by the user or
// the ai-auto-description extension.
Description string `json:"description"`
// Unique identifier of the asset.
FileID string `json:"fileId"`
// Path of the file. This is the path you would use in the URL to access the file.
// For example, if the file is at the root of the media library, the path will be
// `/file.jpg`. If the file is inside a folder named `images`, the path will be
// `/images/file.jpg`.
FilePath string `json:"filePath"`
// Type of the file. Possible values are `image`, `non-image`.
FileType string `json:"fileType"`
// Specifies if the image has an alpha channel.
HasAlpha bool `json:"hasAlpha"`
// Height of the file.
Height float64 `json:"height"`
// Specifies if the file is private or not.
IsPrivateFile bool `json:"isPrivateFile"`
// Specifies if the file is published or not.
IsPublished bool `json:"isPublished"`
// MIME type of the file.
Mime string `json:"mime"`
// Name of the asset.
Name string `json:"name"`
// This field is included in the response only if the Path policy feature is
// available in the plan. It contains schema definitions for the custom metadata
// fields selected for the specified file path. Field selection can only be done
// when the Path policy feature is enabled.
//
// Keys are the names of the custom metadata fields; the value object has details
// about the custom metadata schema.
SelectedFieldsSchema map[string]FileSelectedFieldsSchema `json:"selectedFieldsSchema"`
// Size of the file in bytes.
Size float64 `json:"size"`
// An array of tags assigned to the file. Tags are used to search files in the
// media library.
Tags []string `json:"tags,nullable"`
// URL of the thumbnail image. This URL is used to access the thumbnail image of
// the file in the media library.
Thumbnail string `json:"thumbnail" format:"uri"`
// Type of the asset.
//
// Any of "file", "file-version".
Type FileType `json:"type"`
// Date and time when the file was last updated. The date and time is in ISO8601
// format.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// URL of the file.
URL string `json:"url" format:"uri"`
// An object with details of the file version.
VersionInfo FileVersionInfo `json:"versionInfo"`
// Width of the file.
Width float64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AITags respjson.Field
CreatedAt respjson.Field
CustomCoordinates respjson.Field
CustomMetadata respjson.Field
Description respjson.Field
FileID respjson.Field
FilePath respjson.Field
FileType respjson.Field
HasAlpha respjson.Field
Height respjson.Field
IsPrivateFile respjson.Field
IsPublished respjson.Field
Mime respjson.Field
Name respjson.Field
SelectedFieldsSchema respjson.Field
Size respjson.Field
Tags respjson.Field
Thumbnail respjson.Field
Type respjson.Field
UpdatedAt respjson.Field
URL respjson.Field
VersionInfo respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object containing details of a file or file version.
func (*File) UnmarshalJSON ¶
type FileAITag ¶
type FileAITag struct {
// Confidence score of the tag.
Confidence float64 `json:"confidence"`
// Name of the tag.
Name string `json:"name"`
// Source of the tag. Possible values are `google-auto-tagging` and
// `aws-auto-tagging`.
Source string `json:"source"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Confidence respjson.Field
Name respjson.Field
Source respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*FileAITag) UnmarshalJSON ¶
type FileBulkAddTagsParams ¶
type FileBulkAddTagsParams struct {
// An array of fileIds to which you want to add tags.
FileIDs []string `json:"fileIds,omitzero,required"`
// An array of tags that you want to add to the files.
Tags []string `json:"tags,omitzero,required"`
// contains filtered or unexported fields
}
func (FileBulkAddTagsParams) MarshalJSON ¶
func (r FileBulkAddTagsParams) MarshalJSON() (data []byte, err error)
func (*FileBulkAddTagsParams) UnmarshalJSON ¶
func (r *FileBulkAddTagsParams) UnmarshalJSON(data []byte) error
type FileBulkAddTagsResponse ¶
type FileBulkAddTagsResponse struct {
// An array of fileIds that in which tags were successfully added.
SuccessfullyUpdatedFileIDs []string `json:"successfullyUpdatedFileIds"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SuccessfullyUpdatedFileIDs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileBulkAddTagsResponse) RawJSON ¶
func (r FileBulkAddTagsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileBulkAddTagsResponse) UnmarshalJSON ¶
func (r *FileBulkAddTagsResponse) UnmarshalJSON(data []byte) error
type FileBulkDeleteParams ¶
type FileBulkDeleteParams struct {
// An array of fileIds which you want to delete.
FileIDs []string `json:"fileIds,omitzero,required"`
// contains filtered or unexported fields
}
func (FileBulkDeleteParams) MarshalJSON ¶
func (r FileBulkDeleteParams) MarshalJSON() (data []byte, err error)
func (*FileBulkDeleteParams) UnmarshalJSON ¶
func (r *FileBulkDeleteParams) UnmarshalJSON(data []byte) error
type FileBulkDeleteResponse ¶
type FileBulkDeleteResponse struct {
// An array of fileIds that were successfully deleted.
SuccessfullyDeletedFileIDs []string `json:"successfullyDeletedFileIds"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SuccessfullyDeletedFileIDs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileBulkDeleteResponse) RawJSON ¶
func (r FileBulkDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileBulkDeleteResponse) UnmarshalJSON ¶
func (r *FileBulkDeleteResponse) UnmarshalJSON(data []byte) error
type FileBulkRemoveAITagsParams ¶
type FileBulkRemoveAITagsParams struct {
// An array of AITags that you want to remove from the files.
AITags []string `json:"AITags,omitzero,required"`
// An array of fileIds from which you want to remove AITags.
FileIDs []string `json:"fileIds,omitzero,required"`
// contains filtered or unexported fields
}
func (FileBulkRemoveAITagsParams) MarshalJSON ¶
func (r FileBulkRemoveAITagsParams) MarshalJSON() (data []byte, err error)
func (*FileBulkRemoveAITagsParams) UnmarshalJSON ¶
func (r *FileBulkRemoveAITagsParams) UnmarshalJSON(data []byte) error
type FileBulkRemoveAITagsResponse ¶
type FileBulkRemoveAITagsResponse struct {
// An array of fileIds that in which AITags were successfully removed.
SuccessfullyUpdatedFileIDs []string `json:"successfullyUpdatedFileIds"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SuccessfullyUpdatedFileIDs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileBulkRemoveAITagsResponse) RawJSON ¶
func (r FileBulkRemoveAITagsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileBulkRemoveAITagsResponse) UnmarshalJSON ¶
func (r *FileBulkRemoveAITagsResponse) UnmarshalJSON(data []byte) error
type FileBulkRemoveTagsParams ¶
type FileBulkRemoveTagsParams struct {
// An array of fileIds from which you want to remove tags.
FileIDs []string `json:"fileIds,omitzero,required"`
// An array of tags that you want to remove from the files.
Tags []string `json:"tags,omitzero,required"`
// contains filtered or unexported fields
}
func (FileBulkRemoveTagsParams) MarshalJSON ¶
func (r FileBulkRemoveTagsParams) MarshalJSON() (data []byte, err error)
func (*FileBulkRemoveTagsParams) UnmarshalJSON ¶
func (r *FileBulkRemoveTagsParams) UnmarshalJSON(data []byte) error
type FileBulkRemoveTagsResponse ¶
type FileBulkRemoveTagsResponse struct {
// An array of fileIds that in which tags were successfully removed.
SuccessfullyUpdatedFileIDs []string `json:"successfullyUpdatedFileIds"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SuccessfullyUpdatedFileIDs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileBulkRemoveTagsResponse) RawJSON ¶
func (r FileBulkRemoveTagsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileBulkRemoveTagsResponse) UnmarshalJSON ¶
func (r *FileBulkRemoveTagsResponse) UnmarshalJSON(data []byte) error
type FileBulkService ¶
type FileBulkService struct {
Options []option.RequestOption
}
FileBulkService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileBulkService method instead.
func NewFileBulkService ¶
func NewFileBulkService(opts ...option.RequestOption) (r FileBulkService)
NewFileBulkService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FileBulkService) AddTags ¶
func (r *FileBulkService) AddTags(ctx context.Context, body FileBulkAddTagsParams, opts ...option.RequestOption) (res *FileBulkAddTagsResponse, err error)
This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time.
func (*FileBulkService) Delete ¶
func (r *FileBulkService) Delete(ctx context.Context, body FileBulkDeleteParams, opts ...option.RequestOption) (res *FileBulkDeleteResponse, err error)
This API deletes multiple files and all their file versions permanently.
Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API.
A maximum of 100 files can be deleted at a time.
func (*FileBulkService) RemoveAITags ¶
func (r *FileBulkService) RemoveAITags(ctx context.Context, body FileBulkRemoveAITagsParams, opts ...option.RequestOption) (res *FileBulkRemoveAITagsResponse, err error)
This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time.
func (*FileBulkService) RemoveTags ¶
func (r *FileBulkService) RemoveTags(ctx context.Context, body FileBulkRemoveTagsParams, opts ...option.RequestOption) (res *FileBulkRemoveTagsResponse, err error)
This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time.
type FileCopyParams ¶
type FileCopyParams struct {
// Full path to the folder you want to copy the above file into.
DestinationPath string `json:"destinationPath,required"`
// The full path of the file you want to copy.
SourceFilePath string `json:"sourceFilePath,required"`
// Option to copy all versions of a file. By default, only the current version of
// the file is copied. When set to true, all versions of the file will be copied.
// Default value - `false`.
IncludeFileVersions param.Opt[bool] `json:"includeFileVersions,omitzero"`
// contains filtered or unexported fields
}
func (FileCopyParams) MarshalJSON ¶
func (r FileCopyParams) MarshalJSON() (data []byte, err error)
func (*FileCopyParams) UnmarshalJSON ¶
func (r *FileCopyParams) UnmarshalJSON(data []byte) error
type FileCopyResponse ¶
type FileCopyResponse struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileCopyResponse) RawJSON ¶
func (r FileCopyResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileCopyResponse) UnmarshalJSON ¶
func (r *FileCopyResponse) UnmarshalJSON(data []byte) error
type FileMetadataGetFromURLParams ¶
type FileMetadataGetFromURLParams struct {
// Should be a valid file URL. It should be accessible using your ImageKit.io
// account.
URL string `query:"url,required" format:"uri" json:"-"`
// contains filtered or unexported fields
}
func (FileMetadataGetFromURLParams) URLQuery ¶
func (r FileMetadataGetFromURLParams) URLQuery() (v url.Values, err error)
URLQuery serializes FileMetadataGetFromURLParams's query parameters as `url.Values`.
type FileMetadataService ¶
type FileMetadataService struct {
Options []option.RequestOption
}
FileMetadataService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileMetadataService method instead.
func NewFileMetadataService ¶
func NewFileMetadataService(opts ...option.RequestOption) (r FileMetadataService)
NewFileMetadataService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FileMetadataService) Get ¶
func (r *FileMetadataService) Get(ctx context.Context, fileID string, opts ...option.RequestOption) (res *Metadata, err error)
You can programmatically get image EXIF, pHash, and other metadata for uploaded files in the ImageKit.io media library using this API.
You can also get the metadata in upload API response by passing `metadata` in `responseFields` parameter.
func (*FileMetadataService) GetFromURL ¶
func (r *FileMetadataService) GetFromURL(ctx context.Context, query FileMetadataGetFromURLParams, opts ...option.RequestOption) (res *Metadata, err error)
Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API.
type FileMoveParams ¶
type FileMoveParams struct {
// Full path to the folder you want to move the above file into.
DestinationPath string `json:"destinationPath,required"`
// The full path of the file you want to move.
SourceFilePath string `json:"sourceFilePath,required"`
// contains filtered or unexported fields
}
func (FileMoveParams) MarshalJSON ¶
func (r FileMoveParams) MarshalJSON() (data []byte, err error)
func (*FileMoveParams) UnmarshalJSON ¶
func (r *FileMoveParams) UnmarshalJSON(data []byte) error
type FileMoveResponse ¶
type FileMoveResponse struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileMoveResponse) RawJSON ¶
func (r FileMoveResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileMoveResponse) UnmarshalJSON ¶
func (r *FileMoveResponse) UnmarshalJSON(data []byte) error
type FileRenameParams ¶
type FileRenameParams struct {
// The full path of the file you want to rename.
FilePath string `json:"filePath,required"`
// The new name of the file. A filename can contain:
//
// Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks,
// and numerals in other languages). Special Characters: `.`, `_`, and `-`.
//
// Any other character, including space, will be replaced by `_`.
NewFileName string `json:"newFileName,required"`
// Option to purge cache for the old file and its versions' URLs.
//
// When set to true, it will internally issue a purge cache request on CDN to
// remove cached content of old file and its versions. This purge request is
// counted against your monthly purge quota.
//
// Note: If the old file were accessible at
// `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be
// issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard
// at the end). It will remove the file and its versions' URLs and any
// transformations made using query parameters on this file or its versions.
// However, the cache for file transformations made using path parameters will
// persist. You can purge them using the purge API. For more details, refer to the
// purge API documentation.
//
// Default value - `false`
PurgeCache param.Opt[bool] `json:"purgeCache,omitzero"`
// contains filtered or unexported fields
}
func (FileRenameParams) MarshalJSON ¶
func (r FileRenameParams) MarshalJSON() (data []byte, err error)
func (*FileRenameParams) UnmarshalJSON ¶
func (r *FileRenameParams) UnmarshalJSON(data []byte) error
type FileRenameResponse ¶
type FileRenameResponse struct {
// Unique identifier of the purge request. This can be used to check the status of
// the purge request.
PurgeRequestID string `json:"purgeRequestId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PurgeRequestID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileRenameResponse) RawJSON ¶
func (r FileRenameResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileRenameResponse) UnmarshalJSON ¶
func (r *FileRenameResponse) UnmarshalJSON(data []byte) error
type FileSelectedFieldsSchema ¶
type FileSelectedFieldsSchema struct {
// Type of the custom metadata field.
//
// Any of "Text", "Textarea", "Number", "Date", "Boolean", "SingleSelect",
// "MultiSelect".
Type string `json:"type,required"`
// The default value for this custom metadata field. The value should match the
// `type` of custom metadata field.
DefaultValue FileSelectedFieldsSchemaDefaultValueUnion `json:"defaultValue"`
// Specifies if the custom metadata field is required or not.
IsValueRequired bool `json:"isValueRequired"`
// Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
MaxLength float64 `json:"maxLength"`
// Maximum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MaxValue FileSelectedFieldsSchemaMaxValueUnion `json:"maxValue"`
// Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
MinLength float64 `json:"minLength"`
// Minimum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MinValue FileSelectedFieldsSchemaMinValueUnion `json:"minValue"`
// Indicates whether the custom metadata field is read only. A read only field
// cannot be modified after being set. This field is configurable only via the
// **Path policy** feature.
ReadOnly bool `json:"readOnly"`
// An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
SelectOptions []FileSelectedFieldsSchemaSelectOptionUnion `json:"selectOptions"`
// Specifies if the selectOptions array is truncated. It is truncated when number
// of options are > 100.
SelectOptionsTruncated bool `json:"selectOptionsTruncated"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
DefaultValue respjson.Field
IsValueRequired respjson.Field
MaxLength respjson.Field
MaxValue respjson.Field
MinLength respjson.Field
MinValue respjson.Field
ReadOnly respjson.Field
SelectOptions respjson.Field
SelectOptionsTruncated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileSelectedFieldsSchema) RawJSON ¶
func (r FileSelectedFieldsSchema) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileSelectedFieldsSchema) UnmarshalJSON ¶
func (r *FileSelectedFieldsSchema) UnmarshalJSON(data []byte) error
type FileSelectedFieldsSchemaDefaultValueMixedItemUnion ¶
type FileSelectedFieldsSchemaDefaultValueMixedItemUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileSelectedFieldsSchemaDefaultValueMixedItemUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (FileSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool ¶
func (u FileSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
func (FileSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat ¶
func (u FileSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
func (FileSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString ¶
func (u FileSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString() (v string)
func (FileSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON ¶
func (u FileSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON ¶
func (r *FileSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
type FileSelectedFieldsSchemaDefaultValueUnion ¶
type FileSelectedFieldsSchemaDefaultValueUnion 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
// [[]FileSelectedFieldsSchemaDefaultValueMixedItemUnion] instead of an object.
OfMixed []FileSelectedFieldsSchemaDefaultValueMixedItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
OfMixed respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileSelectedFieldsSchemaDefaultValueUnion contains all possible properties and values from [string], [float64], [bool], [[]FileSelectedFieldsSchemaDefaultValueMixedItemUnion].
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 OfMixed]
func (FileSelectedFieldsSchemaDefaultValueUnion) AsBool ¶
func (u FileSelectedFieldsSchemaDefaultValueUnion) AsBool() (v bool)
func (FileSelectedFieldsSchemaDefaultValueUnion) AsFloat ¶
func (u FileSelectedFieldsSchemaDefaultValueUnion) AsFloat() (v float64)
func (FileSelectedFieldsSchemaDefaultValueUnion) AsMixed ¶
func (u FileSelectedFieldsSchemaDefaultValueUnion) AsMixed() (v []FileSelectedFieldsSchemaDefaultValueMixedItemUnion)
func (FileSelectedFieldsSchemaDefaultValueUnion) AsString ¶
func (u FileSelectedFieldsSchemaDefaultValueUnion) AsString() (v string)
func (FileSelectedFieldsSchemaDefaultValueUnion) RawJSON ¶
func (u FileSelectedFieldsSchemaDefaultValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON ¶
func (r *FileSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
type FileSelectedFieldsSchemaMaxValueUnion ¶
type FileSelectedFieldsSchemaMaxValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileSelectedFieldsSchemaMaxValueUnion contains all possible properties and values from [string], [float64].
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]
func (FileSelectedFieldsSchemaMaxValueUnion) AsFloat ¶
func (u FileSelectedFieldsSchemaMaxValueUnion) AsFloat() (v float64)
func (FileSelectedFieldsSchemaMaxValueUnion) AsString ¶
func (u FileSelectedFieldsSchemaMaxValueUnion) AsString() (v string)
func (FileSelectedFieldsSchemaMaxValueUnion) RawJSON ¶
func (u FileSelectedFieldsSchemaMaxValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON ¶
func (r *FileSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
type FileSelectedFieldsSchemaMinValueUnion ¶
type FileSelectedFieldsSchemaMinValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileSelectedFieldsSchemaMinValueUnion contains all possible properties and values from [string], [float64].
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]
func (FileSelectedFieldsSchemaMinValueUnion) AsFloat ¶
func (u FileSelectedFieldsSchemaMinValueUnion) AsFloat() (v float64)
func (FileSelectedFieldsSchemaMinValueUnion) AsString ¶
func (u FileSelectedFieldsSchemaMinValueUnion) AsString() (v string)
func (FileSelectedFieldsSchemaMinValueUnion) RawJSON ¶
func (u FileSelectedFieldsSchemaMinValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileSelectedFieldsSchemaMinValueUnion) UnmarshalJSON ¶
func (r *FileSelectedFieldsSchemaMinValueUnion) UnmarshalJSON(data []byte) error
type FileSelectedFieldsSchemaSelectOptionUnion ¶
type FileSelectedFieldsSchemaSelectOptionUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileSelectedFieldsSchemaSelectOptionUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (FileSelectedFieldsSchemaSelectOptionUnion) AsBool ¶
func (u FileSelectedFieldsSchemaSelectOptionUnion) AsBool() (v bool)
func (FileSelectedFieldsSchemaSelectOptionUnion) AsFloat ¶
func (u FileSelectedFieldsSchemaSelectOptionUnion) AsFloat() (v float64)
func (FileSelectedFieldsSchemaSelectOptionUnion) AsString ¶
func (u FileSelectedFieldsSchemaSelectOptionUnion) AsString() (v string)
func (FileSelectedFieldsSchemaSelectOptionUnion) RawJSON ¶
func (u FileSelectedFieldsSchemaSelectOptionUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON ¶
func (r *FileSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
type FileService ¶
type FileService struct {
Options []option.RequestOption
Bulk FileBulkService
Versions FileVersionService
Metadata FileMetadataService
}
FileService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileService method instead.
func NewFileService ¶
func NewFileService(opts ...option.RequestOption) (r FileService)
NewFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FileService) Copy ¶
func (r *FileService) Copy(ctx context.Context, body FileCopyParams, opts ...option.RequestOption) (res *FileCopyResponse, err error)
This will copy a file from one folder to another.
Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history.
func (*FileService) Delete ¶
func (r *FileService) Delete(ctx context.Context, fileID string, opts ...option.RequestOption) (err error)
This API deletes the file and all its file versions permanently.
Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API.
func (*FileService) Get ¶
func (r *FileService) Get(ctx context.Context, fileID string, opts ...option.RequestOption) (res *File, err error)
This API returns an object with details or attributes about the current version of the file.
func (*FileService) Move ¶
func (r *FileService) Move(ctx context.Context, body FileMoveParams, opts ...option.RequestOption) (res *FileMoveResponse, err error)
This will move a file and all its versions from one folder to another.
Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file.
func (*FileService) Rename ¶
func (r *FileService) Rename(ctx context.Context, body FileRenameParams, opts ...option.RequestOption) (res *FileRenameResponse, err error)
You can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file.
Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested.
func (*FileService) Update ¶
func (r *FileService) Update(ctx context.Context, fileID string, body FileUpdateParams, opts ...option.RequestOption) (res *FileUpdateResponse, err error)
This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API.
func (*FileService) Upload ¶
func (r *FileService) Upload(ctx context.Context, body FileUploadParams, opts ...option.RequestOption) (res *FileUploadResponse, err error)
ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload.
The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security by verifying the entire payload using JWT.
**File size limit** \ On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with higher-tier plans.
**Version limit** \ A file can have a maximum of 100 versions.
**Demo applications**
- A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more.
- [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies.
type FileUpdateParams ¶
type FileUpdateParams struct {
// Schema for update file update request.
UpdateFileRequest UpdateFileRequestUnionParam
// contains filtered or unexported fields
}
func (FileUpdateParams) MarshalJSON ¶
func (r FileUpdateParams) MarshalJSON() (data []byte, err error)
func (*FileUpdateParams) UnmarshalJSON ¶
func (r *FileUpdateParams) UnmarshalJSON(data []byte) error
type FileUpdateResponse ¶
type FileUpdateResponse struct {
ExtensionStatus FileUpdateResponseExtensionStatus `json:"extensionStatus"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtensionStatus respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
File
}
Object containing details of a file or file version.
func (FileUpdateResponse) RawJSON ¶
func (r FileUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUpdateResponse) UnmarshalJSON ¶
func (r *FileUpdateResponse) UnmarshalJSON(data []byte) error
type FileUpdateResponseExtensionStatus ¶
type FileUpdateResponseExtensionStatus struct {
// Any of "success", "pending", "failed".
AIAutoDescription string `json:"ai-auto-description"`
// Any of "success", "pending", "failed".
AwsAutoTagging string `json:"aws-auto-tagging"`
// Any of "success", "pending", "failed".
GoogleAutoTagging string `json:"google-auto-tagging"`
// Any of "success", "pending", "failed".
RemoveBg string `json:"remove-bg"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AIAutoDescription respjson.Field
AwsAutoTagging respjson.Field
GoogleAutoTagging respjson.Field
RemoveBg respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileUpdateResponseExtensionStatus) RawJSON ¶
func (r FileUpdateResponseExtensionStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUpdateResponseExtensionStatus) UnmarshalJSON ¶
func (r *FileUpdateResponseExtensionStatus) UnmarshalJSON(data []byte) error
type FileUploadParams ¶
type FileUploadParams struct {
// File is the upload payload. It MUST be a non-nil io.Reader (e.g., *os.File,
// *bytes.Reader, *bytes.Buffer, *strings.Reader, or any stream).
File io.Reader `json:"file,omitzero,required" format:"binary"`
// The name with which the file has to be uploaded. The file name can contain:
//
// - Alphanumeric Characters: `a-z`, `A-Z`, `0-9`.
// - Special Characters: `.`, `-`
//
// Any other character including space will be replaced by `_`
FileName string `json:"fileName,required"`
// A unique value that the ImageKit.io server will use to recognize and prevent
// subsequent retries for the same request. We suggest using V4 UUIDs, or another
// random string with enough entropy to avoid collisions. This field is only
// required for authentication when uploading a file from the client side.
//
// **Note**: Sending a value that has been used in the past will result in a
// validation error. Even if your previous request resulted in an error, you should
// always send a new value for this field.
Token param.Opt[string] `json:"token,omitzero"`
// Server-side checks to run on the asset. Read more about
// [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks).
Checks param.Opt[string] `json:"checks,omitzero"`
// Define an important area in the image. This is only relevant for image type
// files.
//
// - To be passed as a string with the x and y coordinates of the top-left corner,
// and width and height of the area of interest in the format `x,y,width,height`.
// For example - `10,10,100,100`
// - Can be used with fo-customtransformation.
// - If this field is not specified and the file is overwritten, then
// customCoordinates will be removed.
CustomCoordinates param.Opt[string] `json:"customCoordinates,omitzero"`
// Optional text to describe the contents of the file.
Description param.Opt[string] `json:"description,omitzero"`
// The time until your signature is valid. It must be a
// [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into
// the future. It should be in seconds. This field is only required for
// authentication when uploading a file from the client side.
Expire param.Opt[int64] `json:"expire,omitzero"`
// The folder path in which the image has to be uploaded. If the folder(s) didn't
// exist before, a new folder(s) is created.
//
// The folder name can contain:
//
// - Alphanumeric Characters: `a-z` , `A-Z` , `0-9`
// - Special Characters: `/` , `_` , `-`
//
// Using multiple `/` creates a nested folder.
Folder param.Opt[string] `json:"folder,omitzero"`
// Whether to mark the file as private or not.
//
// If `true`, the file is marked as private and is accessible only using named
// transformation or signed URL.
IsPrivateFile param.Opt[bool] `json:"isPrivateFile,omitzero"`
// Whether to upload file as published or not.
//
// If `false`, the file is marked as unpublished, which restricts access to the
// file only via the media library. Files in draft or unpublished state can only be
// publicly accessed after being published.
//
// The option to upload in draft state is only available in custom enterprise
// pricing plans.
IsPublished param.Opt[bool] `json:"isPublished,omitzero"`
// If set to `true` and a file already exists at the exact location, its AITags
// will be removed. Set `overwriteAITags` to `false` to preserve AITags.
OverwriteAITags param.Opt[bool] `json:"overwriteAITags,omitzero"`
// If the request does not have `customMetadata`, and a file already exists at the
// exact location, existing customMetadata will be removed.
OverwriteCustomMetadata param.Opt[bool] `json:"overwriteCustomMetadata,omitzero"`
// If `false` and `useUniqueFileName` is also `false`, and a file already exists at
// the exact location, upload API will return an error immediately.
OverwriteFile param.Opt[bool] `json:"overwriteFile,omitzero"`
// If the request does not have `tags`, and a file already exists at the exact
// location, existing tags will be removed.
OverwriteTags param.Opt[bool] `json:"overwriteTags,omitzero"`
// Your ImageKit.io public key. This field is only required for authentication when
// uploading a file from the client side.
PublicKey param.Opt[string] `json:"publicKey,omitzero"`
// HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a
// key. Learn how to create a signature on the page below. This should be in
// lowercase.
//
// Signature must be calculated on the server-side. This field is only required for
// authentication when uploading a file from the client side.
Signature param.Opt[string] `json:"signature,omitzero"`
// Whether to use a unique filename for this file or not.
//
// If `true`, ImageKit.io will add a unique suffix to the filename parameter to get
// a unique filename.
//
// If `false`, then the image is uploaded with the provided filename parameter, and
// any existing file with the same name is replaced.
UseUniqueFileName param.Opt[bool] `json:"useUniqueFileName,omitzero"`
// The final status of extensions after they have completed execution will be
// delivered to this endpoint as a POST request.
// [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure)
// about the webhook payload structure.
WebhookURL param.Opt[string] `json:"webhookUrl,omitzero" format:"uri"`
// JSON key-value pairs to associate with the asset. Create the custom metadata
// fields before setting these values.
CustomMetadata map[string]any `json:"customMetadata,omitzero"`
// Array of extensions to be applied to the asset. Each extension can be configured
// with specific parameters based on the extension type.
Extensions shared.ExtensionsParam `json:"extensions,omitzero"`
// Array of response field keys to include in the API response body.
//
// Any of "tags", "customCoordinates", "isPrivateFile", "embeddedMetadata",
// "isPublished", "customMetadata", "metadata", "selectedFieldsSchema".
ResponseFields []string `json:"responseFields,omitzero"`
// Set the tags while uploading the file. Provide an array of tag strings (e.g.
// `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not
// exceed 500, and the `%` character is not allowed. If this field is not specified
// and the file is overwritten, the existing tags will be removed.
Tags []string `json:"tags,omitzero"`
// Configure pre-processing (`pre`) and post-processing (`post`) transformations.
//
// - `pre` — applied before the file is uploaded to the Media Library.
// Useful for reducing file size or applying basic optimizations upfront (e.g.,
// resize, compress).
//
// - `post` — applied immediately after upload.
// Ideal for generating transformed versions (like video encodes or thumbnails)
// in advance, so they're ready for delivery without delay.
//
// You can mix and match any combination of post-processing types.
Transformation FileUploadParamsTransformation `json:"transformation,omitzero"`
// contains filtered or unexported fields
}
func (FileUploadParams) MarshalMultipart ¶
func (r FileUploadParams) MarshalMultipart() (data []byte, contentType string, err error)
type FileUploadParamsTransformation ¶
type FileUploadParamsTransformation struct {
// Transformation string to apply before uploading the file to the Media Library.
// Useful for optimizing files at ingestion.
Pre param.Opt[string] `json:"pre,omitzero"`
// List of transformations to apply _after_ the file is uploaded.
// Each item must match one of the following types: `transformation`,
// `gif-to-video`, `thumbnail`, `abs`.
Post []FileUploadParamsTransformationPostUnion `json:"post,omitzero"`
// contains filtered or unexported fields
}
Configure pre-processing (`pre`) and post-processing (`post`) transformations.
`pre` — applied before the file is uploaded to the Media Library. Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress).
`post` — applied immediately after upload. Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay.
You can mix and match any combination of post-processing types.
func (FileUploadParamsTransformation) MarshalJSON ¶
func (r FileUploadParamsTransformation) MarshalJSON() (data []byte, err error)
func (*FileUploadParamsTransformation) UnmarshalJSON ¶
func (r *FileUploadParamsTransformation) UnmarshalJSON(data []byte) error
type FileUploadParamsTransformationPostAbs ¶
type FileUploadParamsTransformationPostAbs struct {
// Streaming protocol to use (`hls` or `dash`).
//
// Any of "hls", "dash".
Protocol string `json:"protocol,omitzero,required"`
// List of different representations you want to create separated by an underscore.
Value string `json:"value,required"`
// Adaptive Bitrate Streaming (ABS) setup.
//
// This field can be elided, and will marshal its zero value as "abs".
Type constant.Abs `json:"type,required"`
// contains filtered or unexported fields
}
The properties Protocol, Type, Value are required.
func (FileUploadParamsTransformationPostAbs) MarshalJSON ¶
func (r FileUploadParamsTransformationPostAbs) MarshalJSON() (data []byte, err error)
func (*FileUploadParamsTransformationPostAbs) UnmarshalJSON ¶
func (r *FileUploadParamsTransformationPostAbs) UnmarshalJSON(data []byte) error
type FileUploadParamsTransformationPostGifToVideo ¶
type FileUploadParamsTransformationPostGifToVideo struct {
// Optional transformation string to apply to the output video.
// **Example**: `q-80`
Value param.Opt[string] `json:"value,omitzero"`
// Converts an animated GIF into an MP4.
//
// This field can be elided, and will marshal its zero value as "gif-to-video".
Type constant.GifToVideo `json:"type,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (FileUploadParamsTransformationPostGifToVideo) MarshalJSON ¶
func (r FileUploadParamsTransformationPostGifToVideo) MarshalJSON() (data []byte, err error)
func (*FileUploadParamsTransformationPostGifToVideo) UnmarshalJSON ¶
func (r *FileUploadParamsTransformationPostGifToVideo) UnmarshalJSON(data []byte) error
type FileUploadParamsTransformationPostThumbnail ¶
type FileUploadParamsTransformationPostThumbnail struct {
// Optional transformation string.
// **Example**: `w-150,h-150`
Value param.Opt[string] `json:"value,omitzero"`
// Generates a thumbnail image.
//
// This field can be elided, and will marshal its zero value as "thumbnail".
Type constant.Thumbnail `json:"type,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (FileUploadParamsTransformationPostThumbnail) MarshalJSON ¶
func (r FileUploadParamsTransformationPostThumbnail) MarshalJSON() (data []byte, err error)
func (*FileUploadParamsTransformationPostThumbnail) UnmarshalJSON ¶
func (r *FileUploadParamsTransformationPostThumbnail) UnmarshalJSON(data []byte) error
type FileUploadParamsTransformationPostTransformation ¶
type FileUploadParamsTransformationPostTransformation struct {
// Transformation string (e.g. `w-200,h-200`).
// Same syntax as ImageKit URL-based transformations.
Value string `json:"value,required"`
// Transformation type.
//
// This field can be elided, and will marshal its zero value as "transformation".
Type constant.Transformation `json:"type,required"`
// contains filtered or unexported fields
}
The properties Type, Value are required.
func (FileUploadParamsTransformationPostTransformation) MarshalJSON ¶
func (r FileUploadParamsTransformationPostTransformation) MarshalJSON() (data []byte, err error)
func (*FileUploadParamsTransformationPostTransformation) UnmarshalJSON ¶
func (r *FileUploadParamsTransformationPostTransformation) UnmarshalJSON(data []byte) error
type FileUploadParamsTransformationPostUnion ¶
type FileUploadParamsTransformationPostUnion struct {
OfTransformation *FileUploadParamsTransformationPostTransformation `json:",omitzero,inline"`
OfGifToVideo *FileUploadParamsTransformationPostGifToVideo `json:",omitzero,inline"`
OfThumbnail *FileUploadParamsTransformationPostThumbnail `json:",omitzero,inline"`
OfAbs *FileUploadParamsTransformationPostAbs `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 (FileUploadParamsTransformationPostUnion) GetProtocol ¶
func (u FileUploadParamsTransformationPostUnion) GetProtocol() *string
Returns a pointer to the underlying variant's property, if present.
func (FileUploadParamsTransformationPostUnion) GetType ¶
func (u FileUploadParamsTransformationPostUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (FileUploadParamsTransformationPostUnion) GetValue ¶
func (u FileUploadParamsTransformationPostUnion) GetValue() *string
Returns a pointer to the underlying variant's property, if present.
func (FileUploadParamsTransformationPostUnion) MarshalJSON ¶
func (u FileUploadParamsTransformationPostUnion) MarshalJSON() ([]byte, error)
func (*FileUploadParamsTransformationPostUnion) UnmarshalJSON ¶
func (u *FileUploadParamsTransformationPostUnion) UnmarshalJSON(data []byte) error
type FileUploadResponse ¶
type FileUploadResponse struct {
// An array of tags assigned to the uploaded file by auto tagging.
AITags []FileUploadResponseAITag `json:"AITags,nullable"`
// The audio codec used in the video (only for video).
AudioCodec string `json:"audioCodec"`
// The bit rate of the video in kbps (only for video).
BitRate int64 `json:"bitRate"`
// Value of custom coordinates associated with the image in the format
// `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`.
// Send `customCoordinates` in `responseFields` in API request to get the value of
// this field.
CustomCoordinates string `json:"customCoordinates,nullable"`
// A key-value data associated with the asset. Use `responseField` in API request
// to get `customMetadata` in the upload API response. Before setting any custom
// metadata on an asset, you have to create the field using custom metadata fields
// API. Send `customMetadata` in `responseFields` in API request to get the value
// of this field.
CustomMetadata map[string]any `json:"customMetadata"`
// Optional text to describe the contents of the file. Can be set by the user or
// the ai-auto-description extension.
Description string `json:"description"`
// The duration of the video in seconds (only for video).
Duration int64 `json:"duration"`
// Consolidated embedded metadata associated with the file. It includes exif, iptc,
// and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get
// embeddedMetadata in the upload API response.
EmbeddedMetadata map[string]any `json:"embeddedMetadata"`
// Extension names with their processing status at the time of completion of the
// request. It could have one of the following status values:
//
// `success`: The extension has been successfully applied. `failed`: The extension
// has failed and will not be retried. `pending`: The extension will finish
// processing in some time. On completion, the final status (success / failed) will
// be sent to the `webhookUrl` provided.
//
// If no extension was requested, then this parameter is not returned.
ExtensionStatus FileUploadResponseExtensionStatus `json:"extensionStatus"`
// Unique fileId. Store this fileld in your database, as this will be used to
// perform update action on this file.
FileID string `json:"fileId"`
// The relative path of the file in the media library e.g.
// `/marketing-assets/new-banner.jpg`.
FilePath string `json:"filePath"`
// Type of the uploaded file. Possible values are `image`, `non-image`.
FileType string `json:"fileType"`
// Height of the image in pixels (Only for images)
Height float64 `json:"height"`
// Is the file marked as private. It can be either `true` or `false`. Send
// `isPrivateFile` in `responseFields` in API request to get the value of this
// field.
IsPrivateFile bool `json:"isPrivateFile"`
// Is the file published or in draft state. It can be either `true` or `false`.
// Send `isPublished` in `responseFields` in API request to get the value of this
// field.
IsPublished bool `json:"isPublished"`
// Legacy metadata. Send `metadata` in `responseFields` in API request to get
// metadata in the upload API response.
Metadata Metadata `json:"metadata"`
// Name of the asset.
Name string `json:"name"`
// This field is included in the response only if the Path policy feature is
// available in the plan. It contains schema definitions for the custom metadata
// fields selected for the specified file path. Field selection can only be done
// when the Path policy feature is enabled.
//
// Keys are the names of the custom metadata fields; the value object has details
// about the custom metadata schema.
SelectedFieldsSchema map[string]FileUploadResponseSelectedFieldsSchema `json:"selectedFieldsSchema"`
// Size of the image file in Bytes.
Size float64 `json:"size"`
// The array of tags associated with the asset. If no tags are set, it will be
// `null`. Send `tags` in `responseFields` in API request to get the value of this
// field.
Tags []string `json:"tags,nullable"`
// In the case of an image, a small thumbnail URL.
ThumbnailURL string `json:"thumbnailUrl"`
// A publicly accessible URL of the file.
URL string `json:"url"`
// An object containing the file or file version's `id` (versionId) and `name`.
VersionInfo FileUploadResponseVersionInfo `json:"versionInfo"`
// The video codec used in the video (only for video).
VideoCodec string `json:"videoCodec"`
// Width of the image in pixels (Only for Images)
Width float64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AITags respjson.Field
AudioCodec respjson.Field
BitRate respjson.Field
CustomCoordinates respjson.Field
CustomMetadata respjson.Field
Description respjson.Field
Duration respjson.Field
EmbeddedMetadata respjson.Field
ExtensionStatus respjson.Field
FileID respjson.Field
FilePath respjson.Field
FileType respjson.Field
Height respjson.Field
IsPrivateFile respjson.Field
IsPublished respjson.Field
Metadata respjson.Field
Name respjson.Field
SelectedFieldsSchema respjson.Field
Size respjson.Field
Tags respjson.Field
ThumbnailURL respjson.Field
URL respjson.Field
VersionInfo respjson.Field
VideoCodec respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object containing details of a successful upload.
func (FileUploadResponse) RawJSON ¶
func (r FileUploadResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponse) UnmarshalJSON ¶
func (r *FileUploadResponse) UnmarshalJSON(data []byte) error
type FileUploadResponseAITag ¶
type FileUploadResponseAITag struct {
// Confidence score of the tag.
Confidence float64 `json:"confidence"`
// Name of the tag.
Name string `json:"name"`
// Array of `AITags` associated with the image. If no `AITags` are set, it will be
// null. These tags can be added using the `google-auto-tagging` or
// `aws-auto-tagging` extensions.
Source string `json:"source"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Confidence respjson.Field
Name respjson.Field
Source respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileUploadResponseAITag) RawJSON ¶
func (r FileUploadResponseAITag) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponseAITag) UnmarshalJSON ¶
func (r *FileUploadResponseAITag) UnmarshalJSON(data []byte) error
type FileUploadResponseExtensionStatus ¶
type FileUploadResponseExtensionStatus struct {
// Any of "success", "pending", "failed".
AIAutoDescription string `json:"ai-auto-description"`
// Any of "success", "pending", "failed".
AwsAutoTagging string `json:"aws-auto-tagging"`
// Any of "success", "pending", "failed".
GoogleAutoTagging string `json:"google-auto-tagging"`
// Any of "success", "pending", "failed".
RemoveBg string `json:"remove-bg"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AIAutoDescription respjson.Field
AwsAutoTagging respjson.Field
GoogleAutoTagging respjson.Field
RemoveBg respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Extension names with their processing status at the time of completion of the request. It could have one of the following status values:
`success`: The extension has been successfully applied. `failed`: The extension has failed and will not be retried. `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided.
If no extension was requested, then this parameter is not returned.
func (FileUploadResponseExtensionStatus) RawJSON ¶
func (r FileUploadResponseExtensionStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponseExtensionStatus) UnmarshalJSON ¶
func (r *FileUploadResponseExtensionStatus) UnmarshalJSON(data []byte) error
type FileUploadResponseSelectedFieldsSchema ¶
type FileUploadResponseSelectedFieldsSchema struct {
// Type of the custom metadata field.
//
// Any of "Text", "Textarea", "Number", "Date", "Boolean", "SingleSelect",
// "MultiSelect".
Type string `json:"type,required"`
// The default value for this custom metadata field. The value should match the
// `type` of custom metadata field.
DefaultValue FileUploadResponseSelectedFieldsSchemaDefaultValueUnion `json:"defaultValue"`
// Specifies if the custom metadata field is required or not.
IsValueRequired bool `json:"isValueRequired"`
// Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
MaxLength float64 `json:"maxLength"`
// Maximum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MaxValue FileUploadResponseSelectedFieldsSchemaMaxValueUnion `json:"maxValue"`
// Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
MinLength float64 `json:"minLength"`
// Minimum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MinValue FileUploadResponseSelectedFieldsSchemaMinValueUnion `json:"minValue"`
// Indicates whether the custom metadata field is read only. A read only field
// cannot be modified after being set. This field is configurable only via the
// **Path policy** feature.
ReadOnly bool `json:"readOnly"`
// An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
SelectOptions []FileUploadResponseSelectedFieldsSchemaSelectOptionUnion `json:"selectOptions"`
// Specifies if the selectOptions array is truncated. It is truncated when number
// of options are > 100.
SelectOptionsTruncated bool `json:"selectOptionsTruncated"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
DefaultValue respjson.Field
IsValueRequired respjson.Field
MaxLength respjson.Field
MaxValue respjson.Field
MinLength respjson.Field
MinValue respjson.Field
ReadOnly respjson.Field
SelectOptions respjson.Field
SelectOptionsTruncated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileUploadResponseSelectedFieldsSchema) RawJSON ¶
func (r FileUploadResponseSelectedFieldsSchema) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponseSelectedFieldsSchema) UnmarshalJSON ¶
func (r *FileUploadResponseSelectedFieldsSchema) UnmarshalJSON(data []byte) error
type FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion ¶
type FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool ¶
func (u FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
func (FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat ¶
func (u FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
func (FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString ¶
func (u FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString() (v string)
func (FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON ¶
func (u FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON ¶
func (r *FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
type FileUploadResponseSelectedFieldsSchemaDefaultValueUnion ¶
type FileUploadResponseSelectedFieldsSchemaDefaultValueUnion 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
// [[]FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion] instead of
// an object.
OfMixed []FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
OfMixed respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileUploadResponseSelectedFieldsSchemaDefaultValueUnion contains all possible properties and values from [string], [float64], [bool], [[]FileUploadResponseSelectedFieldsSchemaDefaultValueMixedItemUnion].
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 OfMixed]
func (FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsBool ¶
func (u FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsBool() (v bool)
func (FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsFloat ¶
func (u FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsFloat() (v float64)
func (FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsString ¶
func (u FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) AsString() (v string)
func (FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) RawJSON ¶
func (u FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON ¶
func (r *FileUploadResponseSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
type FileUploadResponseSelectedFieldsSchemaMaxValueUnion ¶
type FileUploadResponseSelectedFieldsSchemaMaxValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileUploadResponseSelectedFieldsSchemaMaxValueUnion contains all possible properties and values from [string], [float64].
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]
func (FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsFloat ¶
func (u FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsFloat() (v float64)
func (FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsString ¶
func (u FileUploadResponseSelectedFieldsSchemaMaxValueUnion) AsString() (v string)
func (FileUploadResponseSelectedFieldsSchemaMaxValueUnion) RawJSON ¶
func (u FileUploadResponseSelectedFieldsSchemaMaxValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponseSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON ¶
func (r *FileUploadResponseSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
type FileUploadResponseSelectedFieldsSchemaMinValueUnion ¶
type FileUploadResponseSelectedFieldsSchemaMinValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileUploadResponseSelectedFieldsSchemaMinValueUnion contains all possible properties and values from [string], [float64].
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]
func (FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsFloat ¶
func (u FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsFloat() (v float64)
func (FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsString ¶
func (u FileUploadResponseSelectedFieldsSchemaMinValueUnion) AsString() (v string)
func (FileUploadResponseSelectedFieldsSchemaMinValueUnion) RawJSON ¶
func (u FileUploadResponseSelectedFieldsSchemaMinValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponseSelectedFieldsSchemaMinValueUnion) UnmarshalJSON ¶
func (r *FileUploadResponseSelectedFieldsSchemaMinValueUnion) UnmarshalJSON(data []byte) error
type FileUploadResponseSelectedFieldsSchemaSelectOptionUnion ¶
type FileUploadResponseSelectedFieldsSchemaSelectOptionUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FileUploadResponseSelectedFieldsSchemaSelectOptionUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsBool ¶
func (u FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsBool() (v bool)
func (FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsFloat ¶
func (u FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsFloat() (v float64)
func (FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsString ¶
func (u FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) AsString() (v string)
func (FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) RawJSON ¶
func (u FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON ¶
func (r *FileUploadResponseSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
type FileUploadResponseVersionInfo ¶
type FileUploadResponseVersionInfo struct {
// Unique identifier of the file version.
ID string `json:"id"`
// Name of the file version.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An object containing the file or file version's `id` (versionId) and `name`.
func (FileUploadResponseVersionInfo) RawJSON ¶
func (r FileUploadResponseVersionInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileUploadResponseVersionInfo) UnmarshalJSON ¶
func (r *FileUploadResponseVersionInfo) UnmarshalJSON(data []byte) error
type FileVersionDeleteParams ¶
type FileVersionDeleteParams struct {
FileID string `path:"fileId,required" json:"-"`
// contains filtered or unexported fields
}
type FileVersionDeleteResponse ¶
type FileVersionDeleteResponse struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FileVersionDeleteResponse) RawJSON ¶
func (r FileVersionDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileVersionDeleteResponse) UnmarshalJSON ¶
func (r *FileVersionDeleteResponse) UnmarshalJSON(data []byte) error
type FileVersionGetParams ¶
type FileVersionGetParams struct {
FileID string `path:"fileId,required" json:"-"`
// contains filtered or unexported fields
}
type FileVersionInfo ¶
type FileVersionInfo struct {
// Unique identifier of the file version.
ID string `json:"id"`
// Name of the file version.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An object with details of the file version.
func (FileVersionInfo) RawJSON ¶
func (r FileVersionInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileVersionInfo) UnmarshalJSON ¶
func (r *FileVersionInfo) UnmarshalJSON(data []byte) error
type FileVersionRestoreParams ¶
type FileVersionRestoreParams struct {
FileID string `path:"fileId,required" json:"-"`
// contains filtered or unexported fields
}
type FileVersionService ¶
type FileVersionService struct {
Options []option.RequestOption
}
FileVersionService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileVersionService method instead.
func NewFileVersionService ¶
func NewFileVersionService(opts ...option.RequestOption) (r FileVersionService)
NewFileVersionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FileVersionService) Delete ¶
func (r *FileVersionService) Delete(ctx context.Context, versionID string, body FileVersionDeleteParams, opts ...option.RequestOption) (res *FileVersionDeleteResponse, err error)
This API deletes a non-current file version permanently. The API returns an empty response.
Note: If you want to delete all versions of a file, use the delete file API.
func (*FileVersionService) Get ¶
func (r *FileVersionService) Get(ctx context.Context, versionID string, query FileVersionGetParams, opts ...option.RequestOption) (res *File, err error)
This API returns an object with details or attributes of a file version.
func (*FileVersionService) List ¶
func (r *FileVersionService) List(ctx context.Context, fileID string, opts ...option.RequestOption) (res *[]File, err error)
This API returns details of all versions of a file.
func (*FileVersionService) Restore ¶
func (r *FileVersionService) Restore(ctx context.Context, versionID string, body FileVersionRestoreParams, opts ...option.RequestOption) (res *File, err error)
This API restores a file version as the current file version.
type Folder ¶
type Folder struct {
// Date and time when the folder was created. The date and time is in ISO8601
// format.
CreatedAt time.Time `json:"createdAt" format:"date-time"`
// Unique identifier of the asset.
FolderID string `json:"folderId"`
// Path of the folder. This is the path you would use in the URL to access the
// folder. For example, if the folder is at the root of the media library, the path
// will be /folder. If the folder is inside another folder named images, the path
// will be /images/folder.
FolderPath string `json:"folderPath"`
// Name of the asset.
Name string `json:"name"`
// Type of the asset.
//
// Any of "folder".
Type FolderType `json:"type"`
// Date and time when the folder was last updated. The date and time is in ISO8601
// format.
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
FolderID respjson.Field
FolderPath respjson.Field
Name respjson.Field
Type respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Folder) UnmarshalJSON ¶
type FolderCopyParams ¶
type FolderCopyParams struct {
// Full path to the destination folder where you want to copy the source folder
// into.
DestinationPath string `json:"destinationPath,required"`
// The full path to the source folder you want to copy.
SourceFolderPath string `json:"sourceFolderPath,required"`
// Option to copy all versions of files that are nested inside the selected folder.
// By default, only the current version of each file will be copied. When set to
// true, all versions of each file will be copied. Default value - `false`.
IncludeVersions param.Opt[bool] `json:"includeVersions,omitzero"`
// contains filtered or unexported fields
}
func (FolderCopyParams) MarshalJSON ¶
func (r FolderCopyParams) MarshalJSON() (data []byte, err error)
func (*FolderCopyParams) UnmarshalJSON ¶
func (r *FolderCopyParams) UnmarshalJSON(data []byte) error
type FolderCopyResponse ¶
type FolderCopyResponse struct {
// Unique identifier of the bulk job. This can be used to check the status of the
// bulk job.
JobID string `json:"jobId,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
JobID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Job submitted successfully. A `jobId` will be returned.
func (FolderCopyResponse) RawJSON ¶
func (r FolderCopyResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderCopyResponse) UnmarshalJSON ¶
func (r *FolderCopyResponse) UnmarshalJSON(data []byte) error
type FolderDeleteParams ¶
type FolderDeleteParams struct {
// Full path to the folder you want to delete. For example `/folder/to/delete/`.
FolderPath string `json:"folderPath,required"`
// contains filtered or unexported fields
}
func (FolderDeleteParams) MarshalJSON ¶
func (r FolderDeleteParams) MarshalJSON() (data []byte, err error)
func (*FolderDeleteParams) UnmarshalJSON ¶
func (r *FolderDeleteParams) UnmarshalJSON(data []byte) error
type FolderDeleteResponse ¶
type FolderDeleteResponse struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FolderDeleteResponse) RawJSON ¶
func (r FolderDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderDeleteResponse) UnmarshalJSON ¶
func (r *FolderDeleteResponse) UnmarshalJSON(data []byte) error
type FolderJobGetResponse ¶
type FolderJobGetResponse struct {
// Unique identifier of the bulk job.
JobID string `json:"jobId"`
// Unique identifier of the purge request. This will be present only if
// `purgeCache` is set to `true` in the rename folder API request.
PurgeRequestID string `json:"purgeRequestId"`
// Status of the bulk job.
//
// Any of "Pending", "Completed".
Status FolderJobGetResponseStatus `json:"status"`
// Type of the bulk job.
//
// Any of "COPY_FOLDER", "MOVE_FOLDER", "RENAME_FOLDER".
Type FolderJobGetResponseType `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
JobID respjson.Field
PurgeRequestID respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FolderJobGetResponse) RawJSON ¶
func (r FolderJobGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderJobGetResponse) UnmarshalJSON ¶
func (r *FolderJobGetResponse) UnmarshalJSON(data []byte) error
type FolderJobGetResponseStatus ¶
type FolderJobGetResponseStatus string
Status of the bulk job.
const ( FolderJobGetResponseStatusPending FolderJobGetResponseStatus = "Pending" FolderJobGetResponseStatusCompleted FolderJobGetResponseStatus = "Completed" )
type FolderJobGetResponseType ¶
type FolderJobGetResponseType string
Type of the bulk job.
const ( FolderJobGetResponseTypeCopyFolder FolderJobGetResponseType = "COPY_FOLDER" FolderJobGetResponseTypeMoveFolder FolderJobGetResponseType = "MOVE_FOLDER" FolderJobGetResponseTypeRenameFolder FolderJobGetResponseType = "RENAME_FOLDER" )
type FolderJobService ¶
type FolderJobService struct {
Options []option.RequestOption
}
FolderJobService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFolderJobService method instead.
func NewFolderJobService ¶
func NewFolderJobService(opts ...option.RequestOption) (r FolderJobService)
NewFolderJobService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FolderJobService) Get ¶
func (r *FolderJobService) Get(ctx context.Context, jobID string, opts ...option.RequestOption) (res *FolderJobGetResponse, err error)
This API returns the status of a bulk job like copy and move folder operations.
type FolderMoveParams ¶
type FolderMoveParams struct {
// Full path to the destination folder where you want to move the source folder
// into.
DestinationPath string `json:"destinationPath,required"`
// The full path to the source folder you want to move.
SourceFolderPath string `json:"sourceFolderPath,required"`
// contains filtered or unexported fields
}
func (FolderMoveParams) MarshalJSON ¶
func (r FolderMoveParams) MarshalJSON() (data []byte, err error)
func (*FolderMoveParams) UnmarshalJSON ¶
func (r *FolderMoveParams) UnmarshalJSON(data []byte) error
type FolderMoveResponse ¶
type FolderMoveResponse struct {
// Unique identifier of the bulk job. This can be used to check the status of the
// bulk job.
JobID string `json:"jobId,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
JobID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Job submitted successfully. A `jobId` will be returned.
func (FolderMoveResponse) RawJSON ¶
func (r FolderMoveResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderMoveResponse) UnmarshalJSON ¶
func (r *FolderMoveResponse) UnmarshalJSON(data []byte) error
type FolderNewParams ¶
type FolderNewParams struct {
// The folder will be created with this name.
//
// All characters except alphabets and numbers (inclusive of unicode letters,
// marks, and numerals in other languages) will be replaced by an underscore i.e.
// `_`.
FolderName string `json:"folderName,required"`
// The folder where the new folder should be created, for root use `/` else the
// path e.g. `containing/folder/`.
//
// Note: If any folder(s) is not present in the parentFolderPath parameter, it will
// be automatically created. For example, if you pass `/product/images/summer`,
// then `product`, `images`, and `summer` folders will be created if they don't
// already exist.
ParentFolderPath string `json:"parentFolderPath,required"`
// contains filtered or unexported fields
}
func (FolderNewParams) MarshalJSON ¶
func (r FolderNewParams) MarshalJSON() (data []byte, err error)
func (*FolderNewParams) UnmarshalJSON ¶
func (r *FolderNewParams) UnmarshalJSON(data []byte) error
type FolderNewResponse ¶
type FolderNewResponse struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (FolderNewResponse) RawJSON ¶
func (r FolderNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderNewResponse) UnmarshalJSON ¶
func (r *FolderNewResponse) UnmarshalJSON(data []byte) error
type FolderRenameParams ¶
type FolderRenameParams struct {
// The full path to the folder you want to rename.
FolderPath string `json:"folderPath,required"`
// The new name for the folder.
//
// All characters except alphabets and numbers (inclusive of unicode letters,
// marks, and numerals in other languages) and `-` will be replaced by an
// underscore i.e. `_`.
NewFolderName string `json:"newFolderName,required"`
// Option to purge cache for the old nested files and their versions' URLs.
//
// When set to true, it will internally issue a purge cache request on CDN to
// remove the cached content of the old nested files and their versions. There will
// only be one purge request for all the nested files, which will be counted
// against your monthly purge quota.
//
// Note: A purge cache request will be issued against
// `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This
// will remove all nested files, their versions' URLs, and any transformations made
// using query parameters on these files or their versions. However, the cache for
// file transformations made using path parameters will persist. You can purge them
// using the purge API. For more details, refer to the purge API documentation.
//
// Default value - `false`
PurgeCache param.Opt[bool] `json:"purgeCache,omitzero"`
// contains filtered or unexported fields
}
func (FolderRenameParams) MarshalJSON ¶
func (r FolderRenameParams) MarshalJSON() (data []byte, err error)
func (*FolderRenameParams) UnmarshalJSON ¶
func (r *FolderRenameParams) UnmarshalJSON(data []byte) error
type FolderRenameResponse ¶
type FolderRenameResponse struct {
// Unique identifier of the bulk job. This can be used to check the status of the
// bulk job.
JobID string `json:"jobId,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
JobID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Job submitted successfully. A `jobId` will be returned.
func (FolderRenameResponse) RawJSON ¶
func (r FolderRenameResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FolderRenameResponse) UnmarshalJSON ¶
func (r *FolderRenameResponse) UnmarshalJSON(data []byte) error
type FolderService ¶
type FolderService struct {
Options []option.RequestOption
Job FolderJobService
}
FolderService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFolderService method instead.
func NewFolderService ¶
func NewFolderService(opts ...option.RequestOption) (r FolderService)
NewFolderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FolderService) Copy ¶
func (r *FolderService) Copy(ctx context.Context, body FolderCopyParams, opts ...option.RequestOption) (res *FolderCopyResponse, err error)
This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history.
func (*FolderService) Delete ¶
func (r *FolderService) Delete(ctx context.Context, body FolderDeleteParams, opts ...option.RequestOption) (res *FolderDeleteResponse, err error)
This will delete a folder and all its contents permanently. The API returns an empty response.
func (*FolderService) Move ¶
func (r *FolderService) Move(ctx context.Context, body FolderMoveParams, opts ...option.RequestOption) (res *FolderMoveResponse, err error)
This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history.
func (*FolderService) New ¶
func (r *FolderService) New(ctx context.Context, body FolderNewParams, opts ...option.RequestOption) (res *FolderNewResponse, err error)
This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created.
func (*FolderService) Rename ¶
func (r *FolderService) Rename(ctx context.Context, body FolderRenameParams, opts ...option.RequestOption) (res *FolderRenameResponse, err error)
This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name.
type FolderType ¶
type FolderType string
Type of the asset.
const (
FolderTypeFolder FolderType = "folder"
)
type ImageOverlayParam ¶
type ImageOverlayParam = shared.ImageOverlayParam
This is an alias to an internal type.
type Metadata ¶
type Metadata struct {
// The audio codec used in the video (only for video).
AudioCodec string `json:"audioCodec"`
// The bit rate of the video in kbps (only for video).
BitRate int64 `json:"bitRate"`
// The density of the image in DPI.
Density int64 `json:"density"`
// The duration of the video in seconds (only for video).
Duration int64 `json:"duration"`
Exif MetadataExif `json:"exif"`
// The format of the file (e.g., 'jpg', 'mp4').
Format string `json:"format"`
// Indicates if the image has a color profile.
HasColorProfile bool `json:"hasColorProfile"`
// Indicates if the image contains transparent areas.
HasTransparency bool `json:"hasTransparency"`
// The height of the image or video in pixels.
Height int64 `json:"height"`
// Perceptual hash of the image.
PHash string `json:"pHash"`
// The quality indicator of the image.
Quality int64 `json:"quality"`
// The file size in bytes.
Size int64 `json:"size"`
// The video codec used in the video (only for video).
VideoCodec string `json:"videoCodec"`
// The width of the image or video in pixels.
Width int64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AudioCodec respjson.Field
BitRate respjson.Field
Density respjson.Field
Duration respjson.Field
Exif respjson.Field
Format respjson.Field
HasColorProfile respjson.Field
HasTransparency respjson.Field
Height respjson.Field
PHash respjson.Field
Quality respjson.Field
Size respjson.Field
VideoCodec respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
JSON object containing metadata.
func (*Metadata) UnmarshalJSON ¶
type MetadataExif ¶
type MetadataExif struct {
// Object containing Exif details.
Exif MetadataExifExif `json:"exif"`
// Object containing GPS information.
Gps MetadataExifGps `json:"gps"`
// Object containing EXIF image information.
Image MetadataExifImage `json:"image"`
// JSON object.
Interoperability MetadataExifInteroperability `json:"interoperability"`
Makernote map[string]any `json:"makernote"`
// Object containing Thumbnail information.
Thumbnail MetadataExifThumbnail `json:"thumbnail"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Exif respjson.Field
Gps respjson.Field
Image respjson.Field
Interoperability respjson.Field
Makernote respjson.Field
Thumbnail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MetadataExif) RawJSON ¶
func (r MetadataExif) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetadataExif) UnmarshalJSON ¶
func (r *MetadataExif) UnmarshalJSON(data []byte) error
type MetadataExifExif ¶
type MetadataExifExif struct {
ApertureValue float64 `json:"ApertureValue"`
ColorSpace int64 `json:"ColorSpace"`
CreateDate string `json:"CreateDate"`
CustomRendered int64 `json:"CustomRendered"`
DateTimeOriginal string `json:"DateTimeOriginal"`
ExifImageHeight int64 `json:"ExifImageHeight"`
ExifImageWidth int64 `json:"ExifImageWidth"`
ExifVersion string `json:"ExifVersion"`
ExposureCompensation float64 `json:"ExposureCompensation"`
ExposureMode int64 `json:"ExposureMode"`
ExposureProgram int64 `json:"ExposureProgram"`
ExposureTime float64 `json:"ExposureTime"`
Flash int64 `json:"Flash"`
FlashpixVersion string `json:"FlashpixVersion"`
FNumber float64 `json:"FNumber"`
FocalLength int64 `json:"FocalLength"`
FocalPlaneResolutionUnit int64 `json:"FocalPlaneResolutionUnit"`
FocalPlaneXResolution float64 `json:"FocalPlaneXResolution"`
FocalPlaneYResolution float64 `json:"FocalPlaneYResolution"`
InteropOffset int64 `json:"InteropOffset"`
ISO int64 `json:"ISO"`
MeteringMode int64 `json:"MeteringMode"`
SceneCaptureType int64 `json:"SceneCaptureType"`
ShutterSpeedValue float64 `json:"ShutterSpeedValue"`
SubSecTime string `json:"SubSecTime"`
WhiteBalance int64 `json:"WhiteBalance"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ApertureValue respjson.Field
ColorSpace respjson.Field
CreateDate respjson.Field
CustomRendered respjson.Field
DateTimeOriginal respjson.Field
ExifImageHeight respjson.Field
ExifImageWidth respjson.Field
ExifVersion respjson.Field
ExposureCompensation respjson.Field
ExposureMode respjson.Field
ExposureProgram respjson.Field
ExposureTime respjson.Field
Flash respjson.Field
FlashpixVersion respjson.Field
FNumber respjson.Field
FocalLength respjson.Field
FocalPlaneResolutionUnit respjson.Field
FocalPlaneXResolution respjson.Field
FocalPlaneYResolution respjson.Field
InteropOffset respjson.Field
ISO respjson.Field
MeteringMode respjson.Field
SceneCaptureType respjson.Field
ShutterSpeedValue respjson.Field
SubSecTime respjson.Field
WhiteBalance respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object containing Exif details.
func (MetadataExifExif) RawJSON ¶
func (r MetadataExifExif) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetadataExifExif) UnmarshalJSON ¶
func (r *MetadataExifExif) UnmarshalJSON(data []byte) error
type MetadataExifGps ¶
type MetadataExifGps struct {
GpsVersionID []int64 `json:"GPSVersionID"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
GpsVersionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object containing GPS information.
func (MetadataExifGps) RawJSON ¶
func (r MetadataExifGps) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetadataExifGps) UnmarshalJSON ¶
func (r *MetadataExifGps) UnmarshalJSON(data []byte) error
type MetadataExifImage ¶
type MetadataExifImage struct {
ExifOffset int64 `json:"ExifOffset"`
GpsInfo int64 `json:"GPSInfo"`
Make string `json:"Make"`
Model string `json:"Model"`
ModifyDate string `json:"ModifyDate"`
Orientation int64 `json:"Orientation"`
ResolutionUnit int64 `json:"ResolutionUnit"`
Software string `json:"Software"`
XResolution int64 `json:"XResolution"`
YCbCrPositioning int64 `json:"YCbCrPositioning"`
YResolution int64 `json:"YResolution"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExifOffset respjson.Field
GpsInfo respjson.Field
Make respjson.Field
Model respjson.Field
ModifyDate respjson.Field
Orientation respjson.Field
ResolutionUnit respjson.Field
Software respjson.Field
XResolution respjson.Field
YCbCrPositioning respjson.Field
YResolution respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object containing EXIF image information.
func (MetadataExifImage) RawJSON ¶
func (r MetadataExifImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetadataExifImage) UnmarshalJSON ¶
func (r *MetadataExifImage) UnmarshalJSON(data []byte) error
type MetadataExifInteroperability ¶
type MetadataExifInteroperability struct {
InteropIndex string `json:"InteropIndex"`
InteropVersion string `json:"InteropVersion"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InteropIndex respjson.Field
InteropVersion respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
JSON object.
func (MetadataExifInteroperability) RawJSON ¶
func (r MetadataExifInteroperability) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetadataExifInteroperability) UnmarshalJSON ¶
func (r *MetadataExifInteroperability) UnmarshalJSON(data []byte) error
type MetadataExifThumbnail ¶
type MetadataExifThumbnail struct {
Compression int64 `json:"Compression"`
ResolutionUnit int64 `json:"ResolutionUnit"`
ThumbnailLength int64 `json:"ThumbnailLength"`
ThumbnailOffset int64 `json:"ThumbnailOffset"`
XResolution int64 `json:"XResolution"`
YResolution int64 `json:"YResolution"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Compression respjson.Field
ResolutionUnit respjson.Field
ThumbnailLength respjson.Field
ThumbnailOffset respjson.Field
XResolution respjson.Field
YResolution respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object containing Thumbnail information.
func (MetadataExifThumbnail) RawJSON ¶
func (r MetadataExifThumbnail) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetadataExifThumbnail) UnmarshalJSON ¶
func (r *MetadataExifThumbnail) UnmarshalJSON(data []byte) error
type OriginRequestAkeneoPimParam ¶
type OriginRequestAkeneoPimParam struct {
// Akeneo instance base URL.
BaseURL string `json:"baseUrl,required" format:"uri"`
// Akeneo API client ID.
ClientID string `json:"clientId,required"`
// Akeneo API client secret.
ClientSecret string `json:"clientSecret,required"`
// Display name of the origin.
Name string `json:"name,required"`
// Akeneo API password.
Password string `json:"password,required"`
// Akeneo API username.
Username string `json:"username,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader param.Opt[string] `json:"baseUrlForCanonicalHeader,omitzero" format:"uri"`
// Whether to send a Canonical header.
IncludeCanonicalHeader param.Opt[bool] `json:"includeCanonicalHeader,omitzero"`
// This field can be elided, and will marshal its zero value as "AKENEO_PIM".
Type constant.AkeneoPim `json:"type,required"`
// contains filtered or unexported fields
}
The properties BaseURL, ClientID, ClientSecret, Name, Password, Type, Username are required.
func (OriginRequestAkeneoPimParam) MarshalJSON ¶
func (r OriginRequestAkeneoPimParam) MarshalJSON() (data []byte, err error)
func (*OriginRequestAkeneoPimParam) UnmarshalJSON ¶
func (r *OriginRequestAkeneoPimParam) UnmarshalJSON(data []byte) error
type OriginRequestAzureBlobParam ¶
type OriginRequestAzureBlobParam struct {
AccountName string `json:"accountName,required"`
Container string `json:"container,required"`
// Display name of the origin.
Name string `json:"name,required"`
SasToken string `json:"sasToken,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader param.Opt[string] `json:"baseUrlForCanonicalHeader,omitzero" format:"uri"`
// Whether to send a Canonical header.
IncludeCanonicalHeader param.Opt[bool] `json:"includeCanonicalHeader,omitzero"`
Prefix param.Opt[string] `json:"prefix,omitzero"`
// This field can be elided, and will marshal its zero value as "AZURE_BLOB".
Type constant.AzureBlob `json:"type,required"`
// contains filtered or unexported fields
}
The properties AccountName, Container, Name, SasToken, Type are required.
func (OriginRequestAzureBlobParam) MarshalJSON ¶
func (r OriginRequestAzureBlobParam) MarshalJSON() (data []byte, err error)
func (*OriginRequestAzureBlobParam) UnmarshalJSON ¶
func (r *OriginRequestAzureBlobParam) UnmarshalJSON(data []byte) error
type OriginRequestCloudinaryBackupParam ¶
type OriginRequestCloudinaryBackupParam struct {
// Access key for the bucket.
AccessKey string `json:"accessKey,required"`
// S3 bucket name.
Bucket string `json:"bucket,required"`
// Display name of the origin.
Name string `json:"name,required"`
// Secret key for the bucket.
SecretKey string `json:"secretKey,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader param.Opt[string] `json:"baseUrlForCanonicalHeader,omitzero" format:"uri"`
// Whether to send a Canonical header.
IncludeCanonicalHeader param.Opt[bool] `json:"includeCanonicalHeader,omitzero"`
// Path prefix inside the bucket.
Prefix param.Opt[string] `json:"prefix,omitzero"`
// This field can be elided, and will marshal its zero value as
// "CLOUDINARY_BACKUP".
Type constant.CloudinaryBackup `json:"type,required"`
// contains filtered or unexported fields
}
The properties AccessKey, Bucket, Name, SecretKey, Type are required.
func (OriginRequestCloudinaryBackupParam) MarshalJSON ¶
func (r OriginRequestCloudinaryBackupParam) MarshalJSON() (data []byte, err error)
func (*OriginRequestCloudinaryBackupParam) UnmarshalJSON ¶
func (r *OriginRequestCloudinaryBackupParam) UnmarshalJSON(data []byte) error
type OriginRequestGcsParam ¶
type OriginRequestGcsParam struct {
Bucket string `json:"bucket,required"`
ClientEmail string `json:"clientEmail,required" format:"email"`
// Display name of the origin.
Name string `json:"name,required"`
PrivateKey string `json:"privateKey,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader param.Opt[string] `json:"baseUrlForCanonicalHeader,omitzero" format:"uri"`
// Whether to send a Canonical header.
IncludeCanonicalHeader param.Opt[bool] `json:"includeCanonicalHeader,omitzero"`
Prefix param.Opt[string] `json:"prefix,omitzero"`
// This field can be elided, and will marshal its zero value as "GCS".
Type constant.Gcs `json:"type,required"`
// contains filtered or unexported fields
}
The properties Bucket, ClientEmail, Name, PrivateKey, Type are required.
func (OriginRequestGcsParam) MarshalJSON ¶
func (r OriginRequestGcsParam) MarshalJSON() (data []byte, err error)
func (*OriginRequestGcsParam) UnmarshalJSON ¶
func (r *OriginRequestGcsParam) UnmarshalJSON(data []byte) error
type OriginRequestS3CompatibleParam ¶
type OriginRequestS3CompatibleParam struct {
// Access key for the bucket.
AccessKey string `json:"accessKey,required"`
// S3 bucket name.
Bucket string `json:"bucket,required"`
// Custom S3-compatible endpoint.
Endpoint string `json:"endpoint,required" format:"uri"`
// Display name of the origin.
Name string `json:"name,required"`
// Secret key for the bucket.
SecretKey string `json:"secretKey,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader param.Opt[string] `json:"baseUrlForCanonicalHeader,omitzero" format:"uri"`
// Whether to send a Canonical header.
IncludeCanonicalHeader param.Opt[bool] `json:"includeCanonicalHeader,omitzero"`
// Path prefix inside the bucket.
Prefix param.Opt[string] `json:"prefix,omitzero"`
// Use path-style S3 URLs?
S3ForcePathStyle param.Opt[bool] `json:"s3ForcePathStyle,omitzero"`
// This field can be elided, and will marshal its zero value as "S3_COMPATIBLE".
Type constant.S3Compatible `json:"type,required"`
// contains filtered or unexported fields
}
The properties AccessKey, Bucket, Endpoint, Name, SecretKey, Type are required.
func (OriginRequestS3CompatibleParam) MarshalJSON ¶
func (r OriginRequestS3CompatibleParam) MarshalJSON() (data []byte, err error)
func (*OriginRequestS3CompatibleParam) UnmarshalJSON ¶
func (r *OriginRequestS3CompatibleParam) UnmarshalJSON(data []byte) error
type OriginRequestS3Param ¶
type OriginRequestS3Param struct {
// Access key for the bucket.
AccessKey string `json:"accessKey,required"`
// S3 bucket name.
Bucket string `json:"bucket,required"`
// Display name of the origin.
Name string `json:"name,required"`
// Secret key for the bucket.
SecretKey string `json:"secretKey,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader param.Opt[string] `json:"baseUrlForCanonicalHeader,omitzero" format:"uri"`
// Whether to send a Canonical header.
IncludeCanonicalHeader param.Opt[bool] `json:"includeCanonicalHeader,omitzero"`
// Path prefix inside the bucket.
Prefix param.Opt[string] `json:"prefix,omitzero"`
// This field can be elided, and will marshal its zero value as "S3".
Type constant.S3 `json:"type,required"`
// contains filtered or unexported fields
}
The properties AccessKey, Bucket, Name, SecretKey, Type are required.
func (OriginRequestS3Param) MarshalJSON ¶
func (r OriginRequestS3Param) MarshalJSON() (data []byte, err error)
func (*OriginRequestS3Param) UnmarshalJSON ¶
func (r *OriginRequestS3Param) UnmarshalJSON(data []byte) error
type OriginRequestUnionParam ¶
type OriginRequestUnionParam struct {
OfS3 *OriginRequestS3Param `json:",omitzero,inline"`
OfS3Compatible *OriginRequestS3CompatibleParam `json:",omitzero,inline"`
OfCloudinaryBackup *OriginRequestCloudinaryBackupParam `json:",omitzero,inline"`
OfWebFolder *OriginRequestWebFolderParam `json:",omitzero,inline"`
OfWebProxy *OriginRequestWebProxyParam `json:",omitzero,inline"`
OfGcs *OriginRequestGcsParam `json:",omitzero,inline"`
OfAzureBlob *OriginRequestAzureBlobParam `json:",omitzero,inline"`
OfAkeneoPim *OriginRequestAkeneoPimParam `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 OriginRequestParamOfWebFolder ¶
func OriginRequestParamOfWebFolder(baseURL string, name string) OriginRequestUnionParam
func OriginRequestParamOfWebProxy ¶
func OriginRequestParamOfWebProxy(name string) OriginRequestUnionParam
func (OriginRequestUnionParam) GetAccessKey ¶
func (u OriginRequestUnionParam) GetAccessKey() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetAccountName ¶
func (u OriginRequestUnionParam) GetAccountName() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetBaseURL ¶
func (u OriginRequestUnionParam) GetBaseURL() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetBaseURLForCanonicalHeader ¶
func (u OriginRequestUnionParam) GetBaseURLForCanonicalHeader() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetBucket ¶
func (u OriginRequestUnionParam) GetBucket() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetClientEmail ¶
func (u OriginRequestUnionParam) GetClientEmail() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetClientID ¶
func (u OriginRequestUnionParam) GetClientID() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetClientSecret ¶
func (u OriginRequestUnionParam) GetClientSecret() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetContainer ¶
func (u OriginRequestUnionParam) GetContainer() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetEndpoint ¶
func (u OriginRequestUnionParam) GetEndpoint() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetForwardHostHeaderToOrigin ¶
func (u OriginRequestUnionParam) GetForwardHostHeaderToOrigin() *bool
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetIncludeCanonicalHeader ¶
func (u OriginRequestUnionParam) GetIncludeCanonicalHeader() *bool
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetName ¶
func (u OriginRequestUnionParam) GetName() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetPassword ¶
func (u OriginRequestUnionParam) GetPassword() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetPrefix ¶
func (u OriginRequestUnionParam) GetPrefix() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetPrivateKey ¶
func (u OriginRequestUnionParam) GetPrivateKey() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetS3ForcePathStyle ¶
func (u OriginRequestUnionParam) GetS3ForcePathStyle() *bool
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetSasToken ¶
func (u OriginRequestUnionParam) GetSasToken() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetSecretKey ¶
func (u OriginRequestUnionParam) GetSecretKey() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetType ¶
func (u OriginRequestUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) GetUsername ¶
func (u OriginRequestUnionParam) GetUsername() *string
Returns a pointer to the underlying variant's property, if present.
func (OriginRequestUnionParam) MarshalJSON ¶
func (u OriginRequestUnionParam) MarshalJSON() ([]byte, error)
func (*OriginRequestUnionParam) UnmarshalJSON ¶
func (u *OriginRequestUnionParam) UnmarshalJSON(data []byte) error
type OriginRequestWebFolderParam ¶
type OriginRequestWebFolderParam struct {
// Root URL for the web folder origin.
BaseURL string `json:"baseUrl,required" format:"uri"`
// Display name of the origin.
Name string `json:"name,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader param.Opt[string] `json:"baseUrlForCanonicalHeader,omitzero" format:"uri"`
// Forward the Host header to origin?
ForwardHostHeaderToOrigin param.Opt[bool] `json:"forwardHostHeaderToOrigin,omitzero"`
// Whether to send a Canonical header.
IncludeCanonicalHeader param.Opt[bool] `json:"includeCanonicalHeader,omitzero"`
// This field can be elided, and will marshal its zero value as "WEB_FOLDER".
Type constant.WebFolder `json:"type,required"`
// contains filtered or unexported fields
}
The properties BaseURL, Name, Type are required.
func (OriginRequestWebFolderParam) MarshalJSON ¶
func (r OriginRequestWebFolderParam) MarshalJSON() (data []byte, err error)
func (*OriginRequestWebFolderParam) UnmarshalJSON ¶
func (r *OriginRequestWebFolderParam) UnmarshalJSON(data []byte) error
type OriginRequestWebProxyParam ¶
type OriginRequestWebProxyParam struct {
// Display name of the origin.
Name string `json:"name,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader param.Opt[string] `json:"baseUrlForCanonicalHeader,omitzero" format:"uri"`
// Whether to send a Canonical header.
IncludeCanonicalHeader param.Opt[bool] `json:"includeCanonicalHeader,omitzero"`
// This field can be elided, and will marshal its zero value as "WEB_PROXY".
Type constant.WebProxy `json:"type,required"`
// contains filtered or unexported fields
}
The properties Name, Type are required.
func (OriginRequestWebProxyParam) MarshalJSON ¶
func (r OriginRequestWebProxyParam) MarshalJSON() (data []byte, err error)
func (*OriginRequestWebProxyParam) UnmarshalJSON ¶
func (r *OriginRequestWebProxyParam) UnmarshalJSON(data []byte) error
type OriginResponseAkeneoPim ¶
type OriginResponseAkeneoPim struct {
// Unique identifier for the origin. This is generated by ImageKit when you create
// a new origin.
ID string `json:"id,required"`
// Akeneo instance base URL.
BaseURL string `json:"baseUrl,required" format:"uri"`
// Whether to send a Canonical header.
IncludeCanonicalHeader bool `json:"includeCanonicalHeader,required"`
// Display name of the origin.
Name string `json:"name,required"`
Type constant.AkeneoPim `json:"type,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader string `json:"baseUrlForCanonicalHeader" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BaseURL respjson.Field
IncludeCanonicalHeader respjson.Field
Name respjson.Field
Type respjson.Field
BaseURLForCanonicalHeader respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginResponseAkeneoPim) RawJSON ¶
func (r OriginResponseAkeneoPim) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginResponseAkeneoPim) UnmarshalJSON ¶
func (r *OriginResponseAkeneoPim) UnmarshalJSON(data []byte) error
type OriginResponseAzureBlob ¶
type OriginResponseAzureBlob struct {
// Unique identifier for the origin. This is generated by ImageKit when you create
// a new origin.
ID string `json:"id,required"`
AccountName string `json:"accountName,required"`
Container string `json:"container,required"`
// Whether to send a Canonical header.
IncludeCanonicalHeader bool `json:"includeCanonicalHeader,required"`
// Display name of the origin.
Name string `json:"name,required"`
Prefix string `json:"prefix,required"`
Type constant.AzureBlob `json:"type,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader string `json:"baseUrlForCanonicalHeader" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AccountName respjson.Field
Container respjson.Field
IncludeCanonicalHeader respjson.Field
Name respjson.Field
Prefix respjson.Field
Type respjson.Field
BaseURLForCanonicalHeader respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginResponseAzureBlob) RawJSON ¶
func (r OriginResponseAzureBlob) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginResponseAzureBlob) UnmarshalJSON ¶
func (r *OriginResponseAzureBlob) UnmarshalJSON(data []byte) error
type OriginResponseCloudinaryBackup ¶
type OriginResponseCloudinaryBackup struct {
// Unique identifier for the origin. This is generated by ImageKit when you create
// a new origin.
ID string `json:"id,required"`
// S3 bucket name.
Bucket string `json:"bucket,required"`
// Whether to send a Canonical header.
IncludeCanonicalHeader bool `json:"includeCanonicalHeader,required"`
// Display name of the origin.
Name string `json:"name,required"`
// Path prefix inside the bucket.
Prefix string `json:"prefix,required"`
Type constant.CloudinaryBackup `json:"type,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader string `json:"baseUrlForCanonicalHeader" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Bucket respjson.Field
IncludeCanonicalHeader respjson.Field
Name respjson.Field
Prefix respjson.Field
Type respjson.Field
BaseURLForCanonicalHeader respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginResponseCloudinaryBackup) RawJSON ¶
func (r OriginResponseCloudinaryBackup) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginResponseCloudinaryBackup) UnmarshalJSON ¶
func (r *OriginResponseCloudinaryBackup) UnmarshalJSON(data []byte) error
type OriginResponseGcs ¶
type OriginResponseGcs struct {
// Unique identifier for the origin. This is generated by ImageKit when you create
// a new origin.
ID string `json:"id,required"`
Bucket string `json:"bucket,required"`
ClientEmail string `json:"clientEmail,required" format:"email"`
// Whether to send a Canonical header.
IncludeCanonicalHeader bool `json:"includeCanonicalHeader,required"`
// Display name of the origin.
Name string `json:"name,required"`
Prefix string `json:"prefix,required"`
Type constant.Gcs `json:"type,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader string `json:"baseUrlForCanonicalHeader" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Bucket respjson.Field
ClientEmail respjson.Field
IncludeCanonicalHeader respjson.Field
Name respjson.Field
Prefix respjson.Field
Type respjson.Field
BaseURLForCanonicalHeader respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginResponseGcs) RawJSON ¶
func (r OriginResponseGcs) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginResponseGcs) UnmarshalJSON ¶
func (r *OriginResponseGcs) UnmarshalJSON(data []byte) error
type OriginResponseS3 ¶
type OriginResponseS3 struct {
// Unique identifier for the origin. This is generated by ImageKit when you create
// a new origin.
ID string `json:"id,required"`
// S3 bucket name.
Bucket string `json:"bucket,required"`
// Whether to send a Canonical header.
IncludeCanonicalHeader bool `json:"includeCanonicalHeader,required"`
// Display name of the origin.
Name string `json:"name,required"`
// Path prefix inside the bucket.
Prefix string `json:"prefix,required"`
Type constant.S3 `json:"type,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader string `json:"baseUrlForCanonicalHeader" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Bucket respjson.Field
IncludeCanonicalHeader respjson.Field
Name respjson.Field
Prefix respjson.Field
Type respjson.Field
BaseURLForCanonicalHeader respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginResponseS3) RawJSON ¶
func (r OriginResponseS3) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginResponseS3) UnmarshalJSON ¶
func (r *OriginResponseS3) UnmarshalJSON(data []byte) error
type OriginResponseS3Compatible ¶
type OriginResponseS3Compatible struct {
// Unique identifier for the origin. This is generated by ImageKit when you create
// a new origin.
ID string `json:"id,required"`
// S3 bucket name.
Bucket string `json:"bucket,required"`
// Custom S3-compatible endpoint.
Endpoint string `json:"endpoint,required" format:"uri"`
// Whether to send a Canonical header.
IncludeCanonicalHeader bool `json:"includeCanonicalHeader,required"`
// Display name of the origin.
Name string `json:"name,required"`
// Path prefix inside the bucket.
Prefix string `json:"prefix,required"`
// Use path-style S3 URLs?
S3ForcePathStyle bool `json:"s3ForcePathStyle,required"`
Type constant.S3Compatible `json:"type,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader string `json:"baseUrlForCanonicalHeader" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Bucket respjson.Field
Endpoint respjson.Field
IncludeCanonicalHeader respjson.Field
Name respjson.Field
Prefix respjson.Field
S3ForcePathStyle respjson.Field
Type respjson.Field
BaseURLForCanonicalHeader respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginResponseS3Compatible) RawJSON ¶
func (r OriginResponseS3Compatible) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginResponseS3Compatible) UnmarshalJSON ¶
func (r *OriginResponseS3Compatible) UnmarshalJSON(data []byte) error
type OriginResponseUnion ¶
type OriginResponseUnion struct {
ID string `json:"id"`
Bucket string `json:"bucket"`
IncludeCanonicalHeader bool `json:"includeCanonicalHeader"`
Name string `json:"name"`
Prefix string `json:"prefix"`
// Any of "S3", "S3_COMPATIBLE", "CLOUDINARY_BACKUP", "WEB_FOLDER", "WEB_PROXY",
// "GCS", "AZURE_BLOB", "AKENEO_PIM".
Type string `json:"type"`
BaseURLForCanonicalHeader string `json:"baseUrlForCanonicalHeader"`
// This field is from variant [OriginResponseS3Compatible].
Endpoint string `json:"endpoint"`
// This field is from variant [OriginResponseS3Compatible].
S3ForcePathStyle bool `json:"s3ForcePathStyle"`
BaseURL string `json:"baseUrl"`
// This field is from variant [OriginResponseWebFolder].
ForwardHostHeaderToOrigin bool `json:"forwardHostHeaderToOrigin"`
// This field is from variant [OriginResponseGcs].
ClientEmail string `json:"clientEmail"`
// This field is from variant [OriginResponseAzureBlob].
AccountName string `json:"accountName"`
// This field is from variant [OriginResponseAzureBlob].
Container string `json:"container"`
JSON struct {
ID respjson.Field
Bucket respjson.Field
IncludeCanonicalHeader respjson.Field
Name respjson.Field
Prefix respjson.Field
Type respjson.Field
BaseURLForCanonicalHeader respjson.Field
Endpoint respjson.Field
S3ForcePathStyle respjson.Field
BaseURL respjson.Field
ForwardHostHeaderToOrigin respjson.Field
ClientEmail respjson.Field
AccountName respjson.Field
Container respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OriginResponseUnion contains all possible properties and values from OriginResponseS3, OriginResponseS3Compatible, OriginResponseCloudinaryBackup, OriginResponseWebFolder, OriginResponseWebProxy, OriginResponseGcs, OriginResponseAzureBlob, OriginResponseAkeneoPim.
Use the OriginResponseUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (OriginResponseUnion) AsAkeneoPim ¶
func (u OriginResponseUnion) AsAkeneoPim() (v OriginResponseAkeneoPim)
func (OriginResponseUnion) AsAny ¶
func (u OriginResponseUnion) AsAny() anyOriginResponse
Use the following switch statement to find the correct variant
switch variant := OriginResponseUnion.AsAny().(type) {
case imagekit.OriginResponseS3:
case imagekit.OriginResponseS3Compatible:
case imagekit.OriginResponseCloudinaryBackup:
case imagekit.OriginResponseWebFolder:
case imagekit.OriginResponseWebProxy:
case imagekit.OriginResponseGcs:
case imagekit.OriginResponseAzureBlob:
case imagekit.OriginResponseAkeneoPim:
default:
fmt.Errorf("no variant present")
}
func (OriginResponseUnion) AsAzureBlob ¶
func (u OriginResponseUnion) AsAzureBlob() (v OriginResponseAzureBlob)
func (OriginResponseUnion) AsCloudinaryBackup ¶
func (u OriginResponseUnion) AsCloudinaryBackup() (v OriginResponseCloudinaryBackup)
func (OriginResponseUnion) AsGcs ¶
func (u OriginResponseUnion) AsGcs() (v OriginResponseGcs)
func (OriginResponseUnion) AsS3 ¶
func (u OriginResponseUnion) AsS3() (v OriginResponseS3)
func (OriginResponseUnion) AsS3Compatible ¶
func (u OriginResponseUnion) AsS3Compatible() (v OriginResponseS3Compatible)
func (OriginResponseUnion) AsWebFolder ¶
func (u OriginResponseUnion) AsWebFolder() (v OriginResponseWebFolder)
func (OriginResponseUnion) AsWebProxy ¶
func (u OriginResponseUnion) AsWebProxy() (v OriginResponseWebProxy)
func (OriginResponseUnion) RawJSON ¶
func (u OriginResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginResponseUnion) UnmarshalJSON ¶
func (r *OriginResponseUnion) UnmarshalJSON(data []byte) error
type OriginResponseWebFolder ¶
type OriginResponseWebFolder struct {
// Unique identifier for the origin. This is generated by ImageKit when you create
// a new origin.
ID string `json:"id,required"`
// Root URL for the web folder origin.
BaseURL string `json:"baseUrl,required" format:"uri"`
// Forward the Host header to origin?
ForwardHostHeaderToOrigin bool `json:"forwardHostHeaderToOrigin,required"`
// Whether to send a Canonical header.
IncludeCanonicalHeader bool `json:"includeCanonicalHeader,required"`
// Display name of the origin.
Name string `json:"name,required"`
Type constant.WebFolder `json:"type,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader string `json:"baseUrlForCanonicalHeader" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BaseURL respjson.Field
ForwardHostHeaderToOrigin respjson.Field
IncludeCanonicalHeader respjson.Field
Name respjson.Field
Type respjson.Field
BaseURLForCanonicalHeader respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginResponseWebFolder) RawJSON ¶
func (r OriginResponseWebFolder) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginResponseWebFolder) UnmarshalJSON ¶
func (r *OriginResponseWebFolder) UnmarshalJSON(data []byte) error
type OriginResponseWebProxy ¶
type OriginResponseWebProxy struct {
// Unique identifier for the origin. This is generated by ImageKit when you create
// a new origin.
ID string `json:"id,required"`
// Whether to send a Canonical header.
IncludeCanonicalHeader bool `json:"includeCanonicalHeader,required"`
// Display name of the origin.
Name string `json:"name,required"`
Type constant.WebProxy `json:"type,required"`
// URL used in the Canonical header (if enabled).
BaseURLForCanonicalHeader string `json:"baseUrlForCanonicalHeader" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
IncludeCanonicalHeader respjson.Field
Name respjson.Field
Type respjson.Field
BaseURLForCanonicalHeader respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginResponseWebProxy) RawJSON ¶
func (r OriginResponseWebProxy) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginResponseWebProxy) UnmarshalJSON ¶
func (r *OriginResponseWebProxy) UnmarshalJSON(data []byte) error
type OverlayPositionFocus ¶
type OverlayPositionFocus = shared.OverlayPositionFocus
Specifies the position of the overlay relative to the parent image or video. Maps to `lfo` in the URL.
This is an alias to an internal type.
type OverlayPositionParam ¶
type OverlayPositionParam = shared.OverlayPositionParam
This is an alias to an internal type.
type OverlayPositionXUnionParam ¶
type OverlayPositionXUnionParam = shared.OverlayPositionXUnionParam
Specifies the x-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. Maps to `lx` in the URL. Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
This is an alias to an internal type.
type OverlayPositionYUnionParam ¶
type OverlayPositionYUnionParam = shared.OverlayPositionYUnionParam
Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. Maps to `ly` in the URL. Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
This is an alias to an internal type.
type OverlayTimingDurationUnionParam ¶
type OverlayTimingDurationUnionParam = shared.OverlayTimingDurationUnionParam
Specifies the duration (in seconds) during which the overlay should appear on the base video. Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. Applies only if the base asset is a video. Maps to `ldu` in the URL.
This is an alias to an internal type.
type OverlayTimingEndUnionParam ¶
type OverlayTimingEndUnionParam = shared.OverlayTimingEndUnionParam
Specifies the end time (in seconds) for when the overlay should disappear from the base video. If both end and duration are provided, duration is ignored. Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. Applies only if the base asset is a video. Maps to `leo` in the URL.
This is an alias to an internal type.
type OverlayTimingParam ¶
type OverlayTimingParam = shared.OverlayTimingParam
This is an alias to an internal type.
type OverlayTimingStartUnionParam ¶
type OverlayTimingStartUnionParam = shared.OverlayTimingStartUnionParam
Specifies the start time (in seconds) for when the overlay should appear on the base video. Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. Applies only if the base asset is a video. Maps to `lso` in the URL.
This is an alias to an internal type.
type OverlayUnionParam ¶
type OverlayUnionParam = shared.OverlayUnionParam
Specifies an overlay to be applied on the parent image or video. ImageKit supports overlays including images, text, videos, subtitles, and solid colors. See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers).
This is an alias to an internal type.
type SolidColorOverlayParam ¶
type SolidColorOverlayParam = shared.SolidColorOverlayParam
This is an alias to an internal type.
type SolidColorOverlayTransformationGradientBoolean ¶
type SolidColorOverlayTransformationGradientBoolean = shared.SolidColorOverlayTransformationGradientBoolean
This is an alias to an internal type.
type SolidColorOverlayTransformationGradientUnionParam ¶
type SolidColorOverlayTransformationGradientUnionParam = shared.SolidColorOverlayTransformationGradientUnionParam
Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient).
This is an alias to an internal type.
type SolidColorOverlayTransformationHeightUnionParam ¶
type SolidColorOverlayTransformationHeightUnionParam = shared.SolidColorOverlayTransformationHeightUnionParam
Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
This is an alias to an internal type.
type SolidColorOverlayTransformationParam ¶
type SolidColorOverlayTransformationParam = shared.SolidColorOverlayTransformationParam
This is an alias to an internal type.
type SolidColorOverlayTransformationRadiusUnionParam ¶
type SolidColorOverlayTransformationRadiusUnionParam = shared.SolidColorOverlayTransformationRadiusUnionParam
Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
This is an alias to an internal type.
type SolidColorOverlayTransformationWidthUnionParam ¶
type SolidColorOverlayTransformationWidthUnionParam = shared.SolidColorOverlayTransformationWidthUnionParam
Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
This is an alias to an internal type.
type SrcOptionsParam ¶
type SrcOptionsParam = shared.SrcOptionsParam
Options for generating ImageKit URLs with transformations. See the [Transformations guide](https://imagekit.io/docs/transformations).
This is an alias to an internal type.
type StreamingResolution ¶
type StreamingResolution = shared.StreamingResolution
Available streaming resolutions for [adaptive bitrate streaming](https://imagekit.io/docs/adaptive-bitrate-streaming)
This is an alias to an internal type.
type SubtitleOverlayParam ¶
type SubtitleOverlayParam = shared.SubtitleOverlayParam
This is an alias to an internal type.
type SubtitleOverlayTransformationParam ¶
type SubtitleOverlayTransformationParam = shared.SubtitleOverlayTransformationParam
Subtitle styling options. [Learn more](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) from the docs.
This is an alias to an internal type.
type SubtitleOverlayTransformationTypography ¶
type SubtitleOverlayTransformationTypography = shared.SubtitleOverlayTransformationTypography
Sets the typography style of the subtitle text. Supports values are `b` for bold, `i` for italics, and `b_i` for bold with italics.
[Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer)
This is an alias to an internal type.
type TextOverlayParam ¶
type TextOverlayParam = shared.TextOverlayParam
This is an alias to an internal type.
type TextOverlayTransformationFlip ¶
type TextOverlayTransformationFlip = shared.TextOverlayTransformationFlip
Flip the text overlay horizontally, vertically, or both.
This is an alias to an internal type.
type TextOverlayTransformationFontSizeUnionParam ¶
type TextOverlayTransformationFontSizeUnionParam = shared.TextOverlayTransformationFontSizeUnionParam
Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression.
This is an alias to an internal type.
type TextOverlayTransformationInnerAlignment ¶
type TextOverlayTransformationInnerAlignment = shared.TextOverlayTransformationInnerAlignment
Specifies the inner alignment of the text when width is more than the text length.
This is an alias to an internal type.
type TextOverlayTransformationLineHeightUnionParam ¶
type TextOverlayTransformationLineHeightUnionParam = shared.TextOverlayTransformationLineHeightUnionParam
Specifies the line height of the text overlay. Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`.
This is an alias to an internal type.
type TextOverlayTransformationPaddingUnionParam ¶
type TextOverlayTransformationPaddingUnionParam = shared.TextOverlayTransformationPaddingUnionParam
Specifies the padding around the overlaid text. Can be provided as a single positive integer or multiple values separated by underscores (following CSS shorthand order). Arithmetic expressions are also accepted.
This is an alias to an internal type.
type TextOverlayTransformationParam ¶
type TextOverlayTransformationParam = shared.TextOverlayTransformationParam
This is an alias to an internal type.
type TextOverlayTransformationRadiusUnionParam ¶
type TextOverlayTransformationRadiusUnionParam = shared.TextOverlayTransformationRadiusUnionParam
Specifies the corner radius of the text overlay. Set to `max` to achieve a circular or oval shape.
This is an alias to an internal type.
type TextOverlayTransformationRotationUnionParam ¶
type TextOverlayTransformationRotationUnionParam = shared.TextOverlayTransformationRotationUnionParam
Specifies the rotation angle of the text overlay. Accepts a numeric value for clockwise rotation or a string prefixed with "N" for counter-clockwise rotation.
This is an alias to an internal type.
type TextOverlayTransformationWidthUnionParam ¶
type TextOverlayTransformationWidthUnionParam = shared.TextOverlayTransformationWidthUnionParam
Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
This is an alias to an internal type.
type TransformationAIDropShadowBoolean ¶
type TransformationAIDropShadowBoolean = shared.TransformationAIDropShadowBoolean
This is an alias to an internal type.
type TransformationAIDropShadowUnionParam ¶
type TransformationAIDropShadowUnionParam = shared.TransformationAIDropShadowUnionParam
Adds an AI-based drop shadow around a foreground object on a transparent or removed background. Optionally, control the direction, elevation, and saturation of the light source (e.g., `az-45` to change light direction). Pass `true` for the default drop shadow, or provide a string for a custom drop shadow. Supported inside overlay. See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow).
This is an alias to an internal type.
type TransformationAspectRatioUnionParam ¶
type TransformationAspectRatioUnionParam = shared.TransformationAspectRatioUnionParam
Specifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). For example: aspectRatio = `4:3`, `4_3`, or an expression like `iar_div_2`. See [Image resize and crop – Aspect ratio](https://imagekit.io/docs/image-resize-and-crop#aspect-ratio---ar).
This is an alias to an internal type.
type TransformationAudioCodec ¶
type TransformationAudioCodec = shared.TransformationAudioCodec
Specifies the audio codec, e.g., `aac`, `opus`, or `none`. See [Audio codec](https://imagekit.io/docs/video-optimization#audio-codec---ac).
This is an alias to an internal type.
type TransformationCrop ¶
type TransformationCrop = shared.TransformationCrop
Crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus).
This is an alias to an internal type.
type TransformationCropMode ¶
type TransformationCropMode = shared.TransformationCropMode
Additional crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus).
This is an alias to an internal type.
type TransformationDurationUnionParam ¶
type TransformationDurationUnionParam = shared.TransformationDurationUnionParam
Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. See [Trim videos – Duration](https://imagekit.io/docs/trim-videos#duration---du).
This is an alias to an internal type.
type TransformationEndOffsetUnionParam ¶
type TransformationEndOffsetUnionParam = shared.TransformationEndOffsetUnionParam
Specifies the end offset (in seconds) for trimming videos, e.g., `5` or `10.5`. Typically used with startOffset to define a time window. Arithmetic expressions are supported. See [Trim videos – End offset](https://imagekit.io/docs/trim-videos#end-offset---eo).
This is an alias to an internal type.
type TransformationFlip ¶
type TransformationFlip = shared.TransformationFlip
Flips or mirrors an image either horizontally, vertically, or both. Acceptable values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or `v_h`. See [Flip](https://imagekit.io/docs/effects-and-enhancements#flip---fl).
This is an alias to an internal type.
type TransformationFormat ¶
type TransformationFormat = shared.TransformationFormat
Specifies the output format for images or videos, e.g., `jpg`, `png`, `webp`, `mp4`, or `auto`. You can also pass `orig` for images to return the original format. ImageKit automatically delivers images and videos in the optimal format based on device support unless overridden by the dashboard settings or the format parameter. See [Image format](https://imagekit.io/docs/image-optimization#format---f) and [Video format](https://imagekit.io/docs/video-optimization#format---f).
This is an alias to an internal type.
type TransformationGradientBoolean ¶
type TransformationGradientBoolean = shared.TransformationGradientBoolean
This is an alias to an internal type.
type TransformationGradientUnionParam ¶
type TransformationGradientUnionParam = shared.TransformationGradientUnionParam
Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient).
This is an alias to an internal type.
type TransformationHeightUnionParam ¶
type TransformationHeightUnionParam = shared.TransformationHeightUnionParam
Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.5` represents 50% of the original height). You can also supply arithmetic expressions (e.g., `ih_mul_0.5`). Height transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#height---h) · [Videos](https://imagekit.io/docs/video-resize-and-crop#height---h)
This is an alias to an internal type.
type TransformationPageUnionParam ¶
type TransformationPageUnionParam = shared.TransformationPageUnionParam
Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). For example, specify by number (e.g., `2`), a range (e.g., `3-4` for the 2nd and 3rd layers), or by name (e.g., `name-layer-4` for a PSD layer). See [Thumbnail extraction](https://imagekit.io/docs/vector-and-animated-images#get-thumbnail-from-psd-pdf-ai-eps-and-animated-files).
This is an alias to an internal type.
type TransformationParam ¶
type TransformationParam = shared.TransformationParam
The SDK provides easy-to-use names for transformations. These names are converted to the corresponding transformation string before being added to the URL. SDKs are updated regularly to support new transformations. If you want to use a transformation that is not supported by the SDK, You can use the `raw` parameter to pass the transformation string directly. See the [Transformations documentation](https://imagekit.io/docs/transformations).
This is an alias to an internal type.
type TransformationPosition ¶
type TransformationPosition = shared.TransformationPosition
By default, the transformation string is added as a query parameter in the URL, e.g., `?tr=w-100,h-100`. If you want to add the transformation string in the path of the URL, set this to `path`. Learn more in the [Transformations guide](https://imagekit.io/docs/transformations).
This is an alias to an internal type.
type TransformationRadiusUnionParam ¶
type TransformationRadiusUnionParam = shared.TransformationRadiusUnionParam
Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
This is an alias to an internal type.
type TransformationRotationUnionParam ¶
type TransformationRotationUnionParam = shared.TransformationRotationUnionParam
Specifies the rotation angle in degrees. Positive values rotate the image clockwise; you can also use, for example, `N40` for counterclockwise rotation or `auto` to use the orientation specified in the image's EXIF data. For videos, only the following values are supported: 0, 90, 180, 270, or 360. See [Rotate](https://imagekit.io/docs/effects-and-enhancements#rotate---rt).
This is an alias to an internal type.
type TransformationShadowBoolean ¶
type TransformationShadowBoolean = shared.TransformationShadowBoolean
This is an alias to an internal type.
type TransformationShadowUnionParam ¶
type TransformationShadowUnionParam = shared.TransformationShadowUnionParam
Adds a shadow beneath solid objects in an image with a transparent background. For AI-based drop shadows, refer to aiDropShadow. Pass `true` for a default shadow, or provide a string for a custom shadow. See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow).
This is an alias to an internal type.
type TransformationSharpenBoolean ¶
type TransformationSharpenBoolean = shared.TransformationSharpenBoolean
This is an alias to an internal type.
type TransformationSharpenUnionParam ¶
type TransformationSharpenUnionParam = shared.TransformationSharpenUnionParam
Sharpens the input image, highlighting edges and finer details. Pass `true` for default sharpening, or provide a numeric value for custom sharpening. See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen).
This is an alias to an internal type.
type TransformationStartOffsetUnionParam ¶
type TransformationStartOffsetUnionParam = shared.TransformationStartOffsetUnionParam
Specifies the start offset (in seconds) for trimming videos, e.g., `5` or `10.5`. Arithmetic expressions are also supported. See [Trim videos – Start offset](https://imagekit.io/docs/trim-videos#start-offset---so).
This is an alias to an internal type.
type TransformationTrimBoolean ¶
type TransformationTrimBoolean = shared.TransformationTrimBoolean
This is an alias to an internal type.
type TransformationTrimUnionParam ¶
type TransformationTrimUnionParam = shared.TransformationTrimUnionParam
Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, leaving only the central object in the output image. See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t).
This is an alias to an internal type.
type TransformationUnsharpMaskBoolean ¶
type TransformationUnsharpMaskBoolean = shared.TransformationUnsharpMaskBoolean
This is an alias to an internal type.
type TransformationUnsharpMaskUnionParam ¶
type TransformationUnsharpMaskUnionParam = shared.TransformationUnsharpMaskUnionParam
Applies Unsharp Masking (USM), an image sharpening technique. Pass `true` for a default unsharp mask, or provide a string for a custom unsharp mask. See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm).
This is an alias to an internal type.
type TransformationVideoCodec ¶
type TransformationVideoCodec = shared.TransformationVideoCodec
Specifies the video codec, e.g., `h264`, `vp9`, `av1`, or `none`. See [Video codec](https://imagekit.io/docs/video-optimization#video-codec---vc).
This is an alias to an internal type.
type TransformationWidthUnionParam ¶
type TransformationWidthUnionParam = shared.TransformationWidthUnionParam
Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.4` represents 40% of the original width). You can also supply arithmetic expressions (e.g., `iw_div_2`). Width transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#width---w) · [Videos](https://imagekit.io/docs/video-resize-and-crop#width---w)
This is an alias to an internal type.
type TransformationXCenterUnionParam ¶
type TransformationXCenterUnionParam = shared.TransformationXCenterUnionParam
Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates).
This is an alias to an internal type.
type TransformationXUnionParam ¶
type TransformationXUnionParam = shared.TransformationXUnionParam
Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates).
This is an alias to an internal type.
type TransformationYCenterUnionParam ¶
type TransformationYCenterUnionParam = shared.TransformationYCenterUnionParam
Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates).
This is an alias to an internal type.
type TransformationYUnionParam ¶
type TransformationYUnionParam = shared.TransformationYUnionParam
Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates).
This is an alias to an internal type.
type URLEndpointRequestParam ¶
type URLEndpointRequestParam struct {
// Description of the URL endpoint.
Description string `json:"description,required"`
// Path segment appended to your base URL to form the endpoint (letters, digits,
// and hyphens only — or empty for the default endpoint).
URLPrefix param.Opt[string] `json:"urlPrefix,omitzero"`
// Ordered list of origin IDs to try when the file isn’t in the Media Library;
// ImageKit checks them in the sequence provided. Origin must be created before it
// can be used in a URL endpoint.
Origins []string `json:"origins,omitzero"`
// Configuration for third-party URL rewriting.
URLRewriter URLEndpointRequestURLRewriterUnionParam `json:"urlRewriter,omitzero"`
// contains filtered or unexported fields
}
Schema for URL endpoint resource.
The property Description is required.
func (URLEndpointRequestParam) MarshalJSON ¶
func (r URLEndpointRequestParam) MarshalJSON() (data []byte, err error)
func (*URLEndpointRequestParam) UnmarshalJSON ¶
func (r *URLEndpointRequestParam) UnmarshalJSON(data []byte) error
type URLEndpointRequestURLRewriterAkamaiParam ¶
type URLEndpointRequestURLRewriterAkamaiParam struct {
Type constant.Akamai `json:"type,required"`
// contains filtered or unexported fields
}
This struct has a constant value, construct it with NewURLEndpointRequestURLRewriterAkamaiParam.
func NewURLEndpointRequestURLRewriterAkamaiParam ¶
func NewURLEndpointRequestURLRewriterAkamaiParam() URLEndpointRequestURLRewriterAkamaiParam
func (URLEndpointRequestURLRewriterAkamaiParam) MarshalJSON ¶
func (r URLEndpointRequestURLRewriterAkamaiParam) MarshalJSON() (data []byte, err error)
func (*URLEndpointRequestURLRewriterAkamaiParam) UnmarshalJSON ¶
func (r *URLEndpointRequestURLRewriterAkamaiParam) UnmarshalJSON(data []byte) error
type URLEndpointRequestURLRewriterCloudinaryParam ¶
type URLEndpointRequestURLRewriterCloudinaryParam struct {
// Whether to preserve `<asset_type>/<delivery_type>` in the rewritten URL.
PreserveAssetDeliveryTypes param.Opt[bool] `json:"preserveAssetDeliveryTypes,omitzero"`
// This field can be elided, and will marshal its zero value as "CLOUDINARY".
Type constant.Cloudinary `json:"type,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (URLEndpointRequestURLRewriterCloudinaryParam) MarshalJSON ¶
func (r URLEndpointRequestURLRewriterCloudinaryParam) MarshalJSON() (data []byte, err error)
func (*URLEndpointRequestURLRewriterCloudinaryParam) UnmarshalJSON ¶
func (r *URLEndpointRequestURLRewriterCloudinaryParam) UnmarshalJSON(data []byte) error
type URLEndpointRequestURLRewriterImgixParam ¶
type URLEndpointRequestURLRewriterImgixParam struct {
Type constant.Imgix `json:"type,required"`
// contains filtered or unexported fields
}
This struct has a constant value, construct it with NewURLEndpointRequestURLRewriterImgixParam.
func NewURLEndpointRequestURLRewriterImgixParam ¶
func NewURLEndpointRequestURLRewriterImgixParam() URLEndpointRequestURLRewriterImgixParam
func (URLEndpointRequestURLRewriterImgixParam) MarshalJSON ¶
func (r URLEndpointRequestURLRewriterImgixParam) MarshalJSON() (data []byte, err error)
func (*URLEndpointRequestURLRewriterImgixParam) UnmarshalJSON ¶
func (r *URLEndpointRequestURLRewriterImgixParam) UnmarshalJSON(data []byte) error
type URLEndpointRequestURLRewriterUnionParam ¶
type URLEndpointRequestURLRewriterUnionParam struct {
OfCloudinary *URLEndpointRequestURLRewriterCloudinaryParam `json:",omitzero,inline"`
OfImgix *URLEndpointRequestURLRewriterImgixParam `json:",omitzero,inline"`
OfAkamai *URLEndpointRequestURLRewriterAkamaiParam `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 (URLEndpointRequestURLRewriterUnionParam) GetPreserveAssetDeliveryTypes ¶
func (u URLEndpointRequestURLRewriterUnionParam) GetPreserveAssetDeliveryTypes() *bool
Returns a pointer to the underlying variant's property, if present.
func (URLEndpointRequestURLRewriterUnionParam) GetType ¶
func (u URLEndpointRequestURLRewriterUnionParam) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (URLEndpointRequestURLRewriterUnionParam) MarshalJSON ¶
func (u URLEndpointRequestURLRewriterUnionParam) MarshalJSON() ([]byte, error)
func (*URLEndpointRequestURLRewriterUnionParam) UnmarshalJSON ¶
func (u *URLEndpointRequestURLRewriterUnionParam) UnmarshalJSON(data []byte) error
type URLEndpointResponse ¶
type URLEndpointResponse struct {
// Unique identifier for the URL-endpoint. This is generated by ImageKit when you
// create a new URL-endpoint. For the default URL-endpoint, this is always
// `default`.
ID string `json:"id,required"`
// Description of the URL endpoint.
Description string `json:"description,required"`
// Ordered list of origin IDs to try when the file isn’t in the Media Library;
// ImageKit checks them in the sequence provided. Origin must be created before it
// can be used in a URL endpoint.
Origins []string `json:"origins,required"`
// Path segment appended to your base URL to form the endpoint (letters, digits,
// and hyphens only — or empty for the default endpoint).
URLPrefix string `json:"urlPrefix,required"`
// Configuration for third-party URL rewriting.
URLRewriter URLEndpointResponseURLRewriterUnion `json:"urlRewriter"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Description respjson.Field
Origins respjson.Field
URLPrefix respjson.Field
URLRewriter respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
URL‑endpoint object as returned by the API.
func (URLEndpointResponse) RawJSON ¶
func (r URLEndpointResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*URLEndpointResponse) UnmarshalJSON ¶
func (r *URLEndpointResponse) UnmarshalJSON(data []byte) error
type URLEndpointResponseURLRewriterAkamai ¶
type URLEndpointResponseURLRewriterAkamai struct {
Type constant.Akamai `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (URLEndpointResponseURLRewriterAkamai) RawJSON ¶
func (r URLEndpointResponseURLRewriterAkamai) RawJSON() string
Returns the unmodified JSON received from the API
func (*URLEndpointResponseURLRewriterAkamai) UnmarshalJSON ¶
func (r *URLEndpointResponseURLRewriterAkamai) UnmarshalJSON(data []byte) error
type URLEndpointResponseURLRewriterCloudinary ¶
type URLEndpointResponseURLRewriterCloudinary struct {
// Whether to preserve `<asset_type>/<delivery_type>` in the rewritten URL.
PreserveAssetDeliveryTypes bool `json:"preserveAssetDeliveryTypes,required"`
Type constant.Cloudinary `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PreserveAssetDeliveryTypes respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (URLEndpointResponseURLRewriterCloudinary) RawJSON ¶
func (r URLEndpointResponseURLRewriterCloudinary) RawJSON() string
Returns the unmodified JSON received from the API
func (*URLEndpointResponseURLRewriterCloudinary) UnmarshalJSON ¶
func (r *URLEndpointResponseURLRewriterCloudinary) UnmarshalJSON(data []byte) error
type URLEndpointResponseURLRewriterImgix ¶
type URLEndpointResponseURLRewriterImgix struct {
Type constant.Imgix `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (URLEndpointResponseURLRewriterImgix) RawJSON ¶
func (r URLEndpointResponseURLRewriterImgix) RawJSON() string
Returns the unmodified JSON received from the API
func (*URLEndpointResponseURLRewriterImgix) UnmarshalJSON ¶
func (r *URLEndpointResponseURLRewriterImgix) UnmarshalJSON(data []byte) error
type URLEndpointResponseURLRewriterUnion ¶
type URLEndpointResponseURLRewriterUnion struct {
// This field is from variant [URLEndpointResponseURLRewriterCloudinary].
PreserveAssetDeliveryTypes bool `json:"preserveAssetDeliveryTypes"`
// Any of "CLOUDINARY", "IMGIX", "AKAMAI".
Type string `json:"type"`
JSON struct {
PreserveAssetDeliveryTypes respjson.Field
Type respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
URLEndpointResponseURLRewriterUnion contains all possible properties and values from URLEndpointResponseURLRewriterCloudinary, URLEndpointResponseURLRewriterImgix, URLEndpointResponseURLRewriterAkamai.
Use the URLEndpointResponseURLRewriterUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (URLEndpointResponseURLRewriterUnion) AsAkamai ¶
func (u URLEndpointResponseURLRewriterUnion) AsAkamai() (v URLEndpointResponseURLRewriterAkamai)
func (URLEndpointResponseURLRewriterUnion) AsAny ¶
func (u URLEndpointResponseURLRewriterUnion) AsAny() anyURLEndpointResponseURLRewriter
Use the following switch statement to find the correct variant
switch variant := URLEndpointResponseURLRewriterUnion.AsAny().(type) {
case imagekit.URLEndpointResponseURLRewriterCloudinary:
case imagekit.URLEndpointResponseURLRewriterImgix:
case imagekit.URLEndpointResponseURLRewriterAkamai:
default:
fmt.Errorf("no variant present")
}
func (URLEndpointResponseURLRewriterUnion) AsCloudinary ¶
func (u URLEndpointResponseURLRewriterUnion) AsCloudinary() (v URLEndpointResponseURLRewriterCloudinary)
func (URLEndpointResponseURLRewriterUnion) AsImgix ¶
func (u URLEndpointResponseURLRewriterUnion) AsImgix() (v URLEndpointResponseURLRewriterImgix)
func (URLEndpointResponseURLRewriterUnion) RawJSON ¶
func (u URLEndpointResponseURLRewriterUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*URLEndpointResponseURLRewriterUnion) UnmarshalJSON ¶
func (r *URLEndpointResponseURLRewriterUnion) UnmarshalJSON(data []byte) error
type UnsafeUnwrapWebhookEventUnion ¶
type UnsafeUnwrapWebhookEventUnion struct {
// This field is from variant [VideoTransformationAcceptedEvent],
// [VideoTransformationReadyEvent], [VideoTransformationErrorEvent],
// [UploadPreTransformSuccessEvent], [UploadPreTransformErrorEvent],
// [UploadPostTransformSuccessEvent], [UploadPostTransformErrorEvent].
ID string `json:"id"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
// This field is a union of [VideoTransformationAcceptedEventData],
// [VideoTransformationReadyEventData], [VideoTransformationErrorEventData],
// [UploadPreTransformSuccessEventData], [UploadPreTransformErrorEventData],
// [UploadPostTransformSuccessEventData], [UploadPostTransformErrorEventData]
Data UnsafeUnwrapWebhookEventUnionData `json:"data"`
// This field is a union of [VideoTransformationAcceptedEventRequest],
// [VideoTransformationReadyEventRequest], [VideoTransformationErrorEventRequest],
// [UploadPreTransformSuccessEventRequest], [UploadPreTransformErrorEventRequest],
// [UploadPostTransformSuccessEventRequest], [UploadPostTransformErrorEventRequest]
Request UnsafeUnwrapWebhookEventUnionRequest `json:"request"`
// This field is from variant [VideoTransformationReadyEvent].
Timings VideoTransformationReadyEventTimings `json:"timings"`
JSON struct {
ID respjson.Field
Type respjson.Field
CreatedAt respjson.Field
Data respjson.Field
Request respjson.Field
Timings respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnsafeUnwrapWebhookEventUnion contains all possible properties and values from VideoTransformationAcceptedEvent, VideoTransformationReadyEvent, VideoTransformationErrorEvent, UploadPreTransformSuccessEvent, UploadPreTransformErrorEvent, UploadPostTransformSuccessEvent, UploadPostTransformErrorEvent.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (UnsafeUnwrapWebhookEventUnion) AsUploadPostTransformErrorEvent ¶
func (u UnsafeUnwrapWebhookEventUnion) AsUploadPostTransformErrorEvent() (v UploadPostTransformErrorEvent)
func (UnsafeUnwrapWebhookEventUnion) AsUploadPostTransformSuccessEvent ¶
func (u UnsafeUnwrapWebhookEventUnion) AsUploadPostTransformSuccessEvent() (v UploadPostTransformSuccessEvent)
func (UnsafeUnwrapWebhookEventUnion) AsUploadPreTransformErrorEvent ¶
func (u UnsafeUnwrapWebhookEventUnion) AsUploadPreTransformErrorEvent() (v UploadPreTransformErrorEvent)
func (UnsafeUnwrapWebhookEventUnion) AsUploadPreTransformSuccessEvent ¶
func (u UnsafeUnwrapWebhookEventUnion) AsUploadPreTransformSuccessEvent() (v UploadPreTransformSuccessEvent)
func (UnsafeUnwrapWebhookEventUnion) AsVideoTransformationAcceptedEvent ¶
func (u UnsafeUnwrapWebhookEventUnion) AsVideoTransformationAcceptedEvent() (v VideoTransformationAcceptedEvent)
func (UnsafeUnwrapWebhookEventUnion) AsVideoTransformationErrorEvent ¶
func (u UnsafeUnwrapWebhookEventUnion) AsVideoTransformationErrorEvent() (v VideoTransformationErrorEvent)
func (UnsafeUnwrapWebhookEventUnion) AsVideoTransformationReadyEvent ¶
func (u UnsafeUnwrapWebhookEventUnion) AsVideoTransformationReadyEvent() (v VideoTransformationReadyEvent)
func (UnsafeUnwrapWebhookEventUnion) RawJSON ¶
func (u UnsafeUnwrapWebhookEventUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*UnsafeUnwrapWebhookEventUnion) UnmarshalJSON ¶
func (r *UnsafeUnwrapWebhookEventUnion) UnmarshalJSON(data []byte) error
type UnsafeUnwrapWebhookEventUnionData ¶
type UnsafeUnwrapWebhookEventUnionData struct {
// This field is a union of [VideoTransformationAcceptedEventDataAsset],
// [VideoTransformationReadyEventDataAsset],
// [VideoTransformationErrorEventDataAsset]
Asset UnsafeUnwrapWebhookEventUnionDataAsset `json:"asset"`
// This field is a union of [VideoTransformationAcceptedEventDataTransformation],
// [VideoTransformationReadyEventDataTransformation],
// [VideoTransformationErrorEventDataTransformation],
// [UploadPreTransformErrorEventDataTransformation],
// [UploadPostTransformErrorEventDataTransformation]
Transformation UnsafeUnwrapWebhookEventUnionDataTransformation `json:"transformation"`
// This field is from variant [UploadPreTransformSuccessEventData].
AITags []UploadPreTransformSuccessEventDataAITag `json:"AITags"`
// This field is from variant [UploadPreTransformSuccessEventData].
AudioCodec string `json:"audioCodec"`
// This field is from variant [UploadPreTransformSuccessEventData].
BitRate int64 `json:"bitRate"`
// This field is from variant [UploadPreTransformSuccessEventData].
CustomCoordinates string `json:"customCoordinates"`
// This field is from variant [UploadPreTransformSuccessEventData].
CustomMetadata map[string]any `json:"customMetadata"`
// This field is from variant [UploadPreTransformSuccessEventData].
Description string `json:"description"`
// This field is from variant [UploadPreTransformSuccessEventData].
Duration int64 `json:"duration"`
// This field is from variant [UploadPreTransformSuccessEventData].
EmbeddedMetadata map[string]any `json:"embeddedMetadata"`
// This field is from variant [UploadPreTransformSuccessEventData].
ExtensionStatus UploadPreTransformSuccessEventDataExtensionStatus `json:"extensionStatus"`
FileID string `json:"fileId"`
// This field is from variant [UploadPreTransformSuccessEventData].
FilePath string `json:"filePath"`
// This field is from variant [UploadPreTransformSuccessEventData].
FileType string `json:"fileType"`
// This field is from variant [UploadPreTransformSuccessEventData].
Height float64 `json:"height"`
// This field is from variant [UploadPreTransformSuccessEventData].
IsPrivateFile bool `json:"isPrivateFile"`
// This field is from variant [UploadPreTransformSuccessEventData].
IsPublished bool `json:"isPublished"`
// This field is from variant [UploadPreTransformSuccessEventData].
Metadata Metadata `json:"metadata"`
Name string `json:"name"`
// This field is from variant [UploadPreTransformSuccessEventData].
SelectedFieldsSchema map[string]UploadPreTransformSuccessEventDataSelectedFieldsSchema `json:"selectedFieldsSchema"`
// This field is from variant [UploadPreTransformSuccessEventData].
Size float64 `json:"size"`
// This field is from variant [UploadPreTransformSuccessEventData].
Tags []string `json:"tags"`
// This field is from variant [UploadPreTransformSuccessEventData].
ThumbnailURL string `json:"thumbnailUrl"`
URL string `json:"url"`
// This field is from variant [UploadPreTransformSuccessEventData].
VersionInfo UploadPreTransformSuccessEventDataVersionInfo `json:"versionInfo"`
// This field is from variant [UploadPreTransformSuccessEventData].
VideoCodec string `json:"videoCodec"`
// This field is from variant [UploadPreTransformSuccessEventData].
Width float64 `json:"width"`
Path string `json:"path"`
JSON struct {
Asset respjson.Field
Transformation respjson.Field
AITags respjson.Field
AudioCodec respjson.Field
BitRate respjson.Field
CustomCoordinates respjson.Field
CustomMetadata respjson.Field
Description respjson.Field
Duration respjson.Field
EmbeddedMetadata respjson.Field
ExtensionStatus respjson.Field
FileID respjson.Field
FilePath respjson.Field
FileType respjson.Field
Height respjson.Field
IsPrivateFile respjson.Field
IsPublished respjson.Field
Metadata respjson.Field
Name respjson.Field
SelectedFieldsSchema respjson.Field
Size respjson.Field
Tags respjson.Field
ThumbnailURL respjson.Field
URL respjson.Field
VersionInfo respjson.Field
VideoCodec respjson.Field
Width respjson.Field
Path respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnsafeUnwrapWebhookEventUnionData is an implicit subunion of UnsafeUnwrapWebhookEventUnion. UnsafeUnwrapWebhookEventUnionData provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnsafeUnwrapWebhookEventUnion.
func (*UnsafeUnwrapWebhookEventUnionData) UnmarshalJSON ¶
func (r *UnsafeUnwrapWebhookEventUnionData) UnmarshalJSON(data []byte) error
type UnsafeUnwrapWebhookEventUnionDataAsset ¶
type UnsafeUnwrapWebhookEventUnionDataAsset struct {
URL string `json:"url"`
JSON struct {
URL respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnsafeUnwrapWebhookEventUnionDataAsset is an implicit subunion of UnsafeUnwrapWebhookEventUnion. UnsafeUnwrapWebhookEventUnionDataAsset provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnsafeUnwrapWebhookEventUnion.
func (*UnsafeUnwrapWebhookEventUnionDataAsset) UnmarshalJSON ¶
func (r *UnsafeUnwrapWebhookEventUnionDataAsset) UnmarshalJSON(data []byte) error
type UnsafeUnwrapWebhookEventUnionDataTransformation ¶
type UnsafeUnwrapWebhookEventUnionDataTransformation struct {
Type string `json:"type"`
// This field is a union of
// [VideoTransformationAcceptedEventDataTransformationOptions],
// [VideoTransformationReadyEventDataTransformationOptions],
// [VideoTransformationErrorEventDataTransformationOptions]
Options UnsafeUnwrapWebhookEventUnionDataTransformationOptions `json:"options"`
// This field is from variant [VideoTransformationReadyEventDataTransformation].
Output VideoTransformationReadyEventDataTransformationOutput `json:"output"`
// This field is a union of [VideoTransformationErrorEventDataTransformationError],
// [UploadPreTransformErrorEventDataTransformationError],
// [UploadPostTransformErrorEventDataTransformationError]
Error UnsafeUnwrapWebhookEventUnionDataTransformationError `json:"error"`
JSON struct {
Type respjson.Field
Options respjson.Field
Output respjson.Field
Error respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnsafeUnwrapWebhookEventUnionDataTransformation is an implicit subunion of UnsafeUnwrapWebhookEventUnion. UnsafeUnwrapWebhookEventUnionDataTransformation provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnsafeUnwrapWebhookEventUnion.
func (*UnsafeUnwrapWebhookEventUnionDataTransformation) UnmarshalJSON ¶
func (r *UnsafeUnwrapWebhookEventUnionDataTransformation) UnmarshalJSON(data []byte) error
type UnsafeUnwrapWebhookEventUnionDataTransformationError ¶
type UnsafeUnwrapWebhookEventUnionDataTransformationError struct {
Reason string `json:"reason"`
JSON struct {
Reason respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnsafeUnwrapWebhookEventUnionDataTransformationError is an implicit subunion of UnsafeUnwrapWebhookEventUnion. UnsafeUnwrapWebhookEventUnionDataTransformationError provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnsafeUnwrapWebhookEventUnion.
func (*UnsafeUnwrapWebhookEventUnionDataTransformationError) UnmarshalJSON ¶
func (r *UnsafeUnwrapWebhookEventUnionDataTransformationError) UnmarshalJSON(data []byte) error
type UnsafeUnwrapWebhookEventUnionDataTransformationOptions ¶
type UnsafeUnwrapWebhookEventUnionDataTransformationOptions struct {
AudioCodec string `json:"audio_codec"`
AutoRotate bool `json:"auto_rotate"`
Format string `json:"format"`
Quality int64 `json:"quality"`
StreamProtocol string `json:"stream_protocol"`
Variants []string `json:"variants"`
VideoCodec string `json:"video_codec"`
JSON struct {
AudioCodec respjson.Field
AutoRotate respjson.Field
Format respjson.Field
Quality respjson.Field
StreamProtocol respjson.Field
Variants respjson.Field
VideoCodec respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnsafeUnwrapWebhookEventUnionDataTransformationOptions is an implicit subunion of UnsafeUnwrapWebhookEventUnion. UnsafeUnwrapWebhookEventUnionDataTransformationOptions provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnsafeUnwrapWebhookEventUnion.
func (*UnsafeUnwrapWebhookEventUnionDataTransformationOptions) UnmarshalJSON ¶
func (r *UnsafeUnwrapWebhookEventUnionDataTransformationOptions) UnmarshalJSON(data []byte) error
type UnsafeUnwrapWebhookEventUnionRequest ¶
type UnsafeUnwrapWebhookEventUnionRequest struct {
URL string `json:"url"`
XRequestID string `json:"x_request_id"`
UserAgent string `json:"user_agent"`
// This field is a union of [string], [string],
// [UploadPostTransformSuccessEventRequestTransformation],
// [UploadPostTransformErrorEventRequestTransformation]
Transformation UnsafeUnwrapWebhookEventUnionRequestTransformation `json:"transformation"`
JSON struct {
URL respjson.Field
XRequestID respjson.Field
UserAgent respjson.Field
Transformation respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnsafeUnwrapWebhookEventUnionRequest is an implicit subunion of UnsafeUnwrapWebhookEventUnion. UnsafeUnwrapWebhookEventUnionRequest provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnsafeUnwrapWebhookEventUnion.
func (*UnsafeUnwrapWebhookEventUnionRequest) UnmarshalJSON ¶
func (r *UnsafeUnwrapWebhookEventUnionRequest) UnmarshalJSON(data []byte) error
type UnsafeUnwrapWebhookEventUnionRequestTransformation ¶
type UnsafeUnwrapWebhookEventUnionRequestTransformation struct {
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
Type string `json:"type"`
Protocol string `json:"protocol"`
Value string `json:"value"`
JSON struct {
OfString respjson.Field
Type respjson.Field
Protocol respjson.Field
Value respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnsafeUnwrapWebhookEventUnionRequestTransformation is an implicit subunion of UnsafeUnwrapWebhookEventUnion. UnsafeUnwrapWebhookEventUnionRequestTransformation provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnsafeUnwrapWebhookEventUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfString]
func (*UnsafeUnwrapWebhookEventUnionRequestTransformation) UnmarshalJSON ¶
func (r *UnsafeUnwrapWebhookEventUnionRequestTransformation) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnion ¶
type UnwrapWebhookEventUnion struct {
// This field is from variant [VideoTransformationAcceptedEvent],
// [VideoTransformationReadyEvent], [VideoTransformationErrorEvent],
// [UploadPreTransformSuccessEvent], [UploadPreTransformErrorEvent],
// [UploadPostTransformSuccessEvent], [UploadPostTransformErrorEvent].
ID string `json:"id"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
// This field is a union of [VideoTransformationAcceptedEventData],
// [VideoTransformationReadyEventData], [VideoTransformationErrorEventData],
// [UploadPreTransformSuccessEventData], [UploadPreTransformErrorEventData],
// [UploadPostTransformSuccessEventData], [UploadPostTransformErrorEventData]
Data UnwrapWebhookEventUnionData `json:"data"`
// This field is a union of [VideoTransformationAcceptedEventRequest],
// [VideoTransformationReadyEventRequest], [VideoTransformationErrorEventRequest],
// [UploadPreTransformSuccessEventRequest], [UploadPreTransformErrorEventRequest],
// [UploadPostTransformSuccessEventRequest], [UploadPostTransformErrorEventRequest]
Request UnwrapWebhookEventUnionRequest `json:"request"`
// This field is from variant [VideoTransformationReadyEvent].
Timings VideoTransformationReadyEventTimings `json:"timings"`
JSON struct {
ID respjson.Field
Type respjson.Field
CreatedAt respjson.Field
Data respjson.Field
Request respjson.Field
Timings respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnion contains all possible properties and values from VideoTransformationAcceptedEvent, VideoTransformationReadyEvent, VideoTransformationErrorEvent, UploadPreTransformSuccessEvent, UploadPreTransformErrorEvent, UploadPostTransformSuccessEvent, UploadPostTransformErrorEvent.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (UnwrapWebhookEventUnion) AsUploadPostTransformErrorEvent ¶
func (u UnwrapWebhookEventUnion) AsUploadPostTransformErrorEvent() (v UploadPostTransformErrorEvent)
func (UnwrapWebhookEventUnion) AsUploadPostTransformSuccessEvent ¶
func (u UnwrapWebhookEventUnion) AsUploadPostTransformSuccessEvent() (v UploadPostTransformSuccessEvent)
func (UnwrapWebhookEventUnion) AsUploadPreTransformErrorEvent ¶
func (u UnwrapWebhookEventUnion) AsUploadPreTransformErrorEvent() (v UploadPreTransformErrorEvent)
func (UnwrapWebhookEventUnion) AsUploadPreTransformSuccessEvent ¶
func (u UnwrapWebhookEventUnion) AsUploadPreTransformSuccessEvent() (v UploadPreTransformSuccessEvent)
func (UnwrapWebhookEventUnion) AsVideoTransformationAcceptedEvent ¶
func (u UnwrapWebhookEventUnion) AsVideoTransformationAcceptedEvent() (v VideoTransformationAcceptedEvent)
func (UnwrapWebhookEventUnion) AsVideoTransformationErrorEvent ¶
func (u UnwrapWebhookEventUnion) AsVideoTransformationErrorEvent() (v VideoTransformationErrorEvent)
func (UnwrapWebhookEventUnion) AsVideoTransformationReadyEvent ¶
func (u UnwrapWebhookEventUnion) AsVideoTransformationReadyEvent() (v VideoTransformationReadyEvent)
func (UnwrapWebhookEventUnion) RawJSON ¶
func (u UnwrapWebhookEventUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*UnwrapWebhookEventUnion) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnion) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnionData ¶
type UnwrapWebhookEventUnionData struct {
// This field is a union of [VideoTransformationAcceptedEventDataAsset],
// [VideoTransformationReadyEventDataAsset],
// [VideoTransformationErrorEventDataAsset]
Asset UnwrapWebhookEventUnionDataAsset `json:"asset"`
// This field is a union of [VideoTransformationAcceptedEventDataTransformation],
// [VideoTransformationReadyEventDataTransformation],
// [VideoTransformationErrorEventDataTransformation],
// [UploadPreTransformErrorEventDataTransformation],
// [UploadPostTransformErrorEventDataTransformation]
Transformation UnwrapWebhookEventUnionDataTransformation `json:"transformation"`
// This field is from variant [UploadPreTransformSuccessEventData].
AITags []UploadPreTransformSuccessEventDataAITag `json:"AITags"`
// This field is from variant [UploadPreTransformSuccessEventData].
AudioCodec string `json:"audioCodec"`
// This field is from variant [UploadPreTransformSuccessEventData].
BitRate int64 `json:"bitRate"`
// This field is from variant [UploadPreTransformSuccessEventData].
CustomCoordinates string `json:"customCoordinates"`
// This field is from variant [UploadPreTransformSuccessEventData].
CustomMetadata map[string]any `json:"customMetadata"`
// This field is from variant [UploadPreTransformSuccessEventData].
Description string `json:"description"`
// This field is from variant [UploadPreTransformSuccessEventData].
Duration int64 `json:"duration"`
// This field is from variant [UploadPreTransformSuccessEventData].
EmbeddedMetadata map[string]any `json:"embeddedMetadata"`
// This field is from variant [UploadPreTransformSuccessEventData].
ExtensionStatus UploadPreTransformSuccessEventDataExtensionStatus `json:"extensionStatus"`
FileID string `json:"fileId"`
// This field is from variant [UploadPreTransformSuccessEventData].
FilePath string `json:"filePath"`
// This field is from variant [UploadPreTransformSuccessEventData].
FileType string `json:"fileType"`
// This field is from variant [UploadPreTransformSuccessEventData].
Height float64 `json:"height"`
// This field is from variant [UploadPreTransformSuccessEventData].
IsPrivateFile bool `json:"isPrivateFile"`
// This field is from variant [UploadPreTransformSuccessEventData].
IsPublished bool `json:"isPublished"`
// This field is from variant [UploadPreTransformSuccessEventData].
Metadata Metadata `json:"metadata"`
Name string `json:"name"`
// This field is from variant [UploadPreTransformSuccessEventData].
SelectedFieldsSchema map[string]UploadPreTransformSuccessEventDataSelectedFieldsSchema `json:"selectedFieldsSchema"`
// This field is from variant [UploadPreTransformSuccessEventData].
Size float64 `json:"size"`
// This field is from variant [UploadPreTransformSuccessEventData].
Tags []string `json:"tags"`
// This field is from variant [UploadPreTransformSuccessEventData].
ThumbnailURL string `json:"thumbnailUrl"`
URL string `json:"url"`
// This field is from variant [UploadPreTransformSuccessEventData].
VersionInfo UploadPreTransformSuccessEventDataVersionInfo `json:"versionInfo"`
// This field is from variant [UploadPreTransformSuccessEventData].
VideoCodec string `json:"videoCodec"`
// This field is from variant [UploadPreTransformSuccessEventData].
Width float64 `json:"width"`
Path string `json:"path"`
JSON struct {
Asset respjson.Field
Transformation respjson.Field
AITags respjson.Field
AudioCodec respjson.Field
BitRate respjson.Field
CustomCoordinates respjson.Field
CustomMetadata respjson.Field
Description respjson.Field
Duration respjson.Field
EmbeddedMetadata respjson.Field
ExtensionStatus respjson.Field
FileID respjson.Field
FilePath respjson.Field
FileType respjson.Field
Height respjson.Field
IsPrivateFile respjson.Field
IsPublished respjson.Field
Metadata respjson.Field
Name respjson.Field
SelectedFieldsSchema respjson.Field
Size respjson.Field
Tags respjson.Field
ThumbnailURL respjson.Field
URL respjson.Field
VersionInfo respjson.Field
VideoCodec respjson.Field
Width respjson.Field
Path respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnionData is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionData provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.
func (*UnwrapWebhookEventUnionData) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnionData) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnionDataAsset ¶
type UnwrapWebhookEventUnionDataAsset struct {
URL string `json:"url"`
JSON struct {
URL respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnionDataAsset is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionDataAsset provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.
func (*UnwrapWebhookEventUnionDataAsset) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnionDataAsset) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnionDataTransformation ¶
type UnwrapWebhookEventUnionDataTransformation struct {
Type string `json:"type"`
// This field is a union of
// [VideoTransformationAcceptedEventDataTransformationOptions],
// [VideoTransformationReadyEventDataTransformationOptions],
// [VideoTransformationErrorEventDataTransformationOptions]
Options UnwrapWebhookEventUnionDataTransformationOptions `json:"options"`
// This field is from variant [VideoTransformationReadyEventDataTransformation].
Output VideoTransformationReadyEventDataTransformationOutput `json:"output"`
// This field is a union of [VideoTransformationErrorEventDataTransformationError],
// [UploadPreTransformErrorEventDataTransformationError],
// [UploadPostTransformErrorEventDataTransformationError]
Error UnwrapWebhookEventUnionDataTransformationError `json:"error"`
JSON struct {
Type respjson.Field
Options respjson.Field
Output respjson.Field
Error respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnionDataTransformation is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionDataTransformation provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.
func (*UnwrapWebhookEventUnionDataTransformation) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnionDataTransformation) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnionDataTransformationError ¶
type UnwrapWebhookEventUnionDataTransformationError struct {
Reason string `json:"reason"`
JSON struct {
Reason respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnionDataTransformationError is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionDataTransformationError provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.
func (*UnwrapWebhookEventUnionDataTransformationError) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnionDataTransformationError) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnionDataTransformationOptions ¶
type UnwrapWebhookEventUnionDataTransformationOptions struct {
AudioCodec string `json:"audio_codec"`
AutoRotate bool `json:"auto_rotate"`
Format string `json:"format"`
Quality int64 `json:"quality"`
StreamProtocol string `json:"stream_protocol"`
Variants []string `json:"variants"`
VideoCodec string `json:"video_codec"`
JSON struct {
AudioCodec respjson.Field
AutoRotate respjson.Field
Format respjson.Field
Quality respjson.Field
StreamProtocol respjson.Field
Variants respjson.Field
VideoCodec respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnionDataTransformationOptions is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionDataTransformationOptions provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.
func (*UnwrapWebhookEventUnionDataTransformationOptions) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnionDataTransformationOptions) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnionRequest ¶
type UnwrapWebhookEventUnionRequest struct {
URL string `json:"url"`
XRequestID string `json:"x_request_id"`
UserAgent string `json:"user_agent"`
// This field is a union of [string], [string],
// [UploadPostTransformSuccessEventRequestTransformation],
// [UploadPostTransformErrorEventRequestTransformation]
Transformation UnwrapWebhookEventUnionRequestTransformation `json:"transformation"`
JSON struct {
URL respjson.Field
XRequestID respjson.Field
UserAgent respjson.Field
Transformation respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnionRequest is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionRequest provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.
func (*UnwrapWebhookEventUnionRequest) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnionRequest) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnionRequestTransformation ¶
type UnwrapWebhookEventUnionRequestTransformation struct {
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
Type string `json:"type"`
Protocol string `json:"protocol"`
Value string `json:"value"`
JSON struct {
OfString respjson.Field
Type respjson.Field
Protocol respjson.Field
Value respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnionRequestTransformation is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionRequestTransformation provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.
If the underlying value is not a json object, one of the following properties will be valid: OfString]
func (*UnwrapWebhookEventUnionRequestTransformation) UnmarshalJSON ¶
func (r *UnwrapWebhookEventUnionRequestTransformation) UnmarshalJSON(data []byte) error
type UpdateFileRequestChangePublicationStatusParam ¶
type UpdateFileRequestChangePublicationStatusParam struct {
// Configure the publication status of a file and its versions.
Publish UpdateFileRequestChangePublicationStatusPublishParam `json:"publish,omitzero"`
// contains filtered or unexported fields
}
func (UpdateFileRequestChangePublicationStatusParam) MarshalJSON ¶
func (r UpdateFileRequestChangePublicationStatusParam) MarshalJSON() (data []byte, err error)
func (*UpdateFileRequestChangePublicationStatusParam) UnmarshalJSON ¶
func (r *UpdateFileRequestChangePublicationStatusParam) UnmarshalJSON(data []byte) error
type UpdateFileRequestChangePublicationStatusPublishParam ¶
type UpdateFileRequestChangePublicationStatusPublishParam struct {
// Set to `true` to publish the file. Set to `false` to unpublish the file.
IsPublished bool `json:"isPublished,required"`
// Set to `true` to publish/unpublish all versions of the file. Set to `false` to
// publish/unpublish only the current version of the file.
IncludeFileVersions param.Opt[bool] `json:"includeFileVersions,omitzero"`
// contains filtered or unexported fields
}
Configure the publication status of a file and its versions.
The property IsPublished is required.
func (UpdateFileRequestChangePublicationStatusPublishParam) MarshalJSON ¶
func (r UpdateFileRequestChangePublicationStatusPublishParam) MarshalJSON() (data []byte, err error)
func (*UpdateFileRequestChangePublicationStatusPublishParam) UnmarshalJSON ¶
func (r *UpdateFileRequestChangePublicationStatusPublishParam) UnmarshalJSON(data []byte) error
type UpdateFileRequestUnionParam ¶
type UpdateFileRequestUnionParam struct {
OfUpdateFileDetails *UpdateFileRequestUpdateFileDetailsParam `json:",omitzero,inline"`
OfChangePublicationStatus *UpdateFileRequestChangePublicationStatusParam `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 (UpdateFileRequestUnionParam) MarshalJSON ¶
func (u UpdateFileRequestUnionParam) MarshalJSON() ([]byte, error)
func (*UpdateFileRequestUnionParam) UnmarshalJSON ¶
func (u *UpdateFileRequestUnionParam) UnmarshalJSON(data []byte) error
type UpdateFileRequestUpdateFileDetailsParam ¶
type UpdateFileRequestUpdateFileDetailsParam struct {
// Define an important area in the image in the format `x,y,width,height` e.g.
// `10,10,100,100`. Send `null` to unset this value.
CustomCoordinates param.Opt[string] `json:"customCoordinates,omitzero"`
// Optional text to describe the contents of the file.
Description param.Opt[string] `json:"description,omitzero"`
// The final status of extensions after they have completed execution will be
// delivered to this endpoint as a POST request.
// [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure)
// about the webhook payload structure.
WebhookURL param.Opt[string] `json:"webhookUrl,omitzero" format:"uri"`
// An array of tags associated with the file, such as `["tag1", "tag2"]`. Send
// `null` to unset all tags associated with the file.
Tags []string `json:"tags,omitzero"`
// A key-value data to be associated with the asset. To unset a key, send `null`
// value for that key. Before setting any custom metadata on an asset you have to
// create the field using custom metadata fields API.
CustomMetadata map[string]any `json:"customMetadata,omitzero"`
// Array of extensions to be applied to the asset. Each extension can be configured
// with specific parameters based on the extension type.
Extensions shared.ExtensionsParam `json:"extensions,omitzero"`
// An array of AITags associated with the file that you want to remove, e.g.
// `["car", "vehicle", "motorsports"]`.
//
// If you want to remove all AITags associated with the file, send a string -
// "all".
//
// Note: The remove operation for `AITags` executes before any of the `extensions`
// are processed.
RemoveAITags UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam `json:"removeAITags,omitzero"`
// contains filtered or unexported fields
}
func (UpdateFileRequestUpdateFileDetailsParam) MarshalJSON ¶
func (r UpdateFileRequestUpdateFileDetailsParam) MarshalJSON() (data []byte, err error)
func (*UpdateFileRequestUpdateFileDetailsParam) UnmarshalJSON ¶
func (r *UpdateFileRequestUpdateFileDetailsParam) UnmarshalJSON(data []byte) error
type UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam ¶
type UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam struct {
OfStringArray []string `json:",omitzero,inline"`
// Construct this variant with constant.ValueOf[constant.All]()
OfAll constant.All `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 (UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam) MarshalJSON ¶
func (u UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam) MarshalJSON() ([]byte, error)
func (*UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam) UnmarshalJSON ¶
func (u *UpdateFileRequestUpdateFileDetailsRemoveAITagsUnionParam) UnmarshalJSON(data []byte) error
type UploadPostTransformErrorEvent ¶
type UploadPostTransformErrorEvent struct {
// Timestamp of when the event occurred in ISO8601 format.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
Data UploadPostTransformErrorEventData `json:"data,required"`
Request UploadPostTransformErrorEventRequest `json:"request,required"`
Type constant.UploadPostTransformError `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
Request respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BaseWebhookEvent
}
Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated.
func (UploadPostTransformErrorEvent) RawJSON ¶
func (r UploadPostTransformErrorEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformErrorEvent) UnmarshalJSON ¶
func (r *UploadPostTransformErrorEvent) UnmarshalJSON(data []byte) error
type UploadPostTransformErrorEventData ¶
type UploadPostTransformErrorEventData struct {
// Unique identifier of the originally uploaded file.
FileID string `json:"fileId,required"`
// Name of the file.
Name string `json:"name,required"`
// Path of the file.
Path string `json:"path,required"`
Transformation UploadPostTransformErrorEventDataTransformation `json:"transformation,required"`
// URL of the attempted post-transformation.
URL string `json:"url,required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileID respjson.Field
Name respjson.Field
Path respjson.Field
Transformation respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPostTransformErrorEventData) RawJSON ¶
func (r UploadPostTransformErrorEventData) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformErrorEventData) UnmarshalJSON ¶
func (r *UploadPostTransformErrorEventData) UnmarshalJSON(data []byte) error
type UploadPostTransformErrorEventDataTransformation ¶
type UploadPostTransformErrorEventDataTransformation struct {
Error UploadPostTransformErrorEventDataTransformationError `json:"error,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Error respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPostTransformErrorEventDataTransformation) RawJSON ¶
func (r UploadPostTransformErrorEventDataTransformation) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformErrorEventDataTransformation) UnmarshalJSON ¶
func (r *UploadPostTransformErrorEventDataTransformation) UnmarshalJSON(data []byte) error
type UploadPostTransformErrorEventDataTransformationError ¶
type UploadPostTransformErrorEventDataTransformationError struct {
// Reason for the post-transformation failure.
Reason string `json:"reason,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPostTransformErrorEventDataTransformationError) RawJSON ¶
func (r UploadPostTransformErrorEventDataTransformationError) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformErrorEventDataTransformationError) UnmarshalJSON ¶
func (r *UploadPostTransformErrorEventDataTransformationError) UnmarshalJSON(data []byte) error
type UploadPostTransformErrorEventRequest ¶
type UploadPostTransformErrorEventRequest struct {
Transformation UploadPostTransformErrorEventRequestTransformation `json:"transformation,required"`
// Unique identifier for the originating request.
XRequestID string `json:"x_request_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Transformation respjson.Field
XRequestID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPostTransformErrorEventRequest) RawJSON ¶
func (r UploadPostTransformErrorEventRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformErrorEventRequest) UnmarshalJSON ¶
func (r *UploadPostTransformErrorEventRequest) UnmarshalJSON(data []byte) error
type UploadPostTransformErrorEventRequestTransformation ¶
type UploadPostTransformErrorEventRequestTransformation struct {
// Type of the requested post-transformation.
//
// Any of "transformation", "abs", "gif-to-video", "thumbnail".
Type string `json:"type,required"`
// Only applicable if transformation type is 'abs'. Streaming protocol used.
//
// Any of "hls", "dash".
Protocol string `json:"protocol"`
// Value for the requested transformation type.
Value string `json:"value"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Protocol respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPostTransformErrorEventRequestTransformation) RawJSON ¶
func (r UploadPostTransformErrorEventRequestTransformation) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformErrorEventRequestTransformation) UnmarshalJSON ¶
func (r *UploadPostTransformErrorEventRequestTransformation) UnmarshalJSON(data []byte) error
type UploadPostTransformSuccessEvent ¶
type UploadPostTransformSuccessEvent struct {
// Timestamp of when the event occurred in ISO8601 format.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
Data UploadPostTransformSuccessEventData `json:"data,required"`
Request UploadPostTransformSuccessEventRequest `json:"request,required"`
Type constant.UploadPostTransformSuccess `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
Request respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BaseWebhookEvent
}
Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event.
func (UploadPostTransformSuccessEvent) RawJSON ¶
func (r UploadPostTransformSuccessEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformSuccessEvent) UnmarshalJSON ¶
func (r *UploadPostTransformSuccessEvent) UnmarshalJSON(data []byte) error
type UploadPostTransformSuccessEventData ¶
type UploadPostTransformSuccessEventData struct {
// Unique identifier of the originally uploaded file.
FileID string `json:"fileId,required"`
// Name of the file.
Name string `json:"name,required"`
// URL of the generated post-transformation.
URL string `json:"url,required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FileID respjson.Field
Name respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPostTransformSuccessEventData) RawJSON ¶
func (r UploadPostTransformSuccessEventData) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformSuccessEventData) UnmarshalJSON ¶
func (r *UploadPostTransformSuccessEventData) UnmarshalJSON(data []byte) error
type UploadPostTransformSuccessEventRequest ¶
type UploadPostTransformSuccessEventRequest struct {
Transformation UploadPostTransformSuccessEventRequestTransformation `json:"transformation,required"`
// Unique identifier for the originating request.
XRequestID string `json:"x_request_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Transformation respjson.Field
XRequestID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPostTransformSuccessEventRequest) RawJSON ¶
func (r UploadPostTransformSuccessEventRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformSuccessEventRequest) UnmarshalJSON ¶
func (r *UploadPostTransformSuccessEventRequest) UnmarshalJSON(data []byte) error
type UploadPostTransformSuccessEventRequestTransformation ¶
type UploadPostTransformSuccessEventRequestTransformation struct {
// Type of the requested post-transformation.
//
// Any of "transformation", "abs", "gif-to-video", "thumbnail".
Type string `json:"type,required"`
// Only applicable if transformation type is 'abs'. Streaming protocol used.
//
// Any of "hls", "dash".
Protocol string `json:"protocol"`
// Value for the requested transformation type.
Value string `json:"value"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Protocol respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPostTransformSuccessEventRequestTransformation) RawJSON ¶
func (r UploadPostTransformSuccessEventRequestTransformation) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPostTransformSuccessEventRequestTransformation) UnmarshalJSON ¶
func (r *UploadPostTransformSuccessEventRequestTransformation) UnmarshalJSON(data []byte) error
type UploadPreTransformErrorEvent ¶
type UploadPreTransformErrorEvent struct {
// Timestamp of when the event occurred in ISO8601 format.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
Data UploadPreTransformErrorEventData `json:"data,required"`
Request UploadPreTransformErrorEventRequest `json:"request,required"`
Type constant.UploadPreTransformError `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
Request respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BaseWebhookEvent
}
Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied.
func (UploadPreTransformErrorEvent) RawJSON ¶
func (r UploadPreTransformErrorEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformErrorEvent) UnmarshalJSON ¶
func (r *UploadPreTransformErrorEvent) UnmarshalJSON(data []byte) error
type UploadPreTransformErrorEventData ¶
type UploadPreTransformErrorEventData struct {
// Name of the file.
Name string `json:"name,required"`
// Path of the file.
Path string `json:"path,required"`
Transformation UploadPreTransformErrorEventDataTransformation `json:"transformation,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Path respjson.Field
Transformation respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPreTransformErrorEventData) RawJSON ¶
func (r UploadPreTransformErrorEventData) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformErrorEventData) UnmarshalJSON ¶
func (r *UploadPreTransformErrorEventData) UnmarshalJSON(data []byte) error
type UploadPreTransformErrorEventDataTransformation ¶
type UploadPreTransformErrorEventDataTransformation struct {
Error UploadPreTransformErrorEventDataTransformationError `json:"error,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Error respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPreTransformErrorEventDataTransformation) RawJSON ¶
func (r UploadPreTransformErrorEventDataTransformation) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformErrorEventDataTransformation) UnmarshalJSON ¶
func (r *UploadPreTransformErrorEventDataTransformation) UnmarshalJSON(data []byte) error
type UploadPreTransformErrorEventDataTransformationError ¶
type UploadPreTransformErrorEventDataTransformationError struct {
// Reason for the pre-transformation failure.
Reason string `json:"reason,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPreTransformErrorEventDataTransformationError) RawJSON ¶
func (r UploadPreTransformErrorEventDataTransformationError) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformErrorEventDataTransformationError) UnmarshalJSON ¶
func (r *UploadPreTransformErrorEventDataTransformationError) UnmarshalJSON(data []byte) error
type UploadPreTransformErrorEventRequest ¶
type UploadPreTransformErrorEventRequest struct {
// The requested pre-transformation string.
Transformation string `json:"transformation,required"`
// Unique identifier for the originating request.
XRequestID string `json:"x_request_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Transformation respjson.Field
XRequestID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPreTransformErrorEventRequest) RawJSON ¶
func (r UploadPreTransformErrorEventRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformErrorEventRequest) UnmarshalJSON ¶
func (r *UploadPreTransformErrorEventRequest) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEvent ¶
type UploadPreTransformSuccessEvent struct {
// Timestamp of when the event occurred in ISO8601 format.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Object containing details of a successful upload.
Data UploadPreTransformSuccessEventData `json:"data,required"`
Request UploadPreTransformSuccessEventRequest `json:"request,required"`
Type constant.UploadPreTransformSuccess `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
Request respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BaseWebhookEvent
}
Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library.
func (UploadPreTransformSuccessEvent) RawJSON ¶
func (r UploadPreTransformSuccessEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEvent) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEvent) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventData ¶
type UploadPreTransformSuccessEventData struct {
// An array of tags assigned to the uploaded file by auto tagging.
AITags []UploadPreTransformSuccessEventDataAITag `json:"AITags,nullable"`
// The audio codec used in the video (only for video).
AudioCodec string `json:"audioCodec"`
// The bit rate of the video in kbps (only for video).
BitRate int64 `json:"bitRate"`
// Value of custom coordinates associated with the image in the format
// `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`.
// Send `customCoordinates` in `responseFields` in API request to get the value of
// this field.
CustomCoordinates string `json:"customCoordinates,nullable"`
// A key-value data associated with the asset. Use `responseField` in API request
// to get `customMetadata` in the upload API response. Before setting any custom
// metadata on an asset, you have to create the field using custom metadata fields
// API. Send `customMetadata` in `responseFields` in API request to get the value
// of this field.
CustomMetadata map[string]any `json:"customMetadata"`
// Optional text to describe the contents of the file. Can be set by the user or
// the ai-auto-description extension.
Description string `json:"description"`
// The duration of the video in seconds (only for video).
Duration int64 `json:"duration"`
// Consolidated embedded metadata associated with the file. It includes exif, iptc,
// and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get
// embeddedMetadata in the upload API response.
EmbeddedMetadata map[string]any `json:"embeddedMetadata"`
// Extension names with their processing status at the time of completion of the
// request. It could have one of the following status values:
//
// `success`: The extension has been successfully applied. `failed`: The extension
// has failed and will not be retried. `pending`: The extension will finish
// processing in some time. On completion, the final status (success / failed) will
// be sent to the `webhookUrl` provided.
//
// If no extension was requested, then this parameter is not returned.
ExtensionStatus UploadPreTransformSuccessEventDataExtensionStatus `json:"extensionStatus"`
// Unique fileId. Store this fileld in your database, as this will be used to
// perform update action on this file.
FileID string `json:"fileId"`
// The relative path of the file in the media library e.g.
// `/marketing-assets/new-banner.jpg`.
FilePath string `json:"filePath"`
// Type of the uploaded file. Possible values are `image`, `non-image`.
FileType string `json:"fileType"`
// Height of the image in pixels (Only for images)
Height float64 `json:"height"`
// Is the file marked as private. It can be either `true` or `false`. Send
// `isPrivateFile` in `responseFields` in API request to get the value of this
// field.
IsPrivateFile bool `json:"isPrivateFile"`
// Is the file published or in draft state. It can be either `true` or `false`.
// Send `isPublished` in `responseFields` in API request to get the value of this
// field.
IsPublished bool `json:"isPublished"`
// Legacy metadata. Send `metadata` in `responseFields` in API request to get
// metadata in the upload API response.
Metadata Metadata `json:"metadata"`
// Name of the asset.
Name string `json:"name"`
// This field is included in the response only if the Path policy feature is
// available in the plan. It contains schema definitions for the custom metadata
// fields selected for the specified file path. Field selection can only be done
// when the Path policy feature is enabled.
//
// Keys are the names of the custom metadata fields; the value object has details
// about the custom metadata schema.
SelectedFieldsSchema map[string]UploadPreTransformSuccessEventDataSelectedFieldsSchema `json:"selectedFieldsSchema"`
// Size of the image file in Bytes.
Size float64 `json:"size"`
// The array of tags associated with the asset. If no tags are set, it will be
// `null`. Send `tags` in `responseFields` in API request to get the value of this
// field.
Tags []string `json:"tags,nullable"`
// In the case of an image, a small thumbnail URL.
ThumbnailURL string `json:"thumbnailUrl"`
// A publicly accessible URL of the file.
URL string `json:"url"`
// An object containing the file or file version's `id` (versionId) and `name`.
VersionInfo UploadPreTransformSuccessEventDataVersionInfo `json:"versionInfo"`
// The video codec used in the video (only for video).
VideoCodec string `json:"videoCodec"`
// Width of the image in pixels (Only for Images)
Width float64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AITags respjson.Field
AudioCodec respjson.Field
BitRate respjson.Field
CustomCoordinates respjson.Field
CustomMetadata respjson.Field
Description respjson.Field
Duration respjson.Field
EmbeddedMetadata respjson.Field
ExtensionStatus respjson.Field
FileID respjson.Field
FilePath respjson.Field
FileType respjson.Field
Height respjson.Field
IsPrivateFile respjson.Field
IsPublished respjson.Field
Metadata respjson.Field
Name respjson.Field
SelectedFieldsSchema respjson.Field
Size respjson.Field
Tags respjson.Field
ThumbnailURL respjson.Field
URL respjson.Field
VersionInfo respjson.Field
VideoCodec respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Object containing details of a successful upload.
func (UploadPreTransformSuccessEventData) RawJSON ¶
func (r UploadPreTransformSuccessEventData) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventData) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventData) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventDataAITag ¶
type UploadPreTransformSuccessEventDataAITag struct {
// Confidence score of the tag.
Confidence float64 `json:"confidence"`
// Name of the tag.
Name string `json:"name"`
// Array of `AITags` associated with the image. If no `AITags` are set, it will be
// null. These tags can be added using the `google-auto-tagging` or
// `aws-auto-tagging` extensions.
Source string `json:"source"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Confidence respjson.Field
Name respjson.Field
Source respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPreTransformSuccessEventDataAITag) RawJSON ¶
func (r UploadPreTransformSuccessEventDataAITag) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventDataAITag) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventDataAITag) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventDataExtensionStatus ¶
type UploadPreTransformSuccessEventDataExtensionStatus struct {
// Any of "success", "pending", "failed".
AIAutoDescription string `json:"ai-auto-description"`
// Any of "success", "pending", "failed".
AwsAutoTagging string `json:"aws-auto-tagging"`
// Any of "success", "pending", "failed".
GoogleAutoTagging string `json:"google-auto-tagging"`
// Any of "success", "pending", "failed".
RemoveBg string `json:"remove-bg"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AIAutoDescription respjson.Field
AwsAutoTagging respjson.Field
GoogleAutoTagging respjson.Field
RemoveBg respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Extension names with their processing status at the time of completion of the request. It could have one of the following status values:
`success`: The extension has been successfully applied. `failed`: The extension has failed and will not be retried. `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided.
If no extension was requested, then this parameter is not returned.
func (UploadPreTransformSuccessEventDataExtensionStatus) RawJSON ¶
func (r UploadPreTransformSuccessEventDataExtensionStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventDataExtensionStatus) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventDataExtensionStatus) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventDataSelectedFieldsSchema ¶
type UploadPreTransformSuccessEventDataSelectedFieldsSchema struct {
// Type of the custom metadata field.
//
// Any of "Text", "Textarea", "Number", "Date", "Boolean", "SingleSelect",
// "MultiSelect".
Type string `json:"type,required"`
// The default value for this custom metadata field. The value should match the
// `type` of custom metadata field.
DefaultValue UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion `json:"defaultValue"`
// Specifies if the custom metadata field is required or not.
IsValueRequired bool `json:"isValueRequired"`
// Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
MaxLength float64 `json:"maxLength"`
// Maximum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MaxValue UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion `json:"maxValue"`
// Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
MinLength float64 `json:"minLength"`
// Minimum value of the field. Only set if field type is `Date` or `Number`. For
// `Date` type field, the value will be in ISO8601 string format. For `Number` type
// field, it will be a numeric value.
MinValue UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion `json:"minValue"`
// Indicates whether the custom metadata field is read only. A read only field
// cannot be modified after being set. This field is configurable only via the
// **Path policy** feature.
ReadOnly bool `json:"readOnly"`
// An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
SelectOptions []UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion `json:"selectOptions"`
// Specifies if the selectOptions array is truncated. It is truncated when number
// of options are > 100.
SelectOptionsTruncated bool `json:"selectOptionsTruncated"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
DefaultValue respjson.Field
IsValueRequired respjson.Field
MaxLength respjson.Field
MaxValue respjson.Field
MinLength respjson.Field
MinValue respjson.Field
ReadOnly respjson.Field
SelectOptions respjson.Field
SelectOptionsTruncated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPreTransformSuccessEventDataSelectedFieldsSchema) RawJSON ¶
func (r UploadPreTransformSuccessEventDataSelectedFieldsSchema) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventDataSelectedFieldsSchema) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchema) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion ¶
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) AsBool() (v bool)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) AsFloat() (v float64)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) AsString() (v string)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion ¶
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion 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
// [[]UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion]
// instead of an object.
OfMixed []UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion `json:",inline"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
OfMixed respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion contains all possible properties and values from [string], [float64], [bool], [[]UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueMixedItemUnion].
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 OfMixed]
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsBool ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsBool() (v bool)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsFloat ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsFloat() (v float64)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsString ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) AsString() (v string)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) RawJSON ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaDefaultValueUnion) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion ¶
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion contains all possible properties and values from [string], [float64].
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]
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) AsFloat ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) AsFloat() (v float64)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) AsString ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) AsString() (v string)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) RawJSON ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaMaxValueUnion) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion ¶
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion contains all possible properties and values from [string], [float64].
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]
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) AsFloat ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) AsFloat() (v float64)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) AsString ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) AsString() (v string)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) RawJSON ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaMinValueUnion) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion ¶
type UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion 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"`
JSON struct {
OfString respjson.Field
OfFloat respjson.Field
OfBool respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion contains all possible properties and values from [string], [float64], [bool].
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]
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) AsBool ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) AsBool() (v bool)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) AsFloat ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) AsFloat() (v float64)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) AsString ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) AsString() (v string)
func (UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) RawJSON ¶
func (u UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventDataSelectedFieldsSchemaSelectOptionUnion) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventDataVersionInfo ¶
type UploadPreTransformSuccessEventDataVersionInfo struct {
// Unique identifier of the file version.
ID string `json:"id"`
// Name of the file version.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An object containing the file or file version's `id` (versionId) and `name`.
func (UploadPreTransformSuccessEventDataVersionInfo) RawJSON ¶
func (r UploadPreTransformSuccessEventDataVersionInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventDataVersionInfo) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventDataVersionInfo) UnmarshalJSON(data []byte) error
type UploadPreTransformSuccessEventRequest ¶
type UploadPreTransformSuccessEventRequest struct {
// The requested pre-transformation string.
Transformation string `json:"transformation,required"`
// Unique identifier for the originating request.
XRequestID string `json:"x_request_id,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Transformation respjson.Field
XRequestID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadPreTransformSuccessEventRequest) RawJSON ¶
func (r UploadPreTransformSuccessEventRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadPreTransformSuccessEventRequest) UnmarshalJSON ¶
func (r *UploadPreTransformSuccessEventRequest) UnmarshalJSON(data []byte) error
type VideoOverlayParam ¶
type VideoOverlayParam = shared.VideoOverlayParam
This is an alias to an internal type.
type VideoTransformationAcceptedEvent ¶
type VideoTransformationAcceptedEvent struct {
// Timestamp when the event was created in ISO8601 format.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
Data VideoTransformationAcceptedEventData `json:"data,required"`
// Information about the original request that triggered the video transformation.
Request VideoTransformationAcceptedEventRequest `json:"request,required"`
Type constant.VideoTransformationAccepted `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
Request respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BaseWebhookEvent
}
Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle.
func (VideoTransformationAcceptedEvent) RawJSON ¶
func (r VideoTransformationAcceptedEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationAcceptedEvent) UnmarshalJSON ¶
func (r *VideoTransformationAcceptedEvent) UnmarshalJSON(data []byte) error
type VideoTransformationAcceptedEventData ¶
type VideoTransformationAcceptedEventData struct {
// Information about the source video asset being transformed.
Asset VideoTransformationAcceptedEventDataAsset `json:"asset,required"`
// Base information about a video transformation request.
Transformation VideoTransformationAcceptedEventDataTransformation `json:"transformation,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Asset respjson.Field
Transformation respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (VideoTransformationAcceptedEventData) RawJSON ¶
func (r VideoTransformationAcceptedEventData) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationAcceptedEventData) UnmarshalJSON ¶
func (r *VideoTransformationAcceptedEventData) UnmarshalJSON(data []byte) error
type VideoTransformationAcceptedEventDataAsset ¶
type VideoTransformationAcceptedEventDataAsset struct {
// URL to download or access the source video file.
URL string `json:"url,required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about the source video asset being transformed.
func (VideoTransformationAcceptedEventDataAsset) RawJSON ¶
func (r VideoTransformationAcceptedEventDataAsset) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationAcceptedEventDataAsset) UnmarshalJSON ¶
func (r *VideoTransformationAcceptedEventDataAsset) UnmarshalJSON(data []byte) error
type VideoTransformationAcceptedEventDataTransformation ¶
type VideoTransformationAcceptedEventDataTransformation struct {
// Type of video transformation:
//
// - `video-transformation`: Standard video processing (resize, format conversion,
// etc.)
// - `gif-to-video`: Convert animated GIF to video format
// - `video-thumbnail`: Generate thumbnail image from video
//
// Any of "video-transformation", "gif-to-video", "video-thumbnail".
Type string `json:"type,required"`
// Configuration options for video transformations.
Options VideoTransformationAcceptedEventDataTransformationOptions `json:"options"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Options respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Base information about a video transformation request.
func (VideoTransformationAcceptedEventDataTransformation) RawJSON ¶
func (r VideoTransformationAcceptedEventDataTransformation) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationAcceptedEventDataTransformation) UnmarshalJSON ¶
func (r *VideoTransformationAcceptedEventDataTransformation) UnmarshalJSON(data []byte) error
type VideoTransformationAcceptedEventDataTransformationOptions ¶
type VideoTransformationAcceptedEventDataTransformationOptions struct {
// Audio codec used for encoding (aac or opus).
//
// Any of "aac", "opus".
AudioCodec string `json:"audio_codec"`
// Whether to automatically rotate the video based on metadata.
AutoRotate bool `json:"auto_rotate"`
// Output format for the transformed video or thumbnail.
//
// Any of "mp4", "webm", "jpg", "png", "webp".
Format string `json:"format"`
// Quality setting for the output video.
Quality int64 `json:"quality"`
// Streaming protocol for adaptive bitrate streaming.
//
// Any of "HLS", "DASH".
StreamProtocol string `json:"stream_protocol"`
// Array of quality representations for adaptive bitrate streaming.
Variants []string `json:"variants"`
// Video codec used for encoding (h264, vp9, or av1).
//
// Any of "h264", "vp9", "av1".
VideoCodec string `json:"video_codec"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AudioCodec respjson.Field
AutoRotate respjson.Field
Format respjson.Field
Quality respjson.Field
StreamProtocol respjson.Field
Variants respjson.Field
VideoCodec respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configuration options for video transformations.
func (VideoTransformationAcceptedEventDataTransformationOptions) RawJSON ¶
func (r VideoTransformationAcceptedEventDataTransformationOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationAcceptedEventDataTransformationOptions) UnmarshalJSON ¶
func (r *VideoTransformationAcceptedEventDataTransformationOptions) UnmarshalJSON(data []byte) error
type VideoTransformationAcceptedEventRequest ¶
type VideoTransformationAcceptedEventRequest struct {
// Full URL of the transformation request that was submitted.
URL string `json:"url,required" format:"uri"`
// Unique identifier for the originating transformation request.
XRequestID string `json:"x_request_id,required"`
// User-Agent header from the original request that triggered the transformation.
UserAgent string `json:"user_agent"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
XRequestID respjson.Field
UserAgent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about the original request that triggered the video transformation.
func (VideoTransformationAcceptedEventRequest) RawJSON ¶
func (r VideoTransformationAcceptedEventRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationAcceptedEventRequest) UnmarshalJSON ¶
func (r *VideoTransformationAcceptedEventRequest) UnmarshalJSON(data []byte) error
type VideoTransformationErrorEvent ¶
type VideoTransformationErrorEvent struct {
// Timestamp when the event was created in ISO8601 format.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
Data VideoTransformationErrorEventData `json:"data,required"`
// Information about the original request that triggered the video transformation.
Request VideoTransformationErrorEventRequest `json:"request,required"`
Type constant.VideoTransformationError `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
Request respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BaseWebhookEvent
}
Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support.
func (VideoTransformationErrorEvent) RawJSON ¶
func (r VideoTransformationErrorEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationErrorEvent) UnmarshalJSON ¶
func (r *VideoTransformationErrorEvent) UnmarshalJSON(data []byte) error
type VideoTransformationErrorEventData ¶
type VideoTransformationErrorEventData struct {
// Information about the source video asset being transformed.
Asset VideoTransformationErrorEventDataAsset `json:"asset,required"`
Transformation VideoTransformationErrorEventDataTransformation `json:"transformation,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Asset respjson.Field
Transformation respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (VideoTransformationErrorEventData) RawJSON ¶
func (r VideoTransformationErrorEventData) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationErrorEventData) UnmarshalJSON ¶
func (r *VideoTransformationErrorEventData) UnmarshalJSON(data []byte) error
type VideoTransformationErrorEventDataAsset ¶
type VideoTransformationErrorEventDataAsset struct {
// URL to download or access the source video file.
URL string `json:"url,required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about the source video asset being transformed.
func (VideoTransformationErrorEventDataAsset) RawJSON ¶
func (r VideoTransformationErrorEventDataAsset) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationErrorEventDataAsset) UnmarshalJSON ¶
func (r *VideoTransformationErrorEventDataAsset) UnmarshalJSON(data []byte) error
type VideoTransformationErrorEventDataTransformation ¶
type VideoTransformationErrorEventDataTransformation struct {
// Type of video transformation:
//
// - `video-transformation`: Standard video processing (resize, format conversion,
// etc.)
// - `gif-to-video`: Convert animated GIF to video format
// - `video-thumbnail`: Generate thumbnail image from video
//
// Any of "video-transformation", "gif-to-video", "video-thumbnail".
Type string `json:"type,required"`
// Details about the transformation error.
Error VideoTransformationErrorEventDataTransformationError `json:"error"`
// Configuration options for video transformations.
Options VideoTransformationErrorEventDataTransformationOptions `json:"options"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Error respjson.Field
Options respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (VideoTransformationErrorEventDataTransformation) RawJSON ¶
func (r VideoTransformationErrorEventDataTransformation) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationErrorEventDataTransformation) UnmarshalJSON ¶
func (r *VideoTransformationErrorEventDataTransformation) UnmarshalJSON(data []byte) error
type VideoTransformationErrorEventDataTransformationError ¶
type VideoTransformationErrorEventDataTransformationError struct {
// Specific reason for the transformation failure:
//
// - `encoding_failed`: Error during video encoding process
// - `download_failed`: Could not download source video
// - `internal_server_error`: Unexpected server error
//
// Any of "encoding_failed", "download_failed", "internal_server_error".
Reason string `json:"reason,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Reason respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Details about the transformation error.
func (VideoTransformationErrorEventDataTransformationError) RawJSON ¶
func (r VideoTransformationErrorEventDataTransformationError) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationErrorEventDataTransformationError) UnmarshalJSON ¶
func (r *VideoTransformationErrorEventDataTransformationError) UnmarshalJSON(data []byte) error
type VideoTransformationErrorEventDataTransformationOptions ¶
type VideoTransformationErrorEventDataTransformationOptions struct {
// Audio codec used for encoding (aac or opus).
//
// Any of "aac", "opus".
AudioCodec string `json:"audio_codec"`
// Whether to automatically rotate the video based on metadata.
AutoRotate bool `json:"auto_rotate"`
// Output format for the transformed video or thumbnail.
//
// Any of "mp4", "webm", "jpg", "png", "webp".
Format string `json:"format"`
// Quality setting for the output video.
Quality int64 `json:"quality"`
// Streaming protocol for adaptive bitrate streaming.
//
// Any of "HLS", "DASH".
StreamProtocol string `json:"stream_protocol"`
// Array of quality representations for adaptive bitrate streaming.
Variants []string `json:"variants"`
// Video codec used for encoding (h264, vp9, or av1).
//
// Any of "h264", "vp9", "av1".
VideoCodec string `json:"video_codec"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AudioCodec respjson.Field
AutoRotate respjson.Field
Format respjson.Field
Quality respjson.Field
StreamProtocol respjson.Field
Variants respjson.Field
VideoCodec respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configuration options for video transformations.
func (VideoTransformationErrorEventDataTransformationOptions) RawJSON ¶
func (r VideoTransformationErrorEventDataTransformationOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationErrorEventDataTransformationOptions) UnmarshalJSON ¶
func (r *VideoTransformationErrorEventDataTransformationOptions) UnmarshalJSON(data []byte) error
type VideoTransformationErrorEventRequest ¶
type VideoTransformationErrorEventRequest struct {
// Full URL of the transformation request that was submitted.
URL string `json:"url,required" format:"uri"`
// Unique identifier for the originating transformation request.
XRequestID string `json:"x_request_id,required"`
// User-Agent header from the original request that triggered the transformation.
UserAgent string `json:"user_agent"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
XRequestID respjson.Field
UserAgent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about the original request that triggered the video transformation.
func (VideoTransformationErrorEventRequest) RawJSON ¶
func (r VideoTransformationErrorEventRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationErrorEventRequest) UnmarshalJSON ¶
func (r *VideoTransformationErrorEventRequest) UnmarshalJSON(data []byte) error
type VideoTransformationReadyEvent ¶
type VideoTransformationReadyEvent struct {
// Timestamp when the event was created in ISO8601 format.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
Data VideoTransformationReadyEventData `json:"data,required"`
// Information about the original request that triggered the video transformation.
Request VideoTransformationReadyEventRequest `json:"request,required"`
Type constant.VideoTransformationReady `json:"type,required"`
// Performance metrics for the transformation process.
Timings VideoTransformationReadyEventTimings `json:"timings"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Data respjson.Field
Request respjson.Field
Type respjson.Field
Timings respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
BaseWebhookEvent
}
Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users.
func (VideoTransformationReadyEvent) RawJSON ¶
func (r VideoTransformationReadyEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationReadyEvent) UnmarshalJSON ¶
func (r *VideoTransformationReadyEvent) UnmarshalJSON(data []byte) error
type VideoTransformationReadyEventData ¶
type VideoTransformationReadyEventData struct {
// Information about the source video asset being transformed.
Asset VideoTransformationReadyEventDataAsset `json:"asset,required"`
Transformation VideoTransformationReadyEventDataTransformation `json:"transformation,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Asset respjson.Field
Transformation respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (VideoTransformationReadyEventData) RawJSON ¶
func (r VideoTransformationReadyEventData) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationReadyEventData) UnmarshalJSON ¶
func (r *VideoTransformationReadyEventData) UnmarshalJSON(data []byte) error
type VideoTransformationReadyEventDataAsset ¶
type VideoTransformationReadyEventDataAsset struct {
// URL to download or access the source video file.
URL string `json:"url,required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about the source video asset being transformed.
func (VideoTransformationReadyEventDataAsset) RawJSON ¶
func (r VideoTransformationReadyEventDataAsset) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationReadyEventDataAsset) UnmarshalJSON ¶
func (r *VideoTransformationReadyEventDataAsset) UnmarshalJSON(data []byte) error
type VideoTransformationReadyEventDataTransformation ¶
type VideoTransformationReadyEventDataTransformation struct {
// Type of video transformation:
//
// - `video-transformation`: Standard video processing (resize, format conversion,
// etc.)
// - `gif-to-video`: Convert animated GIF to video format
// - `video-thumbnail`: Generate thumbnail image from video
//
// Any of "video-transformation", "gif-to-video", "video-thumbnail".
Type string `json:"type,required"`
// Configuration options for video transformations.
Options VideoTransformationReadyEventDataTransformationOptions `json:"options"`
// Information about the transformed output video.
Output VideoTransformationReadyEventDataTransformationOutput `json:"output"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Options respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (VideoTransformationReadyEventDataTransformation) RawJSON ¶
func (r VideoTransformationReadyEventDataTransformation) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationReadyEventDataTransformation) UnmarshalJSON ¶
func (r *VideoTransformationReadyEventDataTransformation) UnmarshalJSON(data []byte) error
type VideoTransformationReadyEventDataTransformationOptions ¶
type VideoTransformationReadyEventDataTransformationOptions struct {
// Audio codec used for encoding (aac or opus).
//
// Any of "aac", "opus".
AudioCodec string `json:"audio_codec"`
// Whether to automatically rotate the video based on metadata.
AutoRotate bool `json:"auto_rotate"`
// Output format for the transformed video or thumbnail.
//
// Any of "mp4", "webm", "jpg", "png", "webp".
Format string `json:"format"`
// Quality setting for the output video.
Quality int64 `json:"quality"`
// Streaming protocol for adaptive bitrate streaming.
//
// Any of "HLS", "DASH".
StreamProtocol string `json:"stream_protocol"`
// Array of quality representations for adaptive bitrate streaming.
Variants []string `json:"variants"`
// Video codec used for encoding (h264, vp9, or av1).
//
// Any of "h264", "vp9", "av1".
VideoCodec string `json:"video_codec"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AudioCodec respjson.Field
AutoRotate respjson.Field
Format respjson.Field
Quality respjson.Field
StreamProtocol respjson.Field
Variants respjson.Field
VideoCodec respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configuration options for video transformations.
func (VideoTransformationReadyEventDataTransformationOptions) RawJSON ¶
func (r VideoTransformationReadyEventDataTransformationOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationReadyEventDataTransformationOptions) UnmarshalJSON ¶
func (r *VideoTransformationReadyEventDataTransformationOptions) UnmarshalJSON(data []byte) error
type VideoTransformationReadyEventDataTransformationOutput ¶
type VideoTransformationReadyEventDataTransformationOutput struct {
// URL to access the transformed video.
URL string `json:"url,required" format:"uri"`
// Metadata of the output video file.
VideoMetadata VideoTransformationReadyEventDataTransformationOutputVideoMetadata `json:"video_metadata"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
VideoMetadata respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about the transformed output video.
func (VideoTransformationReadyEventDataTransformationOutput) RawJSON ¶
func (r VideoTransformationReadyEventDataTransformationOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationReadyEventDataTransformationOutput) UnmarshalJSON ¶
func (r *VideoTransformationReadyEventDataTransformationOutput) UnmarshalJSON(data []byte) error
type VideoTransformationReadyEventDataTransformationOutputVideoMetadata ¶
type VideoTransformationReadyEventDataTransformationOutputVideoMetadata struct {
// Bitrate of the output video in bits per second.
Bitrate int64 `json:"bitrate,required"`
// Duration of the output video in seconds.
Duration float64 `json:"duration,required"`
// Height of the output video in pixels.
Height int64 `json:"height,required"`
// Width of the output video in pixels.
Width int64 `json:"width,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Bitrate respjson.Field
Duration respjson.Field
Height respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Metadata of the output video file.
func (VideoTransformationReadyEventDataTransformationOutputVideoMetadata) RawJSON ¶
func (r VideoTransformationReadyEventDataTransformationOutputVideoMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationReadyEventDataTransformationOutputVideoMetadata) UnmarshalJSON ¶
func (r *VideoTransformationReadyEventDataTransformationOutputVideoMetadata) UnmarshalJSON(data []byte) error
type VideoTransformationReadyEventRequest ¶
type VideoTransformationReadyEventRequest struct {
// Full URL of the transformation request that was submitted.
URL string `json:"url,required" format:"uri"`
// Unique identifier for the originating transformation request.
XRequestID string `json:"x_request_id,required"`
// User-Agent header from the original request that triggered the transformation.
UserAgent string `json:"user_agent"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
XRequestID respjson.Field
UserAgent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about the original request that triggered the video transformation.
func (VideoTransformationReadyEventRequest) RawJSON ¶
func (r VideoTransformationReadyEventRequest) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationReadyEventRequest) UnmarshalJSON ¶
func (r *VideoTransformationReadyEventRequest) UnmarshalJSON(data []byte) error
type VideoTransformationReadyEventTimings ¶
type VideoTransformationReadyEventTimings struct {
// Time spent downloading the source video from your origin or media library, in
// milliseconds.
DownloadDuration int64 `json:"download_duration"`
// Time spent encoding the video, in milliseconds.
EncodingDuration int64 `json:"encoding_duration"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DownloadDuration respjson.Field
EncodingDuration respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Performance metrics for the transformation process.
func (VideoTransformationReadyEventTimings) RawJSON ¶
func (r VideoTransformationReadyEventTimings) RawJSON() string
Returns the unmodified JSON received from the API
func (*VideoTransformationReadyEventTimings) UnmarshalJSON ¶
func (r *VideoTransformationReadyEventTimings) UnmarshalJSON(data []byte) error
type WebhookService ¶
type WebhookService struct {
Options []option.RequestOption
}
WebhookService contains methods and other services that help with interacting with the ImageKit API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.
func NewWebhookService ¶
func NewWebhookService(opts ...option.RequestOption) (r WebhookService)
NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WebhookService) UnsafeUnwrap ¶
func (r *WebhookService) UnsafeUnwrap(payload []byte, opts ...option.RequestOption) (*UnsafeUnwrapWebhookEventUnion, error)
func (*WebhookService) Unwrap ¶
func (r *WebhookService) Unwrap(payload []byte, headers http.Header, opts ...option.RequestOption) (*UnwrapWebhookEventUnion, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
Package lib provides helper utilities for ImageKit SDK This file contains custom helper functions - not generated
|
Package lib provides helper utilities for ImageKit SDK This file contains custom helper functions - not generated |
|
packages
|
|