Documentation ¶
Overview ¶
Package admin is used for accessing Cloudinary Admin API functionality.
Index ¶
- Constants
- type AccessibilityAnalysisResult
- type AddMetadataFieldResult
- type Aggregation
- type Api
- func (a *Api) AddMetadataField(ctx context.Context, params metadata.Field) (*AddMetadataFieldResult, error)
- func (a *Api) Asset(ctx context.Context, params AssetParams) (*AssetResult, error)
- func (a *Api) AssetTypes(ctx context.Context) (*AssetTypesResult, error)
- func (a *Api) Assets(ctx context.Context, params AssetsParams) (*AssetsResult, error)
- func (a *Api) AssetsByContext(ctx context.Context, params AssetsByContextParams) (*AssetsResult, error)
- func (a *Api) AssetsByIDs(ctx context.Context, params AssetsByIDsParams) (*AssetsResult, error)
- func (a *Api) AssetsByModeration(ctx context.Context, params AssetsByModerationParams) (*AssetsResult, error)
- func (a *Api) AssetsByTag(ctx context.Context, params AssetsByTagParams) (*AssetsResult, error)
- func (a *Api) CreateFolder(ctx context.Context, params CreateFolderParams) (*CreateFolderResult, error)
- func (a *Api) CreateStreamingProfile(ctx context.Context, params CreateStreamingProfileParams) (*GetStreamingProfileResult, error)
- func (a *Api) CreateTransformation(ctx context.Context, params CreateTransformationParams) (*TransformationResult, error)
- func (a *Api) CreateUploadMapping(ctx context.Context, params CreateUploadMappingParams) (*CreateUploadMappingResult, error)
- func (a *Api) CreateUploadPreset(ctx context.Context, params CreateUploadPresetParams) (*CreateUploadPresetResult, error)
- func (a *Api) DeleteAllAssets(ctx context.Context, params DeleteAllAssetsParams) (*DeleteAssetsResult, error)
- func (a *Api) DeleteAssets(ctx context.Context, params DeleteAssetsParams) (*DeleteAssetsResult, error)
- func (a *Api) DeleteAssetsByPrefix(ctx context.Context, params DeleteAssetsByPrefixParams) (*DeleteAssetsResult, error)
- func (a *Api) DeleteAssetsByTag(ctx context.Context, params DeleteAssetsByTagParams) (*DeleteAssetsResult, error)
- func (a *Api) DeleteDataSourceEntries(ctx context.Context, params DeleteDataSourceEntriesParams) (*DeleteDataSourceEntriesResult, error)
- func (a *Api) DeleteDerivedAssets(ctx context.Context, params DeleteDerivedAssetsParams) (*DeleteAssetsResult, error)
- func (a *Api) DeleteDerivedAssetsByTransformation(ctx context.Context, params DeleteDerivedAssetsByTransformationParams) (*DeleteAssetsResult, error)
- func (a *Api) DeleteFolder(ctx context.Context, params DeleteFolderParams) (*DeleteFolderResult, error)
- func (a *Api) DeleteMetadataField(ctx context.Context, params DeleteMetadataFieldParams) (*DeleteMetadataFieldResult, error)
- func (a *Api) DeleteStreamingProfile(ctx context.Context, params DeleteStreamingProfileParams) (*DeleteStreamingProfileResult, error)
- func (a *Api) DeleteTransformation(ctx context.Context, params DeleteTransformationParams) (*TransformationResult, error)
- func (a *Api) DeleteUploadMapping(ctx context.Context, params DeleteUploadMappingParams) (*UploadMappingResult, error)
- func (a *Api) DeleteUploadPreset(ctx context.Context, params DeleteUploadPresetParams) (*UploadPresetResult, error)
- func (a *Api) GetStreamingProfile(ctx context.Context, params GetStreamingProfileParams) (*GetStreamingProfileResult, error)
- func (a *Api) GetTransformation(ctx context.Context, params GetTransformationParams) (*GetTransformationResult, error)
- func (a *Api) GetUploadMapping(ctx context.Context, params GetUploadMappingParams) (*GetUploadMappingResult, error)
- func (a *Api) GetUploadPreset(ctx context.Context, params GetUploadPresetParams) (*GetUploadPresetResult, error)
- func (a *Api) ListMetadataFields(ctx context.Context) (*ListMetadataFieldsResult, error)
- func (a *Api) ListStreamingProfiles(ctx context.Context) (*ListStreamingProfilesResult, error)
- func (a *Api) ListTransformations(ctx context.Context, params ListTransformationsParams) (*ListTransformationsResult, error)
- func (a *Api) ListUploadMappings(ctx context.Context, params ListUploadMappingsParams) (*ListUploadMappingsResult, error)
- func (a *Api) ListUploadPresets(ctx context.Context, params ListUploadPresetsParams) (*ListUploadPresetsResult, error)
- func (a *Api) MetadataFieldByFieldId(ctx context.Context, params MetadataFieldByFieldIdParams) (*MetadataFieldByFieldIdResult, error)
- func (a *Api) Ping(ctx context.Context) (*PingResult, error)
- func (a *Api) RestoreAssets(ctx context.Context, params RestoreAssetsParams) (*RestoreAssetsResult, error)
- func (a *Api) RestoreDatasourceEntries(ctx context.Context, params RestoreDatasourceEntriesParams) (*RestoreDatasourceEntriesResult, error)
- func (a *Api) RootFolders(ctx context.Context, params RootFoldersParams) (*FoldersResult, error)
- func (a *Api) Search(ctx context.Context, searchQuery SearchQuery) (*SearchResult, error)
- func (a *Api) SubFolders(ctx context.Context, params SubFoldersParams) (*FoldersResult, error)
- func (a *Api) Tags(ctx context.Context, params TagsParams) (*TagsResult, error)
- func (a *Api) UpdateAsset(ctx context.Context, params UpdateAssetParams) (*AssetResult, error)
- func (a *Api) UpdateMetadataField(ctx context.Context, params UpdateMetadataFieldParams) (*UpdateMetadataFieldResult, error)
- func (a *Api) UpdateMetadataFieldDataSource(ctx context.Context, params UpdateMetadataFieldDataSourceParams) (*UpdateMetadataFieldDataSourceResult, error)
- func (a *Api) UpdateStreamingProfile(ctx context.Context, params UpdateStreamingProfileParams) (*GetStreamingProfileResult, error)
- func (a *Api) UpdateTransformation(ctx context.Context, params UpdateTransformationParams) (*TransformationResult, error)
- func (a *Api) UpdateUploadMapping(ctx context.Context, params UpdateUploadMappingParams) (*UploadMappingResult, error)
- func (a *Api) UpdateUploadPreset(ctx context.Context, params UpdateUploadPresetParams) (*UploadPresetResult, error)
- func (a *Api) Usage(ctx context.Context, params UsageParams) (*UsageResult, error)
- type AssetParams
- type AssetResult
- type AssetTypesResult
- type AssetsByContextParams
- type AssetsByIDsParams
- type AssetsByModerationParams
- type AssetsByTagParams
- type AssetsParams
- type AssetsResult
- type CinemagraphAnalysisResult
- type CreateFolderParams
- type CreateFolderResult
- type CreateStreamingProfileParams
- type CreateTransformationParams
- type CreateUploadMappingParams
- type CreateUploadMappingResult
- type CreateUploadPresetParams
- type CreateUploadPresetResult
- type DeleteAllAssetsParams
- type DeleteAssetsByPrefixParams
- type DeleteAssetsByTagParams
- type DeleteAssetsParams
- type DeleteAssetsResult
- type DeleteDataSourceEntriesParams
- type DeleteDataSourceEntriesResult
- type DeleteDerivedAssetsByTransformationParams
- type DeleteDerivedAssetsParams
- type DeleteFolderParams
- type DeleteFolderResult
- type DeleteMetadataFieldParams
- type DeleteMetadataFieldResult
- type DeleteStreamingProfileParams
- type DeleteStreamingProfileResult
- type DeleteTransformationParams
- type DeleteUploadMappingParams
- type DeleteUploadPresetParams
- type DerivedAsset
- type Direction
- type FolderResult
- type FoldersResult
- type GetStreamingProfileParams
- type GetStreamingProfileResult
- type GetTransformationParams
- type GetTransformationResult
- type GetUploadMappingParams
- type GetUploadMappingResult
- type GetUploadPresetParams
- type GetUploadPresetResult
- type ImageAnalysis
- type ImageMetadataResult
- type ListMetadataFieldsResult
- type ListStreamingProfilesResult
- type ListTransformationsParams
- type ListTransformationsResult
- type ListUploadMappingsParams
- type ListUploadMappingsResult
- type ListUploadPresetsParams
- type ListUploadPresetsResult
- type MetadataFieldByFieldIdParams
- type MetadataFieldByFieldIdResult
- type PingResult
- type PredominantResult
- type QualityAnalysisResult
- type RawStreamingProfileRepresentation
- type RestoreAssetsParams
- type RestoreAssetsResult
- type RestoreDatasourceEntriesParams
- type RestoreDatasourceEntriesResult
- type RootFoldersParams
- type Search
- func (s *Search) Aggregate(aggregation Aggregation) *Search
- func (s *Search) Expression(expression string) *Search
- func (s *Search) GetQuery() SearchQuery
- func (s *Search) MaxResults(maxResults int) *Search
- func (s *Search) NextCursor(nextCursor string) *Search
- func (s *Search) SortBy(fieldName string, direction Direction) *Search
- func (s *Search) WithField(field WithField) *Search
- type SearchAsset
- type SearchQuery
- type SearchResult
- type SearchUser
- type SortByField
- type StreamingProfile
- type StreamingProfileDetails
- type StreamingProfileRepresentation
- type StreamingProfileRepresentations
- type SubFoldersParams
- type TagsParams
- type TagsResult
- type TransformationListItem
- type TransformationResult
- type UpdateAssetParams
- type UpdateMetadataFieldDataSourceParams
- type UpdateMetadataFieldDataSourceResult
- type UpdateMetadataFieldParams
- type UpdateMetadataFieldResult
- type UpdateStreamingProfileParams
- type UpdateTransformationParams
- type UpdateUploadMappingParams
- type UpdateUploadPresetParams
- type UploadMapping
- type UploadMappingResult
- type UploadPreset
- type UploadPresetResult
- type UsageParams
- type UsageResult
- type WithField
Constants ¶
const ( Assets api.EndPoint = "resources" DerivedAssets api.EndPoint = "derived_resources" Tags api.EndPoint = "tags" Context api.EndPoint = "context" Moderations api.EndPoint = "moderations" Restore api.EndPoint = "restore" )
const ( MetadataFields api.EndPoint = "metadata_fields" DataSource api.EndPoint = "datasource" DataSourceRestore api.EndPoint = "datasource_restore" )
const ( Ping api.EndPoint = "ping" Usage api.EndPoint = "usage" )
const ( AssetType Aggregation = "resource_type" DeliveryType = "type" // Pixels only the image assets in the response are aggregated. Pixels = "pixels" // Duration only the video assets in the response are aggregated. Duration = "duration" Format = "format" Bytes = "bytes" )
const ( ContextField WithField = "context" TagsField = "tags" ImageMetadataField = "image_metadata" ImageAnalysisField = "image_analysis" )
const (
Folders api.EndPoint = "folders"
)
const SearchEndPoint api.EndPoint = "resources/search"
const (
StreamingProfiles api.EndPoint = "streaming_profiles"
)
const (
Transformations api.EndPoint = "transformations"
)
const (
UploadMappings api.EndPoint = "upload_mappings"
)
const (
UploadPresets api.EndPoint = "upload_presets"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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"` }
type AddMetadataFieldResult ¶
type Aggregation ¶
type Aggregation string
type Api ¶
type Api struct { Config config.Configuration // contains filtered or unexported fields }
func Create ¶
Create creates a new Admin Api instance from the environment variable (CLOUDINARY_URL).
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) Asset ¶
func (a *Api) Asset(ctx context.Context, params AssetParams) (*AssetResult, error)
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) 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) AssetsByContext ¶
func (a *Api) AssetsByContext(ctx context.Context, params AssetsByContextParams) (*AssetsResult, error)
AssetsByContext sists 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) 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.
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 SearchQuery) (*SearchResult, error)
Search executes the search 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.
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.
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"` 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"` }
type AssetResult ¶
type AssetResult struct { AssetID string `json:"asset_id"` PublicID string `json:"public_id"` Format string `json:"format"` 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"` NextCursor string `json:"next_cursor"` Derived []interface{} `json:"derived"` Etag string `json:"etag"` ImageMetadata ImageMetadataResult `json:"image_metadata"` Coordinates struct{} `json:"coordinates"` Exif struct{} `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 struct{} `json:"usage"` OriginalFilename string `json:"original_filename"` Error api.ErrorResp `json:"error,omitempty"` }
type AssetTypesResult ¶
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"` }
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"` }
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"` }
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"` }
type AssetsParams ¶
type AssetsParams struct { AssetType api.AssetType `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"` }
type AssetsResult ¶
type AssetsResult struct { Assets []api.BriefAssetResult `json:"resources"` NextCursor string `json:"next_cursor"` Error api.ErrorResp `json:"error,omitempty"` }
type CinemagraphAnalysisResult ¶
type CinemagraphAnalysisResult struct {
CinemagraphScore float64 `json:"cinemagraph_score"`
}
type CreateFolderParams ¶
type CreateFolderParams struct {
Folder string `json:"-"` // The full path of the new folder to create.
}
type CreateFolderResult ¶
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"` }
type CreateTransformationParams ¶
type CreateTransformationParams struct { Name string `json:"name"` Transformation transformation.RawTransformation `json:"transformation"` }
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"` }
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"` }
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"` }
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"` }
type DeleteAssetsResult ¶
type DeleteDataSourceEntriesResult ¶
type DeleteDataSourceEntriesResult struct { metadata.DataSource Error api.ErrorResp `json:"error,omitempty"` Response interface{} }
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"` }
type DeleteDerivedAssetsParams ¶
type DeleteDerivedAssetsParams struct {
DerivedAssetIDs api.CldApiArray `json:"derived_resource_ids"`
}
type DeleteFolderParams ¶
type DeleteFolderParams struct {
Folder string `json:"-"` // The full path of the empty folder to delete.
}
type DeleteFolderResult ¶
type DeleteMetadataFieldParams ¶
type DeleteMetadataFieldParams struct {
FieldExternalId string `json:"-"`
}
type DeleteStreamingProfileParams ¶
type DeleteStreamingProfileParams struct {
Name string `json:"-"` // The name of the streaming profile to delete or revert.
}
type DeleteTransformationParams ¶
type DeleteTransformationParams struct {
Transformation transformation.RawTransformation `json:"transformation"`
}
type DeleteUploadMappingParams ¶
type DeleteUploadMappingParams struct {
Folder string `json:"folder"` // The name of the upload mapping folder to delete.
}
type DeleteUploadPresetParams ¶
type DeleteUploadPresetParams struct {
Name string `json:"-"`
}
type DerivedAsset ¶
type FolderResult ¶
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"` }
type GetStreamingProfileParams ¶
type GetStreamingProfileParams struct {
Name string `json:"-"`
}
type GetStreamingProfileResult ¶
type GetStreamingProfileResult struct { Data StreamingProfileDetails `json:"data"` Error api.ErrorResp `json:"error,omitempty"` }
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"` }
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"` Error api.ErrorResp `json:"error,omitempty"` }
type GetUploadMappingParams ¶
type GetUploadMappingParams struct {
Folder string `json:"folder"` // The name of the upload mapping folder.
}
type GetUploadMappingResult ¶
type GetUploadPresetParams ¶
type GetUploadPresetResult ¶
type ImageAnalysis ¶
type ImageMetadataResult ¶
type ListStreamingProfilesResult ¶
type ListStreamingProfilesResult struct { Data []StreamingProfile `json:"data"` Error api.ErrorResp `json:"error,omitempty"` }
type ListTransformationsResult ¶
type ListTransformationsResult struct { Transformations []TransformationListItem `json:"transformations"` Error api.ErrorResp `json:"error,omitempty"` }
type ListUploadMappingsResult ¶
type ListUploadMappingsResult struct { Mappings []UploadMapping `json:"mappings"` Error api.ErrorResp `json:"error,omitempty"` }
type ListUploadPresetsParams ¶
type ListUploadPresetsResult ¶
type ListUploadPresetsResult struct { Presets []UploadPreset `json:"presets"` Error api.ErrorResp `json:"error,omitempty"` }
type MetadataFieldByFieldIdParams ¶
type MetadataFieldByFieldIdParams struct {
FieldExternalId string `json:"-"`
}
type PingResult ¶
type PredominantResult ¶
type PredominantResult struct { Google [][]interface{} `json:"google"` Cloudinary [][]interface{} `json:"cloudinary"` }
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"` }
type RawStreamingProfileRepresentation ¶
type RawStreamingProfileRepresentation struct {
Transformation transformation.RawTransformation `json:"transformation"`
}
type RestoreAssetsParams ¶
type RestoreAssetsParams struct { AssetType api.AssetType `json:"-"` DeliveryType api.DeliveryType `json:"-"` PublicIDs api.CldApiArray `json:"public_ids"` Versions api.CldApiArray `json:"versions"` }
type RestoreAssetsResult ¶
type RestoreAssetsResult map[string]api.BriefAssetResult
type RestoreDatasourceEntriesResult ¶
type RestoreDatasourceEntriesResult struct { metadata.DataSource Error api.ErrorResp `json:"error,omitempty"` Response interface{} }
type RootFoldersParams ¶
type Search ¶
type Search struct {
// contains filtered or unexported fields
}
func (*Search) Aggregate ¶
func (s *Search) Aggregate(aggregation Aggregation) *Search
Aggregate sets the name of a field (attribute) for which an aggregation count should be calculated and returned in the response.
func (*Search) Expression ¶
Expression sets the query string for filtering the assets in your account.
func (*Search) MaxResults ¶
MaxResults sets the maximum number of results to return.
func (*Search) NextCursor ¶
NextCursor sets the next cursor.
type SearchAsset ¶
type SearchAsset struct { PublicID string `json:"public_id"` Folder string `json:"folder"` Filename string `json:"filename"` 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"` ImageMetadata ImageMetadataResult `json:"image_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"` }
type SearchQuery ¶
type SearchQuery struct { // Expression is the (Lucene-like) string expression specifying the search query. // If not provided then all resources are listed (up to MaxResults). Expression string `json:"expression,omitempty"` // SortBy is the the field to sort by. You can specify more than one SortBy parameter; results will be sorted // according to the order of the fields provided. SortBy []SortByField `json:"sort_by,omitempty"` // Aggregate is the the name of a field (attribute) for which an aggregation count should be calculated and returned in the response. // (Tier 2 only) // You can specify more than one aggregate parameter. // For aggregation fields without discrete values, the results are divided into categories. Aggregate []Aggregation `json:"aggregate,omitempty"` //WithField contains names of additional asset attributes to include for each asset in the response. WithField []WithField `json:"with_field,omitempty"` // MaxResults is the maximum number of results to return. Default 50. Maximum 500. MaxResults int `json:"max_results,omitempty"` // NextCursor value is returned as part of the response when a search request has more results to return than MaxResults. // You can then specify this value as the NextCursor parameter of the following request. NextCursor string `json:"next_cursor,omitempty"` }
SearchQuery struct includes the search query.
type SearchResult ¶
type SearchResult struct { TotalCount int `json:"total_count"` Time int `json:"time"` Assets []SearchAsset `json:"resources"` Error api.ErrorResp `json:"error,omitempty"` }
type SearchUser ¶
type SearchUser struct {
AccessKey string `json:"access_key"`
}
type SortByField ¶
type StreamingProfile ¶
type StreamingProfileDetails ¶
type StreamingProfileDetails struct { Name string `json:"name"` DisplayName string `json:"display_name,omitempty"` Predefined bool `json:"predefined"` Representations []StreamingProfileRepresentation `json:"representations,omitempty"` }
type StreamingProfileRepresentation ¶
type StreamingProfileRepresentation struct {
Transformation transformation.Transformation `json:"transformation"`
}
type StreamingProfileRepresentations ¶
type StreamingProfileRepresentations []RawStreamingProfileRepresentation
func (StreamingProfileRepresentations) MarshalJSON ¶
func (sprs StreamingProfileRepresentations) MarshalJSON() ([]byte, error)
Server expects to get a string of a json encoded array
type SubFoldersParams ¶
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. }
type TagsResult ¶
type TransformationListItem ¶
type TransformationResult ¶
type UpdateAssetParams ¶
type UpdateAssetParams struct { AssetType api.AssetType `json:"-"` DeliveryType api.DeliveryType `json:"-"` PublicID string `json:"-"` 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"` 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"` }
type UpdateMetadataFieldDataSourceParams ¶
type UpdateMetadataFieldDataSourceParams struct { metadata.DataSource FieldExternalId string `json:"-"` }
type UpdateMetadataFieldDataSourceResult ¶
type UpdateMetadataFieldDataSourceResult struct { metadata.DataSource Error api.ErrorResp `json:"error,omitempty"` Response interface{} }
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"` }
type UpdateTransformationParams ¶
type UpdateTransformationParams struct { Transformation transformation.RawTransformation `json:"transformation"` AllowedForStrict bool `json:"allowed_for_strict,omitempty"` UnsafeUpdate transformation.RawTransformation `json:"unsafe_update,omitempty"` }
type UploadMapping ¶
type UploadMappingResult ¶
type UploadPreset ¶
type UploadPresetResult ¶
type UsageParams ¶
type UsageResult ¶
type UsageResult struct { Plan string `json:"plan"` LastUpdated string `json:"last_updated"` Transformations struct { Usage int `json:"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"` Limit int64 `json:"limit"` UsedPercent float64 `json:"used_percent"` } `json:"bandwidth"` Storage struct { Usage int64 `json:"usage"` Limit int64 `json:"limit"` UsedPercent float64 `json:"used_percent"` } `json:"storage"` 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{} }