@@ -41,13 +41,15 @@ public class SearchOptions
4141 /// Only supported for active file search.</param>
4242 /// <param name="fileCategories">Restricts search to only the file categories
4343 /// specified. Only supported for active file search.</param>
44+ /// <param name="accountId">Restricts results to the given account id.</param>
4445 public SearchOptions ( string path = null ,
4546 ulong maxResults = 100 ,
4647 SearchOrderBy orderBy = null ,
4748 FileStatus fileStatus = null ,
4849 bool filenameOnly = false ,
4950 col . IEnumerable < string > fileExtensions = null ,
50- col . IEnumerable < FileCategory > fileCategories = null )
51+ col . IEnumerable < FileCategory > fileCategories = null ,
52+ string accountId = null )
5153 {
5254 if ( path != null )
5355 {
@@ -74,13 +76,26 @@ public SearchOptions(string path = null,
7476
7577 var fileCategoriesList = enc . Util . ToList ( fileCategories ) ;
7678
79+ if ( accountId != null )
80+ {
81+ if ( accountId . Length < 40 )
82+ {
83+ throw new sys . ArgumentOutOfRangeException ( "accountId" , "Length should be at least 40" ) ;
84+ }
85+ if ( accountId . Length > 40 )
86+ {
87+ throw new sys . ArgumentOutOfRangeException ( "accountId" , "Length should be at most 40" ) ;
88+ }
89+ }
90+
7791 this . Path = path ;
7892 this . MaxResults = maxResults ;
7993 this . OrderBy = orderBy ;
8094 this . FileStatus = fileStatus ;
8195 this . FilenameOnly = filenameOnly ;
8296 this . FileExtensions = fileExtensionsList ;
8397 this . FileCategories = fileCategoriesList ;
98+ this . AccountId = accountId ;
8499 }
85100
86101 /// <summary>
@@ -135,6 +150,11 @@ public SearchOptions()
135150 /// </summary>
136151 public col . IList < FileCategory > FileCategories { get ; protected set ; }
137152
153+ /// <summary>
154+ /// <para>Restricts results to the given account id.</para>
155+ /// </summary>
156+ public string AccountId { get ; protected set ; }
157+
138158 #region Encoder class
139159
140160 /// <summary>
@@ -168,6 +188,10 @@ public override void EncodeFields(SearchOptions value, enc.IJsonWriter writer)
168188 {
169189 WriteListProperty ( "file_categories" , value . FileCategories , writer , global ::Dropbox . Api . Files . FileCategory . Encoder ) ;
170190 }
191+ if ( value . AccountId != null )
192+ {
193+ WriteProperty ( "account_id" , value . AccountId , writer , enc . StringEncoder . Instance ) ;
194+ }
171195 }
172196 }
173197
@@ -221,6 +245,9 @@ protected override void SetField(SearchOptions value, string fieldName, enc.IJso
221245 case "file_categories" :
222246 value . FileCategories = ReadList < FileCategory > ( reader , global ::Dropbox . Api . Files . FileCategory . Decoder ) ;
223247 break ;
248+ case "account_id" :
249+ value . AccountId = enc . StringDecoder . Instance . Decode ( reader ) ;
250+ break ;
224251 default :
225252 reader . Skip ( ) ;
226253 break ;
0 commit comments