cloudinary / CloudinaryDotNet

Cloudinary DotNet library
MIT License
102 stars 68 forks source link

ListResourcesByPrefixParams - Mark ResourceType Enum as FLAG #362

Open nazarkryp opened 6 months ago

nazarkryp commented 6 months ago

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);
tommyg-cld commented 6 months ago

@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