CloudinaryDotNet icon indicating copy to clipboard operation
CloudinaryDotNet copied to clipboard

ListResourcesByPrefixParams - Mark ResourceType Enum as FLAG

Open nazarkryp opened this issue 1 year ago • 1 comments

Feature request for Cloudinary .NET SDK

Mark resourceType enum with flag so you could specify both images and videos

image

Explain your use case

Currently you have to do something like this to retrieve both images and photos:

var @params1 = new ListResourcesByPrefixParams
{
    ResourceType = ResourceType.Video,
    Type = "upload",
    Prefix = "SomeFolder",
};

var resources1 = await _cloudinary.ListResourcesAsync(@params1);

var @params2 = new ListResourcesByPrefixParams
{
    ResourceType = ResourceType.Image,
    Type = "upload",
    Prefix = "SomeFolder",
};

var resources2 = await _cloudinary.ListResourcesAsync(@params1);

var resources = resources1.Resources.Concat(resources2.Resources);

nazarkryp avatar Feb 28 '24 12:02 nazarkryp

@nazarkryp so that api has a default resource type of image for now and when looking for video/raw, you have to specify it.

however, you can use Search API as per https://cloudinary.com/documentation/admin_api#search_for_resources which will return all resource types of default unless specified

tommyg-cld avatar Feb 28 '24 12:02 tommyg-cld