DBFILESSearchOptions

Objective-C

@interface DBFILESSearchOptions : NSObject <DBSerializable, NSCopying>

Swift

class DBFILESSearchOptions : NSObject, DBSerializable, NSCopying

The SearchOptions struct.

This class implements the DBSerializable protocol (serialize and deserialize instance methods), which is required for all Obj-C SDK API route objects.

Instance fields

  • Scopes the search to a path in the user’s Dropbox. Searches the entire Dropbox if not specified.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *path;

    Swift

    var path: String? { get }
  • The maximum number of search results to return.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSNumber *_Nonnull maxResults;

    Swift

    var maxResults: NSNumber { get }
  • Specified property of the order of search results. By default, results are sorted by relevance.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) DBFILESSearchOrderBy *orderBy;

    Swift

    var orderBy: DBFILESSearchOrderBy? { get }
  • Restricts search to the given file status.

    Declaration

    Objective-C

    @property (nonatomic, readonly) DBFILESFileStatus *_Nonnull fileStatus;

    Swift

    var fileStatus: DBFILESFileStatus { get }
  • Restricts search to only match on filenames.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSNumber *_Nonnull filenameOnly;

    Swift

    var filenameOnly: NSNumber { get }
  • Restricts search to only the extensions specified. Only supported for active file search.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSArray<NSString *> *fileExtensions;

    Swift

    var fileExtensions: [String]? { get }
  • Restricts search to only the file categories specified. Only supported for active file search.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSArray<DBFILESFileCategory *> *fileCategories;

    Swift

    var fileCategories: [DBFILESFileCategory]? { get }
  • Restricts results to the given account id.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *accountId;

    Swift

    var accountId: String? { get }

Constructors

  • Full constructor for the struct (exposes all instance variables).

    Declaration

    Objective-C

    - (nonnull instancetype)
          initWithPath:(nullable NSString *)path
            maxResults:(nullable NSNumber *)maxResults
               orderBy:(nullable DBFILESSearchOrderBy *)orderBy
            fileStatus:(nullable DBFILESFileStatus *)fileStatus
          filenameOnly:(nullable NSNumber *)filenameOnly
        fileExtensions:(nullable NSArray<NSString *> *)fileExtensions
        fileCategories:(nullable NSArray<DBFILESFileCategory *> *)fileCategories
             accountId:(nullable NSString *)accountId;

    Swift

    init(path: String?, maxResults: NSNumber?, orderBy: DBFILESSearchOrderBy?, fileStatus: DBFILESFileStatus?, filenameOnly: NSNumber?, fileExtensions: [String]?, fileCategories: [DBFILESFileCategory]?, accountId: String?)

    Parameters

    path

    Scopes the search to a path in the user’s Dropbox. Searches the entire Dropbox if not specified.

    maxResults

    The maximum number of search results to return.

    orderBy

    Specified property of the order of search results. By default, results are sorted by relevance.

    fileStatus

    Restricts search to the given file status.

    filenameOnly

    Restricts search to only match on filenames.

    fileExtensions

    Restricts search to only the extensions specified. Only supported for active file search.

    fileCategories

    Restricts search to only the file categories specified. Only supported for active file search.

    accountId

    Restricts results to the given account id.

    Return Value

    An initialized instance.

  • Convenience constructor (exposes only non-nullable instance variables with no default value).

    Declaration

    Objective-C

    - (nonnull instancetype)initDefault;

    Swift

    init(default: ())

    Return Value

    An initialized instance.