This class describes a set of search parameters. While it is not required to use this class when constructing a search, it can be useful, as it provides some degree of immediate parameter validation, as well as a convenient way to manipulate and handle search options in general.
Specific search parameters are handled as object attributes. Attempting to add an attribute that is not supported will raise a KeyError. Attempting to delete an attribute will result in it being set to None. Search parameters can be set via kwargs at object instantion, or directly on an existing object using the normal mechanisms.
Converting to a
dict will only include search options which have actually been set to a usable value. That is, any options set to
None will be ignored.
ASFSearchOptions does not provide any methods intended for direct use, instead relying on a handful of dunders for the desired behavior. For clarity, these are included below.
Establishes the various attributes described above and processes any kwargs into them.
- **kwargs, limited to names listed as attributes above. Anything else will raise a
Sets the attribute named by
key to the specified
value after passing it through an appropriate validator function.
None are allowed as a way to un-set the attribute. Attempting to set a
key not listed in the above attribute list will raise a
- key: the name of the attribute to set
- value: the value to which the named attribute should be set
Clears an attribute names by
item by way of setting it to
- item: the name of the attribute to be cleared
Used when converting the ASFSearchOptions object to more fundamental objects, such as
Only includes attributes that are not
- (key, value) pairs for each of the above attributes that are not