@@ -10,6 +10,7 @@ namespace CloudinaryDotNet.Actions
1010 public class ArchiveParams : BaseParams
1111 {
1212 private List < string > m_publicIds ;
13+ private List < string > m_fullyQualifiedPublicIds ;
1314 private List < string > m_tags ;
1415 private List < string > m_prefixes ;
1516
@@ -48,6 +49,23 @@ public ArchiveParams PublicIds(List<string> publicIds)
4849 return this ;
4950 }
5051
52+ /// <summary>
53+ /// Get a list of Fully Qualified Public IDs for the specific assets to be included in the archive
54+ /// </summary>
55+ public List < string > FullyQualifiedPublicIds ( )
56+ {
57+ return m_fullyQualifiedPublicIds ;
58+ }
59+
60+ /// <summary>
61+ /// Set a list of Fully Qualified Public IDs for the specific assets to be included in the archive
62+ /// </summary>
63+ public ArchiveParams FullyQualifiedPublicIds ( List < string > fullyQualifiedPublicIds )
64+ {
65+ m_fullyQualifiedPublicIds = fullyQualifiedPublicIds ;
66+ return this ;
67+ }
68+
5169 /// <summary>
5270 /// Get a list of tag names. All images with this tag(s) will be included in the archive
5371 /// </summary>
@@ -83,19 +101,29 @@ public ArchiveParams Prefixes(List<string> prefixes)
83101 return this ;
84102 }
85103
104+ /// <inheritdoc />
86105 /// <summary>
87106 /// Validate object model
88107 /// </summary>
89108 public override void Check ( )
90109 {
91- if ( ( m_publicIds == null || m_publicIds . Count == 0 ) &&
92- ( m_prefixes == null || m_prefixes . Count == 0 ) &&
93- ( m_tags == null || m_tags . Count == 0 ) )
94- throw new ArgumentException ( "At least one of the following \" filtering\" parameters needs to be specified: PublicIds, Tags or Prefixes." ) ;
110+ if ( m_publicIds ? . Any ( ) != true &&
111+ m_fullyQualifiedPublicIds ? . Any ( ) != true &&
112+ m_prefixes ? . Any ( ) != true &&
113+ m_tags ? . Any ( ) != true )
114+ throw new ArgumentException ( "At least one of the following \" filtering\" parameters needs " +
115+ "to be specified: PublicIds, FullyQualifiedPublicIds, Tags or Prefixes." ) ;
116+
117+ if ( m_resourceType == "auto" ^ ( m_fullyQualifiedPublicIds ? . Any ( ) ?? false ) )
118+ {
119+ throw new ArgumentException (
120+ "To create an archive with multiple types of assets, you must set ResourceType to \" auto\" " +
121+ "and provide FullyQualifiedPublicIds (For example, 'video/upload/my_video.mp4')" ) ;
122+ }
95123 }
96124
97125 /// <summary>
98- /// Get Mode whether to return the generated archive file (download)
126+ /// Get Mode whether to return the generated archive file (download)
99127 /// or to store it as a raw resource (create)
100128 /// </summary>
101129 public virtual ArchiveCallMode Mode ( )
@@ -104,7 +132,7 @@ public virtual ArchiveCallMode Mode()
104132 }
105133
106134 /// <summary>
107- /// Determines whether to return the generated archive file (download)
135+ /// Determines whether to return the generated archive file (download)
108136 /// or to store it as a raw resource in your Cloudinary account and return a JSON with the URLs for accessing the archive file (create)
109137 /// </summary>
110138 /// <param name="mode"></param>
@@ -246,7 +274,7 @@ public int ExpiresAt()
246274 }
247275
248276 /// <summary>
249- /// Set the Unix time in seconds when the generated download URL expires (e.g., 1415060076).
277+ /// Set the Unix time in seconds when the generated download URL expires (e.g., 1415060076).
250278 /// If this parameter is omitted then the generated download URL expires after 1 hour.
251279 /// Note: Relevant only for download call.
252280 /// </summary>
@@ -382,6 +410,9 @@ public override SortedDictionary<string, object> ToParamsDictionary()
382410 if ( m_publicIds != null && m_publicIds . Count > 0 )
383411 AddParam ( dict , "public_ids" , m_publicIds ) ;
384412
413+ if ( m_fullyQualifiedPublicIds != null && m_fullyQualifiedPublicIds . Count > 0 )
414+ AddParam ( dict , "fully_qualified_public_ids" , m_fullyQualifiedPublicIds ) ;
415+
385416 if ( m_prefixes != null && m_prefixes . Count > 0 )
386417 AddParam ( dict , "prefixes" , m_prefixes ) ;
387418
0 commit comments