AWFRequestOptions Class Reference

Inherits from NSObject
Conforms to NSCopying
Declared in AWFRequestOptions.h

Overview

An AWFRequesetOptions object represents all of the supported options that can be passed to an API request through object loaders. This is a convenience class that will properly format parameters as required by the API before the request is actually initiated.

  place

The place to use for the request. This corresponds to the AerisAPIParamKeyPlace, or p, parameter when accessing the API directly.

@property (nonatomic, strong) AWFPlace *place

Declared In

AWFRequestOptions.h

  boundsString

A string of comma-separated latitude/longitude coordinates defining a bounding region. This corresponds to the AerisAPIParamKeyPlace, or p, parameter when accessing the API directly and using a coordinate region instead of a single place.

@property (nonatomic, copy) NSString *boundsString

Declared In

AWFRequestOptions.h

  limit

The maximum number of objects to return. This corresponds to the AerisAPIParamKeyLimit, or limit, parameter when accessing the API directly.

@property (nonatomic, assign) NSUInteger limit

Declared In

AWFRequestOptions.h

  skip

The number of items to skip from the expected data set. This corresponds to the AerisAPIParamKeySkip, or skip, parameter when accessing the API directly.

@property (nonatomic, assign) NSUInteger skip

Declared In

AWFRequestOptions.h

  radiusMI

The search radius, in miles, to use when performing a closest request from a single location. If radiusKM is defined, this value is ignored in the request. This corresponds to the AerisAPIParamKeyRadius, or radius, parameter when accessing the API directly.

@property (nonatomic, assign) NSUInteger radiusMI

Declared In

AWFRequestOptions.h

  radiusKM

The search radius, in kilometers, to use when performing a closest request from a single location. This value will take precedence over radiusMI if both values are defined. This corresponds to the AerisAPIParamKeyRadius, or radius, parameter when accessing the API directly.

@property (nonatomic, assign) NSUInteger radiusKM

Declared In

AWFRequestOptions.h

  queryString

The query string to use when performing a search request. This corresponds to the AerisAPIParamKeyQuery, or query, parameter when accessing the API directly.

@property (nonatomic) NSString *queryString

Declared In

AWFRequestOptions.h

  queries

Returns an array of AWFRequestQuery instances currently assigned.

@property (readonly, nonatomic, strong) NSArray *queries

Declared In

AWFRequestOptions.h

  filterString

A string of comma-separated filter keys to limit the request to. This corresponds to the AerisAPIParamKeyFilter, or filter, parameter when accessing the API directly.

@property (nonatomic) NSString *filterString

Declared In

AWFRequestOptions.h

  filters

Returns an array of AWFRequestFilter instances currently assigned.

@property (readonly, nonatomic, strong) NSArray *filters

Declared In

AWFRequestOptions.h

  fields

A string of comma-separate field names to limit the request to. This corresponds to the AerisAPIParamKeyFields, or fields, parameter when accessing the API directly.

@property (nonatomic, copy) NSString *fields

Declared In

AWFRequestOptions.h

  sort

The order in which to sort the returned objects, either ascending (default) or descending. This corresponds to the AerisAPIParamKeySort, or sort, parameter when accessing the API directly.

@property (nonatomic, copy) NSString *sort

Declared In

AWFRequestOptions.h

  fromDate

The starting date from which to request objects for. This corresponds to the AerisAPIParamKeyDateFrom, or from, parameter when accessing the API directly.

@property (nonatomic, strong) NSDate *fromDate

Declared In

AWFRequestOptions.h

  fromDateString

The starting date string from which to request objects for. This value can be in the format of a relative string, @"-2 days", or an actual date, @"2/7/2014". This corresponds to the AerisAPIParamKeyDateFrom, or from, parameter when accessing the API directly.

@property (nonatomic, copy) NSString *fromDateString

Declared In

AWFRequestOptions.h

  toDate

The ending date to which to request objects for. This corresponds to the AerisAPIParamKeyDateTo, or to, parameter when accessing the API directly.

@property (nonatomic, strong) NSDate *toDate

Declared In

AWFRequestOptions.h

  toDateString

The ending date to which to request objects for. This value can be in the format of a relative string, @"+2 days", or an actual date, @"2/7/2015". This corresponds to the AerisAPIParamKeyDateTo, or to, parameter when accessing the API directly.

@property (nonatomic, copy) NSString *toDateString

Declared In

AWFRequestOptions.h

  periodLimit

The total number of periods to return. This option is only used for objects that contain a periods property. This corresponds to the AerisAPIParamKeyPeriodLimit, or plimit, parameter when accessing the API directly.

@property (nonatomic, assign) NSUInteger periodLimit

Declared In

AWFRequestOptions.h

  periodSkip

The total number of periods to skip. This option is only used for objects that contain a periods property. This corresponds to the AerisAPIParamKeyPeriodSkip, or pskip, parameter when accessing the API directly.

@property (nonatomic, assign) NSUInteger periodSkip

Declared In

AWFRequestOptions.h

  periodSort

The order in which to sort the periods. This option is only used for objects that contain a periods property. This corresponds to the AerisAPIParamKeyPeriodSort, or psort, parameter when accessing the API directly.

@property (nonatomic, copy) NSString *periodSort

Declared In

AWFRequestOptions.h

  dataType

The endpoint data type to use for a request. An endpoint data type should be one of the subendpoints supported by an API endpoint.

@property (nonatomic, copy) NSString *dataType

Declared In

AWFRequestOptions.h

  format

The format type for the request response. The default is the standard Aeris API response as a JSON object.

@property (nonatomic, copy) NSString *format

Declared In

AWFRequestOptions.h

+ options

Creates a new empty AWFRequestOptions instance.

+ (instancetype)options

Return Value

The empty instance

Declared In

AWFRequestOptions.h

+ requestOptionsFromDictionary:

Creates and returns a new AWFRequestOptions instance using the provided dictionary values.

+ (instancetype)requestOptionsFromDictionary:(NSDictionary *)dictionary

Parameters

dictionary

A dictionary of values to assign to the instance. These must be valid API parameter keys.

Return Value

The instantiated instance from the dictionary

Declared In

AWFRequestOptions.h

+ requestOptionsFromQueryString:

Creates and returns a new AWFRequestOptions instance initialized with the specified query string.

+ (instancetype)requestOptionsFromQueryString:(NSString *)queryString

Parameters

queryString

The query string to populate the new instance with.

Return Value

The initialized instance from the queryString

Declared In

AWFRequestOptions.h

+ requestOptionsFromURLPath:

Creates and returns a new AWFRequestOptions instance initialized using the given URL path.

+ (instancetype)requestOptionsFromURLPath:(NSString *)URLPath

Parameters

URLPath

URL path to create the instance from

Return Value

The initialized instance from the URLPath

Declared In

AWFRequestOptions.h

– optionsAsDictionary

Returns a dictionary representation of the options defined in the request object. This is often used when passing the options as parameters to the actual request.

- (NSDictionary *)optionsAsDictionary

Declared In

AWFRequestOptions.h

– optionsAsQueryString

Returns a formatted URL query string representation of the options defined in the request option.

- (NSString *)optionsAsQueryString

Return Value

The formatted URL query string from the receiver.

Declared In

AWFRequestOptions.h

– optionsAsQueryStringIgnoringPlace

Returns a formatted URL query string representation of the options defined in the request option, but eliminating the place value from the string.

- (NSString *)optionsAsQueryStringIgnoringPlace

Return Value

The formatted URL query string from the receiver ignoring the place value.

Declared In

AWFRequestOptions.h

– addFilter:

Adds a filter item to the request’s filter option.

- (void)addFilter:(AWFRequestFilter *)filter

Parameters

filter

The filter item to add.

See Also

Declared In

AWFRequestOptions.h

– addFiltersByName:

Adds an array of filter items to the request’s filter option. The array provided should be an array of filter keys as strings.

- (void)addFiltersByName:(NSArray *)filterNames

Parameters

filterNames

The array of filter keys to add.

Declared In

AWFRequestOptions.h

– removeFilter:

Removes a filter item from the request’s filter option.

- (void)removeFilter:(AWFRequestFilter *)filter

Parameters

filter

The filter item to remove.

See Also

Declared In

AWFRequestOptions.h

– removeFiltersByName:

Removes an array of filters from the request’s filter option. The array provided should be an array of filter keys as strings.

- (void)removeFiltersByName:(NSArray *)filterNames

Parameters

filterNames

The array of filter keys to remove.

Declared In

AWFRequestOptions.h

– removeAllFilters

Removes all filter items from the request’s filter option.

- (void)removeAllFilters

Declared In

AWFRequestOptions.h

– addQuery:

Adds a query item to the request’s query option.

- (void)addQuery:(AWFRequestQuery *)query

Parameters

query

The query item to add.

See Also

Declared In

AWFRequestOptions.h

– removeQuery:

Removes a query item from the request’s query option.

- (void)removeQuery:(AWFRequestQuery *)query

Parameters

query

The query item to remove.

See Also

Declared In

AWFRequestOptions.h

– removeAllQueries

Removes all query items from the request’s query option.

- (void)removeAllQueries

Declared In

AWFRequestOptions.h

– isEqualToRequestOptions:

Returns a Boolean value that indicates whether a request options instance is equal to the receiver by comparing the values between each instance.

- (BOOL)isEqualToRequestOptions:(AWFRequestOptions *)options

Parameters

options

The request options with which to compare the receiver.

Return Value

YES if the request options are equal, otherwise NO.

Declared In

AWFRequestOptions.h