admin

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 18 Imported by: 7

Documentation

Overview

Package admin is used for accessing Cloudinary Admin API functionality.

https://cloudinary.com/documentation/admin_api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Config config.Configuration
	Logger *logger.Logger
	Client http.Client
}

API is the Admin API struct.

func New

func New() (*API, error)

New creates a new Admin API instance from the environment variable (CLOUDINARY_URL).

func NewWithConfiguration

func NewWithConfiguration(c *config.Configuration) (*API, error)

NewWithConfiguration a new Admin API instance with the given Configuration

func (*API) AddMetadataField

func (a *API) AddMetadataField(ctx context.Context, params metadata.Field) (*AddMetadataFieldResult, error)

AddMetadataField creates a new metadata field definition.

https://cloudinary.com/documentation/admin_api#create_a_metadata_field

func (*API) AddRelatedAssets added in v2.3.0

func (a *API) AddRelatedAssets(ctx context.Context, params AddRelatedAssetsParams) (*AddRelatedAssetsResult, error)

AddRelatedAssets relates an asset to other assets by public IDs.

func (*API) AddRelatedAssetsByAssetIDs added in v2.3.0

func (a *API) AddRelatedAssetsByAssetIDs(ctx context.Context, params AddRelatedAssetsByAssetIDsParams) (*AddRelatedAssetsResult, error)

AddRelatedAssetsByAssetIDs relates an asset to other assets by asset IDs.

func (*API) Asset

func (a *API) Asset(ctx context.Context, params AssetParams) (*AssetResult, error)

Asset returns the details of the specified asset and all its derived resources.

Note that if you only need details about the original resource, you can also use the uploader.Upload or uploader.Explicit methods, which return the same information and are not rate limited.

https://cloudinary.com/documentation/admin_api#get_the_details_of_a_single_resource

func (*API) AssetByAssetID

func (a *API) AssetByAssetID(ctx context.Context, params AssetByAssetIDParams) (*AssetResult, error)

AssetByAssetID returns the details of the specified asset and all its derived assets by asset id.

Note that if you only need details about the original asset, you can also use the uploader.Upload or uploader.Explicit methods, which return the same information and are not rate limited.

https://cloudinary.com/documentation/admin_api#get_the_details_of_a_single_resource

func (*API) AssetTypes

func (a *API) AssetTypes(ctx context.Context) (*AssetTypesResult, error)

AssetTypes lists available asset types.

func (*API) Assets

func (a *API) Assets(ctx context.Context, params AssetsParams) (*AssetsResult, error)

Assets lists all uploaded assets filtered by any specified AssetsParams.

https://cloudinary.com/documentation/admin_api#get_resources

func (*API) AssetsByAssetFolder added in v2.2.0

func (a *API) AssetsByAssetFolder(ctx context.Context, params AssetsByAssetFolderParams) (*AssetsResult, error)

AssetsByAssetFolder lists assets in the specified asset folder.

https://cloudinary.com/documentation/admin_api#get_resources

func (*API) AssetsByContext

func (a *API) AssetsByContext(ctx context.Context, params AssetsByContextParams) (*AssetsResult, error)

AssetsByContext lists assets with the specified contextual metadata.

This method does not return matching deleted assets, even if they have been backed up.

https://cloudinary.com/documentation/admin_api#get_resources_by_context

func (*API) AssetsByIDs

func (a *API) AssetsByIDs(ctx context.Context, params AssetsByIDsParams) (*AssetsResult, error)

AssetsByIDs lists assets with the specified public IDs.

https://cloudinary.com/documentation/admin_api#get_resources

func (*API) AssetsByModeration

func (a *API) AssetsByModeration(ctx context.Context, params AssetsByModerationParams) (*AssetsResult, error)

AssetsByModeration lists assets currently in the specified moderation queue and status.

https://cloudinary.com/documentation/admin_api#get_resources_in_moderation_queues

func (*API) AssetsByTag

func (a *API) AssetsByTag(ctx context.Context, params AssetsByTagParams) (*AssetsResult, error)

AssetsByTag lists assets with the specified tag.

This method does not return matching deleted assets, even if they have been backed up.

https://cloudinary.com/documentation/admin_api#get_resources_by_tag

func (*API) CreateFolder

func (a *API) CreateFolder(ctx context.Context, params CreateFolderParams) (*CreateFolderResult, error)

CreateFolder creates a new empty folder.

https://cloudinary.com/documentation/admin_api#create_folder

func (*API) CreateStreamingProfile

func (a *API) CreateStreamingProfile(ctx context.Context, params CreateStreamingProfileParams) (*GetStreamingProfileResult, error)

CreateStreamingProfile creates a new, custom streaming profile.

https://cloudinary.com/documentation/admin_api#create_a_streaming_profile

func (*API) CreateTransformation

func (a *API) CreateTransformation(ctx context.Context, params CreateTransformationParams) (*TransformationResult, error)

CreateTransformation creates a named transformation.

https://cloudinary.com/documentation/admin_api#create_named_transformation

func (*API) CreateUploadMapping

func (a *API) CreateUploadMapping(ctx context.Context, params CreateUploadMappingParams) (*CreateUploadMappingResult, error)

CreateUploadMapping creates a new upload mapping.

https://cloudinary.com/documentation/admin_api#create_an_upload_mapping

func (*API) CreateUploadPreset

func (a *API) CreateUploadPreset(ctx context.Context, params CreateUploadPresetParams) (*CreateUploadPresetResult, error)

CreateUploadPreset creates a new upload preset.

https://cloudinary.com/documentation/admin_api#create_an_upload_preset

func (*API) DeleteAllAssets

func (a *API) DeleteAllAssets(ctx context.Context, params DeleteAllAssetsParams) (*DeleteAssetsResult, error)

DeleteAllAssets deletes all assets of the specified asset and delivery type, including their derived resources.

Supports deleting up to a maximum of 1000 original assets in a single call.

https://cloudinary.com/documentation/admin_api#delete_resources

func (*API) DeleteAssets

func (a *API) DeleteAssets(ctx context.Context, params DeleteAssetsParams) (*DeleteAssetsResult, error)

DeleteAssets deletes the specified assets.

https://cloudinary.com/documentation/admin_api#delete_resources

func (*API) DeleteAssetsByPrefix

func (a *API) DeleteAssetsByPrefix(ctx context.Context, params DeleteAssetsByPrefixParams) (*DeleteAssetsResult, error)

DeleteAssetsByPrefix deletes assets by prefix.

https://cloudinary.com/documentation/admin_api#delete_resources

func (*API) DeleteAssetsByTag

func (a *API) DeleteAssetsByTag(ctx context.Context, params DeleteAssetsByTagParams) (*DeleteAssetsResult, error)

DeleteAssetsByTag deletes assets with the specified tag, including their derived resources.

Supports deleting up to a maximum of 1000 original assets in a single call.

https://cloudinary.com/documentation/admin_api#delete_resources_by_tags

func (*API) DeleteDataSourceEntries

func (a *API) DeleteDataSourceEntries(ctx context.Context, params DeleteDataSourceEntriesParams) (*DeleteDataSourceEntriesResult, error)

DeleteDataSourceEntries deletes entries in a metadata single or multi-select field's datasource.

Deletes (blocks) the datasource (list) entries from the specified metadata field definition. Sets the state of the entries to inactive. This is a soft delete. The entries still exist in the database and can be reactivated using the RestoreMetadataFieldDataSource method.

https://cloudinary.com/documentation/admin_api#delete_entries_in_a_metadata_field_datasource

func (*API) DeleteDerivedAssets

func (a *API) DeleteDerivedAssets(ctx context.Context, params DeleteDerivedAssetsParams) (*DeleteAssetsResult, error)

DeleteDerivedAssets deletes the specified derived resources by derived resource ID.

The derived resource IDs for a particular original asset are returned when calling the `resource` method to return the details of a single asset.

https://cloudinary.com/documentation/admin_api##delete_resources

func (*API) DeleteDerivedAssetsByTransformation

func (a *API) DeleteDerivedAssetsByTransformation(ctx context.Context, params DeleteDerivedAssetsByTransformationParams) (*DeleteAssetsResult, error)

DeleteDerivedAssetsByTransformation deletes derived resources identified by transformation and public_ids.

func (*API) DeleteFolder

func (a *API) DeleteFolder(ctx context.Context, params DeleteFolderParams) (*DeleteFolderResult, error)

DeleteFolder deletes an empty folder.

The specified folder cannot contain any assets, but can have empty descendant sub-folders.

https://cloudinary.com/documentation/admin_api#delete_folder

func (*API) DeleteMetadataField

func (a *API) DeleteMetadataField(ctx context.Context, params DeleteMetadataFieldParams) (*DeleteMetadataFieldResult, error)

DeleteMetadataField deletes a metadata field definition by external ID.

The external ID is immutable. Therefore, once deleted, the field's external ID can no longer be used for future purposes.

https://cloudinary.com/documentation/admin_api#delete_a_metadata_field_by_external_id

func (*API) DeleteRelatedAssets added in v2.3.0

func (a *API) DeleteRelatedAssets(ctx context.Context, params DeleteRelatedAssetsParams) (*DeleteRelatedAssetsResult, error)

DeleteRelatedAssets unrelates an asset from other assets by public IDs.

func (*API) DeleteRelatedAssetsByAssetIDs added in v2.3.0

func (a *API) DeleteRelatedAssetsByAssetIDs(ctx context.Context, params DeleteRelatedAssetsByAssetIDsParams) (*DeleteRelatedAssetsResult, error)

DeleteRelatedAssetsByAssetIDs unrelates an asset from other assets by asset IDs.

func (*API) DeleteStreamingProfile

func (a *API) DeleteStreamingProfile(ctx context.Context, params DeleteStreamingProfileParams) (*DeleteStreamingProfileResult, error)

DeleteStreamingProfile deletes or reverts the specified streaming profile.

For custom streaming profiles, deletes the specified profile. For built-in streaming profiles, if the built-in profile was modified, reverts the profile to the original settings. For built-in streaming profiles that have not been modified, the Delete method returns an error.

https://cloudinary.com/documentation/admin_api#delete_or_revert_the_specified_streaming_profile

func (*API) DeleteTransformation

func (a *API) DeleteTransformation(ctx context.Context, params DeleteTransformationParams) (*TransformationResult, error)

DeleteTransformation deletes the specified stored transformation.

Deleting a transformation also deletes all the stored derived resources based on this transformation (up to 1000). The method returns an error if there are more than 1000 derived resources based on this transformation.

https://cloudinary.com/documentation/admin_api#delete_transformation

func (*API) DeleteUploadMapping

func (a *API) DeleteUploadMapping(ctx context.Context, params DeleteUploadMappingParams) (*UploadMappingResult, error)

DeleteUploadMapping deletes an upload mapping.

https://cloudinary.com/documentation/admin_api#delete_an_upload_mapping

func (*API) DeleteUploadPreset

func (a *API) DeleteUploadPreset(ctx context.Context, params DeleteUploadPresetParams) (*UploadPresetResult, error)

DeleteUploadPreset deletes the specified upload preset.

https://cloudinary.com/documentation/admin_api#delete_an_upload_preset

func (*API) GetStreamingProfile

func (a *API) GetStreamingProfile(ctx context.Context, params GetStreamingProfileParams) (*GetStreamingProfileResult, error)

GetStreamingProfile gets details of a single streaming profile by name.

https://cloudinary.com/documentation/admin_api#get_details_of_a_single_streaming_profile

func (*API) GetTransformation

func (a *API) GetTransformation(ctx context.Context, params GetTransformationParams) (*GetTransformationResult, error)

GetTransformation returns the details of a single transformation.

https://cloudinary.com/documentation/admin_api#get_transformation_details

func (*API) GetUploadMapping

func (a *API) GetUploadMapping(ctx context.Context, params GetUploadMappingParams) (*GetUploadMappingResult, error)

GetUploadMapping returns the details of the specified upload mapping.

Retrieve the mapped template (URL) of a specified upload mapping folder.

https://cloudinary.com/documentation/admin_api#get_the_details_of_a_single_upload_mapping

func (*API) GetUploadPreset

func (a *API) GetUploadPreset(ctx context.Context, params GetUploadPresetParams) (*GetUploadPresetResult, error)

GetUploadPreset retrieves the details of the specified upload preset.

https://cloudinary.com/documentation/admin_api#get_the_details_of_a_single_upload_preset

func (*API) ListMetadataFields

func (a *API) ListMetadataFields(ctx context.Context) (*ListMetadataFieldsResult, error)

ListMetadataFields lists all metadata field definitions.

https://cloudinary.com/documentation/admin_api#get_metadata_fields

func (*API) ListStreamingProfiles

func (a *API) ListStreamingProfiles(ctx context.Context) (*ListStreamingProfilesResult, error)

ListStreamingProfiles lists streaming profiles including built-in and custom profiles.

https://cloudinary.com/documentation/admin_api#get_adaptive_streaming_profiles

func (*API) ListTransformations

func (a *API) ListTransformations(ctx context.Context, params ListTransformationsParams) (*ListTransformationsResult, error)

ListTransformations lists stored transformations.

https://cloudinary.com/documentation/admin_api#get_transformations

func (*API) ListUploadMappings

func (a *API) ListUploadMappings(ctx context.Context, params ListUploadMappingsParams) (*ListUploadMappingsResult, error)

ListUploadMappings lists upload mappings by folder and its mapped template (URL).

https://cloudinary.com/documentation/admin_api#get_upload_mappings

func (*API) ListUploadPresets

func (a *API) ListUploadPresets(ctx context.Context, params ListUploadPresetsParams) (*ListUploadPresetsResult, error)

ListUploadPresets lists existing upload presets.

https://cloudinary.com/documentation/admin_api#get_upload_presets

func (*API) MetadataFieldByFieldID

func (a *API) MetadataFieldByFieldID(ctx context.Context, params MetadataFieldByFieldIDParams) (*MetadataFieldByFieldIDResult, error)

MetadataFieldByFieldID gets a single metadata field definition by external ID.

https://cloudinary.com/documentation/admin_api#get_a_metadata_field_by_external_id

func (*API) Ping

func (a *API) Ping(ctx context.Context) (*PingResult, error)

Ping tests the reachability of the Cloudinary API.

https://cloudinary.com/documentation/admin_api#ping

func (*API) ReorderMetadataFieldDatasource

func (a *API) ReorderMetadataFieldDatasource(ctx context.Context, params ReorderMetadataFieldDatasourceParams) (*ReorderMetadataFieldDatasourceResult, error)

ReorderMetadataFieldDatasource reorders metadata fields datasource. Currently, supports only value.

func (*API) ReorderMetadataFields

func (a *API) ReorderMetadataFields(ctx context.Context, params ReorderMetadataFieldsParams) (*ReorderMetadataFieldsResult, error)

ReorderMetadataFields reorders metadata fields.

func (*API) RestoreAssets

func (a *API) RestoreAssets(ctx context.Context, params RestoreAssetsParams) (*RestoreAssetsResult, error)

RestoreAssets reverts to the latest backed up version of the specified deleted assets.

https://cloudinary.com/documentation/admin_api#restore_resources

func (*API) RestoreDatasourceEntries

func (a *API) RestoreDatasourceEntries(ctx context.Context, params RestoreDatasourceEntriesParams) (*RestoreDatasourceEntriesResult, error)

RestoreDatasourceEntries restores entries in a metadata field datasource.

Restores (unblocks) any previously deleted datasource entries for a specified metadata field definition. Sets the state of the entries to active.

https://cloudinary.com/documentation/admin_api#restore_entries_in_a_metadata_field_datasource

func (*API) RootFolders

func (a *API) RootFolders(ctx context.Context, params RootFoldersParams) (*FoldersResult, error)

RootFolders lists all root folders.

https://cloudinary.com/documentation/admin_api#get_root_folders

func (*API) Search

func (a *API) Search(ctx context.Context, searchQuery search.Query) (*SearchResult, error)

Search executes the search API request.

func (*API) SearchFolders added in v2.4.0

func (a *API) SearchFolders(ctx context.Context, searchQuery search.Query) (*SearchFoldersResult, error)

SearchFolders executes the search folders API request.

func (*API) SubFolders

func (a *API) SubFolders(ctx context.Context, params SubFoldersParams) (*FoldersResult, error)

SubFolders lists sub-folders.

Returns the name and path of all the sub-folders of a specified parent folder. Limited to 2000 results.

https://cloudinary.com/documentation/admin_api#get_subfolders

func (*API) Tags

func (a *API) Tags(ctx context.Context, params TagsParams) (*TagsResult, error)

Tags lists all the tags currently used for a specified asset type.

https://cloudinary.com/documentation/admin_api#get_tags

func (*API) UpdateAsset

func (a *API) UpdateAsset(ctx context.Context, params UpdateAssetParams) (*AssetResult, error)

UpdateAsset updates details of an existing asset.

Updates one or more of the attributes associated with a specified asset. Note that you can also update most attributes of an existing asset using the uploader.Explicit method, which is not rate limited.

https://cloudinary.com/documentation/admin_api#update_details_of_an_existing_resource

func (*API) UpdateMetadataField

func (a *API) UpdateMetadataField(ctx context.Context, params UpdateMetadataFieldParams) (*UpdateMetadataFieldResult, error)

UpdateMetadataField updates a metadata field by external ID.

Updates a metadata field definition (partially, no need to pass the entire object) passed as JSON data.

https://cloudinary.com/documentation/admin_api#update_a_metadata_field_by_external_id

func (*API) UpdateMetadataFieldDataSource

func (a *API) UpdateMetadataFieldDataSource(ctx context.Context, params UpdateMetadataFieldDataSourceParams) (*UpdateMetadataFieldDataSourceResult, error)

UpdateMetadataFieldDataSource updates a metadata field datasource.

Updates the datasource of a supported field type (currently enum or set), passed as JSON data. The update is partial: datasource entries with an existing external_id will be updated and entries with new external_id’s (or without external_id’s) will be appended.

https://cloudinary.com/documentation/admin_api#update_a_metadata_field_datasource

func (*API) UpdateStreamingProfile

func (a *API) UpdateStreamingProfile(ctx context.Context, params UpdateStreamingProfileParams) (*GetStreamingProfileResult, error)

UpdateStreamingProfile updates an existing streaming profile.

You can update both custom and built-in profiles. The specified list of representations replaces the previous list.

https://cloudinary.com/documentation/admin_api#update_an_existing_streaming_profile

func (*API) UpdateTransformation

func (a *API) UpdateTransformation(ctx context.Context, params UpdateTransformationParams) (*TransformationResult, error)

UpdateTransformation updates the specified transformation.

https://cloudinary.com/documentation/admin_api#update_transformation

func (*API) UpdateUploadMapping

func (a *API) UpdateUploadMapping(ctx context.Context, params UpdateUploadMappingParams) (*UploadMappingResult, error)

UpdateUploadMapping updates an existing upload mapping with a new template (URL).

https://cloudinary.com/documentation/admin_api#update_an_upload_mapping

func (*API) UpdateUploadPreset

func (a *API) UpdateUploadPreset(ctx context.Context, params UpdateUploadPresetParams) (*UploadPresetResult, error)

UpdateUploadPreset updates the specified upload preset.

https://cloudinary.com/documentation/admin_api#update_an_upload_preset

func (*API) Usage

func (a *API) Usage(ctx context.Context, params UsageParams) (*UsageResult, error)

Usage gets account usage details.

Returns a report detailing your current Cloudinary account usage details, including storage, bandwidth, requests, number of resources, and add-on usage. Note that numbers are updated periodically.

https://cloudinary.com/documentation/admin_api#usage

func (*API) VisualSearch added in v2.4.0

func (a *API) VisualSearch(ctx context.Context, params VisualSearchParams) (*VisualSearchResult, error)

VisualSearch finds images based on their visual content.

type AccessibilityAnalysisResult

type AccessibilityAnalysisResult struct {
	ColorblindAccessibilityAnalysis struct {
		DistinctEdges      float64  `json:"distinct_edges"`
		DistinctColors     float64  `json:"distinct_colors"`
		MostIndistinctPair []string `json:"most_indistinct_pair"`
	} `json:"colorblind_accessibility_analysis"`
	ColorblindAccessibilityScore float64 `json:"colorblind_accessibility_score"`
}

AccessibilityAnalysisResult contains the details about accessibility analysis.

type AddMetadataFieldResult

type AddMetadataFieldResult struct {
	metadata.Field
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

AddMetadataFieldResult is the result of AddMetadataField.

type AddRelatedAssetsByAssetIDsParams added in v2.3.0

type AddRelatedAssetsByAssetIDsParams struct {
	AssetID        string   `json:"-"`
	AssetsToRelate []string `json:"assets_to_relate"`
}

AddRelatedAssetsByAssetIDsParams are the parameters for AddRelatedAssetsByAssetIDs.

type AddRelatedAssetsParams added in v2.3.0

type AddRelatedAssetsParams struct {
	AssetType      api.AssetType    `json:"-"`
	DeliveryType   api.DeliveryType `json:"-"`
	PublicID       string           `json:"-"`
	AssetsToRelate []string         `json:"assets_to_relate"`
}

AddRelatedAssetsParams are the parameters for AddRelatedAssets.

type AddRelatedAssetsResult added in v2.3.0

type AddRelatedAssetsResult struct {
	Success []RelatedAssetResult `json:"success"`
	Failed  []RelatedAssetResult `json:"failed"`
}

AddRelatedAssetsResult is the result of AddRelatedAssets.

type AssetByAssetIDParams

type AssetByAssetIDParams struct {
	AssetID               string `json:"-"`
	Colors                *bool  `json:"colors,omitempty"`
	Exif                  *bool  `json:"exif,omitempty"`
	Faces                 *bool  `json:"faces,omitempty"`
	QualityAnalysis       *bool  `json:"quality_analysis,omitempty"`
	ImageMetadata         *bool  `json:"image_metadata,omitempty"`
	MediaMetadata         *bool  `json:"media_metadata,omitempty"`
	Phash                 *bool  `json:"phash,omitempty"`
	Pages                 *bool  `json:"pages,omitempty"`
	CinemagraphAnalysis   *bool  `json:"cinemagraph_analysis,omitempty"`
	Coordinates           *bool  `json:"coordinates,omitempty"`
	MaxResults            int    `json:"max_results,omitempty"`
	DerivedNextCursor     string `json:"derived_next_cursor,omitempty"`
	AccessibilityAnalysis *bool  `json:"accessibility_analysis,omitempty"`
	Versions              *bool  `json:"versions,omitempty"`
}

AssetByAssetIDParams are the parameters for AssetByAssetID.

type AssetParams

type AssetParams struct {
	AssetType             api.AssetType    `json:"-"`
	DeliveryType          api.DeliveryType `json:"-"`
	PublicID              string           `json:"-"`
	Exif                  *bool            `json:"exif,omitempty"`
	Colors                *bool            `json:"colors,omitempty"`
	Faces                 *bool            `json:"faces,omitempty"`
	QualityAnalysis       *bool            `json:"quality_analysis,omitempty"`
	ImageMetadata         *bool            `json:"image_metadata,omitempty"`
	MediaMetadata         *bool            `json:"media_metadata,omitempty"`
	Phash                 *bool            `json:"phash,omitempty"`
	Pages                 *bool            `json:"pages,omitempty"`
	AccessibilityAnalysis *bool            `json:"accessibility_analysis,omitempty"`
	CinemagraphAnalysis   *bool            `json:"cinemagraph_analysis,omitempty"`
	Coordinates           *bool            `json:"coordinates,omitempty"`
	MaxResults            int              `json:"max_results,omitempty"`
	DerivedNextCursor     string           `json:"derived_next_cursor,omitempty"`
	Related               *bool            `json:"related,omitempty"`
	RelatedNextCursor     string           `json:"related_next_cursor,omitempty"`
	Versions              *bool            `json:"versions,omitempty"`
}

AssetParams are the parameters for Asset.

type AssetResult

type AssetResult struct {
	AssetID               string                      `json:"asset_id"`
	PublicID              string                      `json:"public_id"`
	Format                string                      `json:"format"`
	AssetFolder           string                      `json:"asset_folder"`
	DisplayName           string                      `json:"display_name"`
	Version               int                         `json:"version"`
	ResourceType          string                      `json:"resource_type"`
	Type                  string                      `json:"type"`
	CreatedAt             time.Time                   `json:"created_at"`
	Bytes                 int                         `json:"bytes"`
	Width                 int                         `json:"width"`
	Height                int                         `json:"height"`
	Backup                bool                        `json:"backup"`
	AccessMode            string                      `json:"access_mode"`
	URL                   string                      `json:"url"`
	SecureURL             string                      `json:"secure_url"`
	Metadata              api.Metadata                `json:"metadata,omitempty"`
	Tags                  []string                    `json:"tags"`
	LastUpdated           api.LastUpdated             `json:"last_updated"`
	NextCursor            string                      `json:"next_cursor"`
	Derived               []interface{}               `json:"derived"`
	Etag                  string                      `json:"etag"`
	ImageMetadata         ImageMetadataResult         `json:"image_metadata"`
	VideoMetadata         MediaMetadataResult         `json:"video_metadata"`
	Coordinates           interface{}                 `json:"coordinates"`
	Info                  interface{}                 `json:"info"`
	Exif                  interface{}                 `json:"exif"`
	Faces                 [][]int                     `json:"faces"`
	IllustrationScore     float64                     `json:"illustration_score"`
	SemiTransparent       bool                        `json:"semi_transparent"`
	Grayscale             bool                        `json:"grayscale"`
	Colors                [][]interface{}             `json:"colors"`
	Predominant           PredominantResult           `json:"predominant"`
	Phash                 string                      `json:"phash"`
	QualityAnalysis       QualityAnalysisResult       `json:"quality_analysis"`
	QualityScore          float64                     `json:"quality_score"`
	AccessibilityAnalysis AccessibilityAnalysisResult `json:"accessibility_analysis"`
	Pages                 int                         `json:"pages"`
	CinemagraphAnalysis   CinemagraphAnalysisResult   `json:"cinemagraph_analysis"`
	Usage                 interface{}                 `json:"usage"`
	OriginalFilename      string                      `json:"original_filename"`
	Error                 api.ErrorResp               `json:"error,omitempty"`
	Response              interface{}
}

AssetResult is the result of the Asset.

type AssetTypesResult

type AssetTypesResult struct {
	AssetTypes []string      `json:"resource_types"`
	Error      api.ErrorResp `json:"error,omitempty"`
}

AssetTypesResult is the result of the AssetTypes.

type AssetsByAssetFolderParams added in v2.2.0

type AssetsByAssetFolderParams struct {
	AssetFolder string          `json:"asset_folder"`
	Tags        *bool           `json:"tags,omitempty"`
	Context     *bool           `json:"context,omitempty"`
	Moderations *bool           `json:"moderations,omitempty"`
	NextCursor  string          `json:"next_cursor,omitempty"`
	MaxResults  int             `json:"max_results,omitempty"`
	Fields      api.CldAPIArray `json:"fields,omitempty"`
}

AssetsByAssetFolderParams are the parameters for AssetsByAssetFolder.

type AssetsByContextParams

type AssetsByContextParams struct {
	AssetType   api.AssetType   `json:"-"`
	Key         string          `json:"key"`
	Value       string          `json:"value,omitempty"`
	NextCursor  string          `json:"next_cursor,omitempty"`
	MaxResults  int             `json:"max_results,omitempty"`
	Tags        *bool           `json:"tags,omitempty"`
	Context     *bool           `json:"context,omitempty"`
	Moderations *bool           `json:"moderations,omitempty"`
	Direction   string          `json:"direction,omitempty"`
	Fields      api.CldAPIArray `json:"fields,omitempty"`
}

AssetsByContextParams are the parameters for AssetsByContext.

type AssetsByIDsParams

type AssetsByIDsParams struct {
	AssetType    api.AssetType    `json:"-"`
	DeliveryType api.DeliveryType `json:"-"`
	PublicIDs    api.CldAPIArray  `json:"public_ids"`
	Tags         *bool            `json:"tags,omitempty"`
	Context      *bool            `json:"context,omitempty"`
	Moderations  *bool            `json:"moderations,omitempty"`
	Fields       api.CldAPIArray  `json:"fields,omitempty"`
}

AssetsByIDsParams are the parameters for AssetsByIDs.

type AssetsByModerationParams

type AssetsByModerationParams struct {
	AssetType   api.AssetType   `json:"-"`
	Kind        string          `json:"-"`
	Status      string          `json:"-"`
	NextCursor  string          `json:"next_cursor,omitempty"`
	MaxResults  int             `json:"max_results,omitempty"`
	Tags        *bool           `json:"tags,omitempty"`
	Context     *bool           `json:"context,omitempty"`
	Moderations *bool           `json:"moderations,omitempty"`
	Direction   string          `json:"direction,omitempty"`
	Fields      api.CldAPIArray `json:"fields,omitempty"`
}

AssetsByModerationParams are the parameters for AssetsByModeration.

type AssetsByTagParams

type AssetsByTagParams struct {
	AssetType   api.AssetType   `json:"-"`
	Tag         string          `json:"-"`
	NextCursor  string          `json:"next_cursor,omitempty"`
	MaxResults  int             `json:"max_results,omitempty"`
	Tags        *bool           `json:"tags,omitempty"`
	Context     *bool           `json:"context,omitempty"`
	Moderations *bool           `json:"moderations,omitempty"`
	Direction   string          `json:"direction,omitempty"`
	Fields      api.CldAPIArray `json:"fields,omitempty"`
}

AssetsByTagParams are the parameters for AssetsByTag.

type AssetsParams

type AssetsParams struct {
	AssetType    api.AssetType   `json:"-"`
	DeliveryType string          `json:"-"`
	Prefix       string          `json:"prefix,omitempty"`
	StartAt      *time.Time      `json:"start_at,omitempty"`
	NextCursor   string          `json:"next_cursor,omitempty"`
	MaxResults   int             `json:"max_results,omitempty"`
	Tags         *bool           `json:"tags,omitempty"`
	Context      *bool           `json:"context,omitempty"`
	Moderations  *bool           `json:"moderations,omitempty"`
	Direction    string          `json:"direction,omitempty"`
	Fields       api.CldAPIArray `json:"fields,omitempty"`
}

AssetsParams are the parameters for Assets.

type AssetsResult

type AssetsResult struct {
	Assets     []api.BriefAssetResult `json:"resources"`
	NextCursor string                 `json:"next_cursor"`
	Error      api.ErrorResp          `json:"error,omitempty"`
	Response   interface{}
}

AssetsResult is the result of Assets.

type CinemagraphAnalysisResult

type CinemagraphAnalysisResult struct {
	CinemagraphScore float64 `json:"cinemagraph_score"`
}

CinemagraphAnalysisResult contains the details about cinemagraph analysis.

type CreateFolderParams

type CreateFolderParams struct {
	Folder string `json:"-"` // The full path of the new folder to create.
}

CreateFolderParams are the parameters for CreateFolder.

type CreateFolderResult

type CreateFolderResult struct {
	Success bool          `json:"success"`
	Path    string        `json:"path"`
	Name    string        `json:"name"`
	Error   api.ErrorResp `json:"error,omitempty"`
}

CreateFolderResult is the result of CreateFolder.

type CreateStreamingProfileParams

type CreateStreamingProfileParams struct {
	Name            string                          `json:"name"` // The name to assign to the new streaming profile.
	DisplayName     string                          `json:"display_name,omitempty"`
	Representations StreamingProfileRepresentations `json:"representations"`
}

CreateStreamingProfileParams are the parameters for CreateStreamingProfile.

type CreateTransformationParams

type CreateTransformationParams struct {
	Name           string                           `json:"name"`
	Transformation transformation.RawTransformation `json:"transformation"`
}

CreateTransformationParams are the parameters for CreateTransformation.

type CreateUploadMappingParams

type CreateUploadMappingParams struct {
	Folder   string `json:"folder"`   // The name of the folder to map.
	Template string `json:"template"` // The URL to be mapped to the folder.
}

CreateUploadMappingParams are the parameters for CreateUploadMapping.

type CreateUploadMappingResult

type CreateUploadMappingResult struct {
	Message string        `json:"message"`
	Folder  string        `json:"folder"`
	Error   api.ErrorResp `json:"error,omitempty"`
}

CreateUploadMappingResult is the result of CreateUploadMapping.

type CreateUploadPresetParams

type CreateUploadPresetParams struct {
	Name             string `json:"name,omitempty"`
	Unsigned         *bool  `json:"unsigned,omitempty"`
	DisallowPublicID *bool  `json:"disallow_public_id,omitempty"`
	Live             *bool  `json:"live,omitempty"`
	uploader.UploadParams
}

CreateUploadPresetParams are the parameters for CreateUploadPreset.

type CreateUploadPresetResult

type CreateUploadPresetResult struct {
	Message string        `json:"message"`
	Name    string        `json:"name"`
	Error   api.ErrorResp `json:"error,omitempty"`
}

CreateUploadPresetResult is the result of CreateUploadPreset.

type DeleteAllAssetsParams

type DeleteAllAssetsParams struct {
	AssetType       api.AssetType    `json:"-"`
	DeliveryType    api.DeliveryType `json:"-"`
	All             *bool            `json:"all"`
	KeepOriginal    *bool            `json:"keep_original,omitempty"`
	Invalidate      *bool            `json:"invalidate,omitempty"`
	Transformations string           `json:"transformations,omitempty"`
	NextCursor      string           `json:"next_cursor,omitempty"`
}

DeleteAllAssetsParams are the parameters for DeleteAllAssets.

type DeleteAssetsByPrefixParams

type DeleteAssetsByPrefixParams struct {
	AssetType       api.AssetType    `json:"-"`
	DeliveryType    api.DeliveryType `json:"-"`
	Prefix          api.CldAPIArray  `json:"prefix"`
	KeepOriginal    *bool            `json:"keep_original,omitempty"`
	Invalidate      *bool            `json:"invalidate,omitempty"`
	Transformations string           `json:"transformations,omitempty"`
	NextCursor      string           `json:"next_cursor,omitempty"`
}

DeleteAssetsByPrefixParams are the parameters for DeleteAssetsByPrefix.

type DeleteAssetsByTagParams

type DeleteAssetsByTagParams struct {
	AssetType       api.AssetType `json:"-"`
	Tag             string        `json:"-"`
	KeepOriginal    *bool         `json:"keep_original,omitempty"`
	Invalidate      *bool         `json:"invalidate,omitempty"`
	Transformations string        `json:"transformations,omitempty"`
	NextCursor      string        `json:"next_cursor,omitempty"`
}

DeleteAssetsByTagParams are the parameters for DeleteAssetsByTag.

type DeleteAssetsParams

type DeleteAssetsParams struct {
	AssetType       api.AssetType    `json:"-"`
	DeliveryType    api.DeliveryType `json:"-"`
	PublicIDs       api.CldAPIArray  `json:"public_ids"` // The public IDs of the assets to delete (up to 100).
	KeepOriginal    *bool            `json:"keep_original,omitempty"`
	Invalidate      *bool            `json:"invalidate,omitempty"`
	Transformations string           `json:"transformations,omitempty"`
	NextCursor      string           `json:"next_cursor,omitempty"`
}

DeleteAssetsParams are the parameters for DeleteAssets.

type DeleteAssetsResult

type DeleteAssetsResult struct {
	Deleted       map[string]string      `json:"deleted"`
	DeletedCounts map[string]interface{} `json:"deleted_counts"`
	Partial       bool                   `json:"partial"`
	NextCursor    string                 `json:"next_cursor,omitempty"`
	Error         api.ErrorResp          `json:"error,omitempty"`
}

DeleteAssetsResult is the result of DeleteAssets.

type DeleteDataSourceEntriesParams

type DeleteDataSourceEntriesParams struct {
	FieldExternalID    string   `json:"-"`
	EntriesExternalIDs []string `json:"external_ids"`
}

DeleteDataSourceEntriesParams are the parameters for DeleteDataSourceEntries.

type DeleteDataSourceEntriesResult

type DeleteDataSourceEntriesResult struct {
	metadata.DataSource
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

DeleteDataSourceEntriesResult is the result of DeleteDataSourceEntries.

type DeleteDerivedAssetsByTransformationParams

type DeleteDerivedAssetsByTransformationParams struct {
	AssetType       api.AssetType    `json:"-"`
	DeliveryType    api.DeliveryType `json:"-"`
	PublicIDs       api.CldAPIArray  `json:"public_ids"`      // The public IDs for which you want to delete derived resources.
	Transformations string           `json:"transformations"` // The transformation(s) associated with the derived resources to delete.
	KeepOriginal    *bool            `json:"keep_original"`
	Invalidate      *bool            `json:"invalidate,omitempty"`
}

DeleteDerivedAssetsByTransformationParams are the parameters for DeleteDerivedAssetsByTransformation.

type DeleteDerivedAssetsParams

type DeleteDerivedAssetsParams struct {
	DerivedAssetIDs api.CldAPIArray `json:"derived_resource_ids"`
}

DeleteDerivedAssetsParams are the parameters for DeleteDerivedAssets.

type DeleteFolderParams

type DeleteFolderParams struct {
	Folder string `json:"-"` // The full path of the empty folder to delete.
}

DeleteFolderParams are the parameters for DeleteFolder.

type DeleteFolderResult

type DeleteFolderResult struct {
	Deleted []string      `json:"deleted"`
	Error   api.ErrorResp `json:"error,omitempty"`
}

DeleteFolderResult is the result of DeleteFolder.

type DeleteMetadataFieldParams

type DeleteMetadataFieldParams struct {
	FieldExternalID string `json:"-"`
}

DeleteMetadataFieldParams are the parameters for DeleteMetadataField.

type DeleteMetadataFieldResult

type DeleteMetadataFieldResult struct {
	Message  string        `json:"message"`
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

DeleteMetadataFieldResult is the result of DeleteMetadataField.

type DeleteRelatedAssetsByAssetIDsParams added in v2.3.0

type DeleteRelatedAssetsByAssetIDsParams struct {
	AssetID          string   `json:"-"`
	AssetsToUnrelate []string `json:"assets_to_unrelate"`
}

DeleteRelatedAssetsByAssetIDsParams are the parameters for DeleteRelatedAssetsByAssetIDs.

type DeleteRelatedAssetsParams added in v2.3.0

type DeleteRelatedAssetsParams struct {
	AssetType        api.AssetType    `json:"-"`
	DeliveryType     api.DeliveryType `json:"-"`
	PublicID         string           `json:"-"`
	AssetsToUnrelate []string         `json:"assets_to_unrelate"`
}

DeleteRelatedAssetsParams are the parameters for DeleteRelatedAssets.

type DeleteRelatedAssetsResult added in v2.3.0

type DeleteRelatedAssetsResult struct {
	Success []RelatedAssetResult `json:"success"`
	Failed  []RelatedAssetResult `json:"failed"`
}

DeleteRelatedAssetsResult is the result of DeleteRelatedAssets.

type DeleteStreamingProfileParams

type DeleteStreamingProfileParams struct {
	Name string `json:"-"` // The name of the streaming profile to delete or revert.
}

DeleteStreamingProfileParams are the parameters for DeleteStreamingProfile.

type DeleteStreamingProfileResult

type DeleteStreamingProfileResult struct {
	Message string        `json:"message"`
	Error   api.ErrorResp `json:"error,omitempty"`
}

DeleteStreamingProfileResult is the result of DeleteStreamingProfile.

type DeleteTransformationParams

type DeleteTransformationParams struct {
	Transformation transformation.RawTransformation `json:"transformation"`
}

DeleteTransformationParams are the parameters for DeleteTransformation.

type DeleteUploadMappingParams

type DeleteUploadMappingParams struct {
	Folder string `json:"folder"` // The name of the upload mapping folder to delete.
}

DeleteUploadMappingParams are the parameters for DeleteUploadMapping.

type DeleteUploadPresetParams

type DeleteUploadPresetParams struct {
	Name string `json:"-"`
}

DeleteUploadPresetParams are the parameters for DeleteUploadPreset.

type DerivedAsset

type DerivedAsset struct {
	PublicID     string `json:"public_id"`
	ResourceType string `json:"resource_type"`
	Type         string `json:"type"`
	Format       string `json:"format"`
	URL          string `json:"url"`
	SecureURL    string `json:"secure_url"`
	Bytes        int    `json:"bytes"`
	ID           string `json:"id"`
}

DerivedAsset represents a single derived asset.

type Direction

type Direction string

Direction is the sorting direction.

const (
	// Ascending direction.
	Ascending Direction = "asc"
	// Descending direction.
	Descending = "desc"
)

type FolderResult

type FolderResult struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

FolderResult contains details of a single folder.

type FoldersResult

type FoldersResult struct {
	Folders    []FolderResult `json:"folders"`
	TotalCount int            `json:"total_count"`
	NextCursor string         `json:"next_cursor"`
	Error      api.ErrorResp  `json:"error,omitempty"`
}

FoldersResult is the result of RootFolders, SubFolders.

type GetStreamingProfileParams

type GetStreamingProfileParams struct {
	Name string `json:"-"`
}

GetStreamingProfileParams are the parameters for GetStreamingProfile.

type GetStreamingProfileResult

type GetStreamingProfileResult struct {
	Data  StreamingProfileDetails `json:"data"`
	Error api.ErrorResp           `json:"error,omitempty"`
}

GetStreamingProfileResult is the result of GetStreamingProfile.

type GetTransformationParams

type GetTransformationParams struct {
	Transformation transformation.RawTransformation `json:"transformation"` // The transformation string.
	MaxResults     int                              `json:"max_results,omitempty"`
	NextCursor     string                           `json:"next_cursor,omitempty"`
}

GetTransformationParams are the parameters for GetTransformation.

type GetTransformationResult

type GetTransformationResult struct {
	Name             string                        `json:"name"`
	AllowedForStrict bool                          `json:"allowed_for_strict"`
	Used             bool                          `json:"used"`
	Named            bool                          `json:"named"`
	Info             transformation.Transformation `json:"info"`
	Derived          []DerivedAsset                `json:"derived"`
	NextCursor       string                        `json:"next_cursor"`
	Error            api.ErrorResp                 `json:"error,omitempty"`
}

GetTransformationResult is the result of GetTransformation.

type GetUploadMappingParams

type GetUploadMappingParams struct {
	Folder string `json:"folder"` // The name of the upload mapping folder.
}

GetUploadMappingParams are the parameters for GetUploadMapping.

type GetUploadMappingResult

type GetUploadMappingResult struct {
	Folder   string        `json:"folder"`
	Template string        `json:"template"`
	Error    api.ErrorResp `json:"error,omitempty"`
}

GetUploadMappingResult is the result of GetUploadMapping.

type GetUploadPresetParams

type GetUploadPresetParams struct {
	Name       string `json:"-"`
	MaxResults int    `json:"max_results,omitempty"`
}

GetUploadPresetParams are the parameters for GetUploadPreset.

type GetUploadPresetResult

type GetUploadPresetResult struct {
	Name     string        `json:"name"`
	Unsigned bool          `json:"unsigned"`
	Settings interface{}   `json:"settings"`
	Error    api.ErrorResp `json:"error,omitempty"`
}

GetUploadPresetResult is the result of GetUploadPreset.

type ImageAnalysis

type ImageAnalysis struct {
	FaceCount         int                `json:"face_count"`
	Faces             [][]int            `json:"faces"`
	Grayscale         bool               `json:"grayscale"`
	IllustrationScore int                `json:"illustration_score"`
	Transparent       bool               `json:"transparent"`
	Etag              string             `json:"etag"`
	Colors            map[string]float64 `json:"colors"`
}

ImageAnalysis contains details about image analysis.

type ImageMetadataResult

type ImageMetadataResult map[string]string

ImageMetadataResult contains the image metadata.

type ListMetadataFieldsResult

type ListMetadataFieldsResult struct {
	MetadataFields []metadata.Field `json:"metadata_fields"`
	Error          api.ErrorResp    `json:"error,omitempty"`
	Response       interface{}
}

ListMetadataFieldsResult is the result of ListMetadataFields.

type ListStreamingProfilesResult

type ListStreamingProfilesResult struct {
	Data  []StreamingProfile `json:"data"`
	Error api.ErrorResp      `json:"error,omitempty"`
}

ListStreamingProfilesResult represents the result of listing of streaming profiles.

type ListTransformationsParams

type ListTransformationsParams struct {
	Named      *bool  `json:"named,omitempty"`
	MaxResults int    `json:"max_results,omitempty"`
	NextCursor string `json:"next_cursor,omitempty"`
}

ListTransformationsParams are the parameters for ListTransformations.

type ListTransformationsResult

type ListTransformationsResult struct {
	Transformations []TransformationListItem `json:"transformations"`
	Error           api.ErrorResp            `json:"error,omitempty"`
}

ListTransformationsResult is the result of ListTransformations.

type ListUploadMappingsParams

type ListUploadMappingsParams struct {
	MaxResults int    `json:"max_results,omitempty"`
	NextCursor string `json:"next_cursor,omitempty"`
}

ListUploadMappingsParams are the parameters for ListUploadMappings.

type ListUploadMappingsResult

type ListUploadMappingsResult struct {
	Mappings []UploadMapping `json:"mappings"`
	Error    api.ErrorResp   `json:"error,omitempty"`
}

ListUploadMappingsResult is the result of ListUploadMappings.

type ListUploadPresetsParams

type ListUploadPresetsParams struct {
	MaxResults int    `json:"max_results,omitempty"`
	NextCursor string `json:"next_cursor,omitempty"`
}

ListUploadPresetsParams are the parameters for ListUploadPresets.

type ListUploadPresetsResult

type ListUploadPresetsResult struct {
	Presets []UploadPreset `json:"presets"`
	Error   api.ErrorResp  `json:"error,omitempty"`
}

ListUploadPresetsResult is the result of ListUploadPresets.

type MediaMetadataResult added in v2.4.0

type MediaMetadataResult map[string]interface{}

MediaMetadataResult contains the media metadata.

type MetadataFieldByFieldIDParams

type MetadataFieldByFieldIDParams struct {
	FieldExternalID string `json:"-"`
}

MetadataFieldByFieldIDParams are the parameters for MetadataFieldByFieldID.

type MetadataFieldByFieldIDResult

type MetadataFieldByFieldIDResult struct {
	metadata.Field
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

MetadataFieldByFieldIDResult is the result of MetadataFieldByFieldID.

type OrderByField

type OrderByField string

OrderByField is the field to order by.

const OrderFieldCreatedAt OrderByField = "created_at"

OrderFieldCreatedAt defines to order by created_at.

const OrderFieldExternalID OrderByField = "external_id"

OrderFieldExternalID defines to order by external_id.

const OrderFieldLabel OrderByField = "label"

OrderFieldLabel defines to order by label.

const OrderFieldValue OrderByField = "value"

OrderFieldValue defines to order by value.

type PingResult

type PingResult struct {
	Status   string        `json:"status"`
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

PingResult represents the result of the Ping request.

type PredominantResult

type PredominantResult struct {
	Google     [][]interface{} `json:"google"`
	Cloudinary [][]interface{} `json:"cloudinary"`
}

PredominantResult contains the details about predominant colors.

type QualityAnalysisResult

type QualityAnalysisResult struct {
	JpegQuality       float64 `json:"jpeg_quality"`
	JpegChroma        float64 `json:"jpeg_chroma"`
	Focus             float64 `json:"focus"`
	Noise             float64 `json:"noise"`
	Contrast          float64 `json:"contrast"`
	Exposure          float64 `json:"exposure"`
	Saturation        float64 `json:"saturation"`
	Lighting          float64 `json:"lighting"`
	PixelScore        float64 `json:"pixel_score"`
	ColorScore        float64 `json:"color_score"`
	Dct               float64 `json:"dct"`
	Blockiness        float64 `json:"blockiness"`
	ChromaSubsampling float64 `json:"chroma_subsampling"`
	Resolution        float64 `json:"resolution"`
}

QualityAnalysisResult contains the details about quality analysis.

type RawStreamingProfileRepresentation

type RawStreamingProfileRepresentation struct {
	Transformation transformation.RawTransformation `json:"transformation"`
}

RawStreamingProfileRepresentation is a raw representation of a steaming profile.

type RelatedAssetResult added in v2.3.0

type RelatedAssetResult struct {
	Message string `json:"message"`
	Code    string `json:"code"`
	Asset   string `json:"asset"`
	Status  int    `json:"status"`
}

type ReorderMetadataFieldDatasourceParams

type ReorderMetadataFieldDatasourceParams struct {
	FieldExternalID string       `json:"-"`
	FieldOrderBy    OrderByField `json:"order_by"`
	FieldDirection  Direction    `json:"direction,omitempty"`
}

ReorderMetadataFieldDatasourceParams are the parameters for ReorderMetadataFieldDatasource.

type ReorderMetadataFieldDatasourceResult

type ReorderMetadataFieldDatasourceResult struct {
	metadata.DataSource
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

ReorderMetadataFieldDatasourceResult is the result of ReorderMetadataFieldDatasource.

type ReorderMetadataFieldsParams

type ReorderMetadataFieldsParams struct {
	FieldOrderBy   OrderByField `json:"order_by"`
	FieldDirection Direction    `json:"direction,omitempty"`
}

ReorderMetadataFieldsParams are the parameters for ReorderMetadataFields.

type ReorderMetadataFieldsResult

type ReorderMetadataFieldsResult struct {
	MetadataFields []metadata.Field `json:"metadata_fields"`
	Error          api.ErrorResp    `json:"error,omitempty"`
	Response       interface{}
}

ReorderMetadataFieldsResult is the result of ReorderMetadataFields.

type RestoreAssetsParams

type RestoreAssetsParams struct {
	AssetType    api.AssetType    `json:"-"`
	DeliveryType api.DeliveryType `json:"-"`
	PublicIDs    api.CldAPIArray  `json:"public_ids"`
	Versions     api.CldAPIArray  `json:"versions"`
}

RestoreAssetsParams are the parameters for RestoreAssets.

type RestoreAssetsResult

type RestoreAssetsResult map[string]api.BriefAssetResult

RestoreAssetsResult is the result of RestoreAssets.

type RestoreDatasourceEntriesParams

type RestoreDatasourceEntriesParams struct {
	FieldExternalID    string   `json:"-"`
	EntriesExternalIDs []string `json:"external_ids"`
}

RestoreDatasourceEntriesParams are the parameters for RestoreDatasourceEntries.

type RestoreDatasourceEntriesResult

type RestoreDatasourceEntriesResult struct {
	metadata.DataSource
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

RestoreDatasourceEntriesResult is the result of RestoreDatasourceEntries.

type RootFoldersParams

type RootFoldersParams struct {
	MaxResults int    `json:"max_results,omitempty"`
	NextCursor string `json:"next_cursor,omitempty"`
}

RootFoldersParams are the parameters for RootFolders.

type SearchAsset

type SearchAsset struct {
	PublicID      string              `json:"public_id"`
	AssetID       string              `json:"asset_id"`
	Folder        string              `json:"folder"`
	AssetFolder   string              `json:"asset_folder"`
	Filename      string              `json:"filename"`
	DisplayName   string              `json:"display_name"`
	Format        string              `json:"format"`
	Version       int                 `json:"version"`
	ResourceType  string              `json:"resource_type"`
	Type          string              `json:"type"`
	CreatedAt     time.Time           `json:"created_at"`
	UploadedAt    time.Time           `json:"uploaded_at"`
	Bytes         int                 `json:"bytes"`
	BackupBytes   int                 `json:"backup_bytes"`
	Width         int                 `json:"width"`
	Height        int                 `json:"height"`
	AspectRatio   float64             `json:"aspect_ratio"`
	Pixels        int                 `json:"pixels"`
	Tags          []string            `json:"tags"`
	Context       ImageMetadataResult `json:"context"`
	ImageMetadata ImageMetadataResult `json:"image_metadata"`
	VideoMetadata MediaMetadataResult `json:"video_metadata"`
	ImageAnalysis ImageAnalysis       `json:"image_analysis"`
	URL           string              `json:"url"`
	SecureURL     string              `json:"secure_url"`
	Status        string              `json:"status"`
	AccessMode    string              `json:"access_mode"`
	AccessControl interface{}         `json:"access_control"`
	Etag          string              `json:"etag"`
	CreatedBy     SearchUser          `json:"created_by"`
	UploadedBy    SearchUser          `json:"uploaded_by"`
	LastUpdated   api.LastUpdated     `json:"last_updated"`
}

SearchAsset represents the details of a single asset that was found.

type SearchFolder added in v2.4.0

type SearchFolder struct {
	Name       string    `json:"name"`
	Path       string    `json:"path"`
	CreatedAt  time.Time `json:"created_at"`
	ExternalID string    `json:"external_id"`
}

SearchFolder represents the details of a single folder that was found.

type SearchFoldersResult added in v2.4.0

type SearchFoldersResult struct {
	TotalCount int            `json:"total_count"`
	Time       int            `json:"time"`
	Folders    []SearchFolder `json:"folders"`
	Error      api.ErrorResp  `json:"error,omitempty"`
	NextCursor string         `json:"next_cursor,omitempty"`
	Response   interface{}
}

SearchFoldersResult is the result of SearchFolders.

type SearchResult

type SearchResult struct {
	TotalCount int           `json:"total_count"`
	Time       int           `json:"time"`
	Assets     []SearchAsset `json:"resources"`
	Error      api.ErrorResp `json:"error,omitempty"`
	NextCursor string        `json:"next_cursor,omitempty"`
	Response   interface{}
}

SearchResult is the result of Search.

type SearchUser

type SearchUser struct {
	AccessKey string `json:"access_key"`
}

SearchUser contains details about the user.

type StreamingProfile

type StreamingProfile struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	Predefined  bool   `json:"predefined"`
}

StreamingProfile represents a single streaming profile.

type StreamingProfileDetails

type StreamingProfileDetails struct {
	Name            string                           `json:"name"`
	DisplayName     string                           `json:"display_name,omitempty"`
	Predefined      bool                             `json:"predefined"`
	Representations []StreamingProfileRepresentation `json:"representations,omitempty"`
}

StreamingProfileDetails represents the details of a streaming profile.

type StreamingProfileRepresentation

type StreamingProfileRepresentation struct {
	Transformation transformation.Transformation `json:"transformation"`
}

StreamingProfileRepresentation is a representation of a single streaming profile.

type StreamingProfileRepresentations

type StreamingProfileRepresentations []RawStreamingProfileRepresentation

StreamingProfileRepresentations contains multiple streaming profile representations.

func (StreamingProfileRepresentations) MarshalJSON

func (spRepresentations StreamingProfileRepresentations) MarshalJSON() ([]byte, error)

MarshalJSON serializes StreamingProfileRepresentations to a string of a json encoded array.

type SubFoldersParams

type SubFoldersParams struct {
	Folder     string `json:"-"`
	MaxResults int    `json:"max_results,omitempty"`
	NextCursor string `json:"next_cursor,omitempty"`
}

SubFoldersParams are the parameters for SubFolders.

type TagsParams

type TagsParams struct {
	AssetType  api.AssetType `json:"-"`                     // The type of asset.
	NextCursor string        `json:"next_cursor,omitempty"` // The cursor used for pagination.
	MaxResults int           `json:"max_results,omitempty"` // Maximum number of tags to return (up to 500). Default: 10.
	Prefix     string        `json:"prefix,omitempty"`      // Find all tags that start with the given prefix.
}

TagsParams are the parameters for Tags.

type TagsResult

type TagsResult struct {
	Tags       []string      `json:"tags"`
	NextCursor string        `json:"next_cursor"`
	Error      api.ErrorResp `json:"error,omitempty"`
	Response   interface{}
}

TagsResult is the result of Tags.

type TransformationListItem

type TransformationListItem struct {
	Name             string `json:"name"`
	AllowedForStrict bool   `json:"allowed_for_strict"`
	Used             bool   `json:"used"`
	Named            bool   `json:"named"`
}

TransformationListItem represents a single transformation.

type TransformationResult

type TransformationResult struct {
	Message string        `json:"message"`
	Error   api.ErrorResp `json:"error,omitempty"`
}

TransformationResult is the result of CreateTransformation, UpdateTransformation, DeleteTransformation.

type UpdateAssetParams

type UpdateAssetParams struct {
	AssetType         api.AssetType        `json:"-"`
	DeliveryType      api.DeliveryType     `json:"-"`
	PublicID          string               `json:"-"`
	AssetFolder       string               `json:"asset_folder,omitempty"`
	DisplayName       string               `json:"display_name,omitempty"`
	UniqueDisplayName *bool                `json:"unique_display_name,omitempty"`
	ModerationStatus  api.ModerationStatus `json:"moderation_status,omitempty"`
	RawConvert        string               `json:"raw_convert,omitempty"`
	OCR               string               `json:"ocr,omitempty"`
	Categorization    string               `json:"categorization,omitempty"`
	Detection         string               `json:"detection,omitempty"`
	SimilaritySearch  string               `json:"similarity_search,omitempty"`
	VisualSearch      *bool                `json:"visual_search,omitempty"`
	AutoTagging       float64              `json:"auto_tagging,omitempty"`
	BackgroundRemoval string               `json:"background_removal,omitempty"`
	QualityOverride   int                  `json:"quality_override,omitempty"`
	NotificationURL   string               `json:"notification_url,omitempty"`
	Tags              api.CldAPIArray      `json:"tags,omitempty,omitempty"`
	Context           api.CldAPIMap        `json:"context,omitempty"`
	FaceCoordinates   api.Coordinates      `json:"face_coordinates,omitempty"`
	CustomCoordinates api.Coordinates      `json:"custom_coordinates,omitempty"`
	AccessControl     interface{}          `json:"access_control,omitempty"`
}

UpdateAssetParams are the parameters for UpdateAsset.

type UpdateMetadataFieldDataSourceParams

type UpdateMetadataFieldDataSourceParams struct {
	metadata.DataSource
	FieldExternalID string `json:"-"`
}

UpdateMetadataFieldDataSourceParams are the parameters for UpdateMetadataFieldDataSource.

type UpdateMetadataFieldDataSourceResult

type UpdateMetadataFieldDataSourceResult struct {
	metadata.DataSource
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

UpdateMetadataFieldDataSourceResult is the result of UpdateMetadataFieldDataSource.

type UpdateMetadataFieldParams

type UpdateMetadataFieldParams struct {
	metadata.Field
	FieldExternalID string `json:"-"`
}

UpdateMetadataFieldParams are the parameters for UpdateMetadataField.

type UpdateMetadataFieldResult

type UpdateMetadataFieldResult struct {
	metadata.Field
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

UpdateMetadataFieldResult is the result of UpdateMetadataField.

type UpdateStreamingProfileParams

type UpdateStreamingProfileParams struct {
	Name            string                          `json:"-"` // The name of the streaming profile to update.
	DisplayName     string                          `json:"display_name,omitempty"`
	Representations StreamingProfileRepresentations `json:"representations"`
}

UpdateStreamingProfileParams are the parameters for UpdateStreamingProfile

type UpdateTransformationParams

type UpdateTransformationParams struct {
	Transformation   transformation.RawTransformation `json:"transformation"`
	AllowedForStrict *bool                            `json:"allowed_for_strict,omitempty"`
	UnsafeUpdate     transformation.RawTransformation `json:"unsafe_update,omitempty"`
}

UpdateTransformationParams are the parameters for UpdateTransformation.

type UpdateUploadMappingParams

type UpdateUploadMappingParams struct {
	Folder   string `json:"folder"` // The name of the upload mapping folder to remap.
	Template string `json:"template"`
}

UpdateUploadMappingParams are the parameters for UpdateUploadMapping.

type UpdateUploadPresetParams

type UpdateUploadPresetParams struct {
	Name             string `json:"name"`
	Unsigned         *bool  `json:"unsigned,omitempty"`
	DisallowPublicID *bool  `json:"disallow_public_id,omitempty"`
	Live             *bool  `json:"live,omitempty"`
	uploader.UploadParams
}

UpdateUploadPresetParams are the parameters for UpdateUploadPreset.

type UploadMapping

type UploadMapping struct {
	Folder   string `json:"folder"`
	Template string `json:"template"`
}

UploadMapping represents a single upload mapping.

type UploadMappingResult

type UploadMappingResult struct {
	Message string        `json:"message"`
	Error   api.ErrorResp `json:"error,omitempty"`
}

UploadMappingResult is the result of UpdateUploadMapping, DeleteUploadMapping.

type UploadPreset

type UploadPreset struct {
	Name     string      `json:"name"`
	Unsigned bool        `json:"unsigned"`
	Settings interface{} `json:"settings"`
}

UploadPreset represents the details of the upload preset.

type UploadPresetResult

type UploadPresetResult struct {
	Message string        `json:"message"`
	Error   api.ErrorResp `json:"error,omitempty"`
}

UploadPresetResult is the result of UpdateUploadPreset, DeleteUploadPreset.

type UsageParams

type UsageParams struct {
	Date time.Time `json:"-"`
}

UsageParams are the parameters for Usage.

type UsageResult

type UsageResult struct {
	Plan            string `json:"plan"`
	LastUpdated     string `json:"last_updated"`
	Transformations struct {
		Usage        int     `json:"usage"`
		CreditsUsage float64 `json:"credits_usage"`
		Limit        int     `json:"limit"`
		UsedPercent  float64 `json:"used_percent"`
	} `json:"transformations"`
	Objects struct {
		Usage       int     `json:"usage"`
		Limit       int     `json:"limit"`
		UsedPercent float64 `json:"used_percent"`
	} `json:"objects"`
	Bandwidth struct {
		Usage        int64   `json:"usage"`
		CreditsUsage float64 `json:"credits_usage"`
		Limit        int64   `json:"limit"`
		UsedPercent  float64 `json:"used_percent"`
	} `json:"bandwidth"`
	Storage struct {
		Usage        int64   `json:"usage"`
		CreditsUsage float64 `json:"credits_usage"`
		Limit        int64   `json:"limit"`
		UsedPercent  float64 `json:"used_percent"`
	} `json:"storage"`
	Credits struct {
		Usage float64 `json:"usage"`
	} `json:"credits"`
	Requests         int64 `json:"requests"`
	Resources        int   `json:"resources"`
	DerivedResources int   `json:"derived_resources"`
	MediaLimits      struct {
		ImageMaxSizeBytes int `json:"image_max_size_bytes"`
		VideoMaxSizeBytes int `json:"video_max_size_bytes"`
		RawMaxSizeBytes   int `json:"raw_max_size_bytes"`
		ImageMaxPx        int `json:"image_max_px"`
		AssetMaxTotalPx   int `json:"asset_max_total_px"`
	} `json:"media_limits"`
	Error    api.ErrorResp `json:"error,omitempty"`
	Response interface{}
}

UsageResult is the result of Usage.

type VisualSearchParams added in v2.4.0

type VisualSearchParams struct {
	ImageURL     string      `json:"image_url,omitempty"`
	ImageAssetID string      `json:"image_asset_id,omitempty"`
	Text         string      `json:"text,omitempty"`
	ImageFile    interface{} `json:"-"`
}

VisualSearchParams are the parameters for VisualSearch.

type VisualSearchResult added in v2.4.0

type VisualSearchResult struct {
	Assets     []api.BriefAssetResult `json:"resources"`
	TotalCount int                    `json:"total_count"`
	Error      api.ErrorResp          `json:"error,omitempty"`
}

Directories

Path Synopsis
Package metadata defines the structured metadata.
Package metadata defines the structured metadata.

Jump to

Keyboard shortcuts

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