AWFWeatherRequestOptions

Objective-C

@interface AWFWeatherRequestOptions

Swift

class AWFWeatherRequestOptions

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

  • A unique identifier to be used for the request, if any.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *identifier;

    Swift

    var identifier: String? { get set }
  • The place to use for the request. This corresponds to the AWFWeatherParamKeyPlace, or p, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) AWFPlace *place;

    Swift

    var place: AWFPlace? { get set }
  • The coordinate bounds to use for the request. This corresponds to the AWFWeatherParamKeyPlace, or p, parameter when accessing the API directly and using a coordinate region instead of a single place.

    Coordinate bounds aer typically only used with within request actions on endpoints that support it.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) AWFCoordinateBounds *bounds;

    Swift

    var bounds: AWFCoordinateBounds? { get set }
  • A string of comma-separated latitude/longitude coordinates defining a bounding region. This corresponds to the AWFWeatherParamKeyPlace, or p, parameter when accessing the API directly and using a coordinate region instead of a single place.

    Coordinate bounds aer typically only used with within request actions on endpoints that support it.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSString *boundsString;

    Swift

    var boundsString: String? { get set }
  • The maximum number of objects to return. This corresponds to the AWFWeatherParamKeyLimit, or limit, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger limit;

    Swift

    var limit: UInt { get set }
  • The number of items to skip from the expected data set. This corresponds to the AWFWeatherParamKeySkip, or skip, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger skip;

    Swift

    var skip: UInt { get set }
  • Sets the language code to use for the API information for endpoints that support this option.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *lang;

    Swift

    var lang: String? { get set }
  • 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 AWFWeatherParamKeyRadius, or radius, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger radiusMI;

    Swift

    var radiusMI: UInt { get set }
  • 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 AWFWeatherParamKeyRadius, or radius, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger radiusKM;

    Swift

    var radiusKM: UInt { get set }
  • The search radius as a distance string in miles or kilometers (e.g. @"50mi", @"100km").

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSString *radiusString;

    Swift

    var radiusString: String? { get set }
  • The query string to use when performing a search request. This corresponds to the AWFWeatherParamKeyQuery, or query, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSString *queryString;

    Swift

    var queryString: String? { get set }
  • Returns an array of AWFRequestQuery instances currently assigned.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSArray<AWFRequestQuery *> *queries;

    Swift

    var queries: [AWFRequestQuery]? { get }
  • A string of comma-separated filter keys to limit the request to. This corresponds to the AWFWeatherParamKeyFilter, or filter, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSString *filterString;

    Swift

    var filterString: String? { get set }
  • Returns an array of AWFRequestFilter instances currently assigned.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSArray<AWFRequestFilter> *filters;

    Swift

    var filters: [String]? { get }
  • A string of comma-separate field names to limit the request to. This corresponds to the AWFWeatherParamKeyFields, or fields, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *fields;

    Swift

    var fields: String? { get set }
  • The order in which to sort the returned objects, either ascending (default) or descending. This corresponds to the AWFWeatherParamKeySort, or sort, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *sort;

    Swift

    var sort: String? { get set }
  • The starting date from which to request objects for. This corresponds to the AWFWeatherParamKeyDateFrom, or from, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSDate *fromDate;

    Swift

    var fromDate: Date? { get set }
  • 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 AWFWeatherParamKeyDateFrom, or from, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *fromDateString;

    Swift

    var fromDateString: String? { get set }
  • The ending date to which to request objects for. This corresponds to the AWFWeatherParamKeyDateTo, or to, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSDate *toDate;

    Swift

    var toDate: Date? { get set }
  • 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 AWFWeatherParamKeyDateTo, or to, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *toDateString;

    Swift

    var toDateString: String? { get set }

Periods

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

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger periodLimit;

    Swift

    var periodLimit: UInt { get set }
  • The total number of periods to skip. This option is only used for objects that contain a periods property. This corresponds to the AWFWeatherParamKeyPeriodSkip, or pskip, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger periodSkip;

    Swift

    var periodSkip: UInt { get set }
  • The order in which to sort the periods. This option is only used for objects that contain a periods property. This corresponds to the AWFWeatherParamKeyPeriodSort, or psort, parameter when accessing the API directly.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *periodSort;

    Swift

    var periodSort: String? { get set }
  • The default endpoint action to use for a request. This value will be ignored when performing a request with a pre-defined endpoint action requirement.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) AWFWeatherRequestAction action;

    Swift

    var action: AWFWeatherRequestAction? { get set }

Output Format

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

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *format;

    Swift

    var format: String? { get set }
  • Creates and returns a new AWFWeatherRequestOptions instance using the provided dictionary values.

    Declaration

    Objective-C

    + (nonnull instancetype)optionsFromDictionary:
        (nullable NSDictionary<NSString *, id> *)dictionary;

    Swift

    convenience init(from dictionary: [String : Any]?)

    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

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

    Declaration

    Objective-C

    + (nonnull instancetype)optionsFromQueryString:(nullable NSString *)queryString;

    Swift

    convenience init(fromQueryString queryString: String?)

    Parameters

    queryString

    The query string to populate the new instance with.

    Return Value

    The initialized instance from the queryString

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

    Declaration

    Objective-C

    + (nonnull instancetype)optionsFromURLPath:(nullable NSString *)URLPath;

    Swift

    convenience init(fromURLPath URLPath: String?)

    Parameters

    URLPath

    URL path to create the instance from

    Return Value

    The initialized instance from the URLPath

  • 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.

    Declaration

    Objective-C

    - (nonnull NSDictionary<NSString *, id> *)optionsAsDictionary;

    Swift

    func optionsAsDictionary() -> [String : Any]
  • Returns a formatted URL query string representation of the options defined in the request option.

    Declaration

    Objective-C

    - (nonnull NSString *)optionsAsQueryString;

    Swift

    func optionsAsQueryString() -> String

    Return Value

    The formatted URL query string from the receiver.

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

    Declaration

    Objective-C

    - (nonnull NSString *)optionsAsQueryStringIgnoringPlace;

    Swift

    func optionsAsQueryStringIgnoringPlace() -> String

    Return Value

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

Filtering Results

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

    See

    AWFRequestFilter

    Declaration

    Objective-C

    - (void)addFilter:(nonnull AWFRequestFilter)filter;

    Swift

    func addFilter(_ filter: String)

    Parameters

    filter

    The filter item to add.

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

    See

    AWFRequestFilter

    Declaration

    Objective-C

    - (void)removeFilter:(nonnull AWFRequestFilter)filter;

    Swift

    func removeFilter(_ filter: String)

    Parameters

    filter

    The filter item to remove.

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

    Declaration

    Objective-C

    - (void)removeAllFilters;

    Swift

    func removeAllFilters()

Performing Queries

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

    See

    AWFRequestQuery

    Declaration

    Objective-C

    - (void)addQuery:(nonnull AWFRequestQuery *)query;

    Swift

    func addQuery(_ query: AWFRequestQuery)

    Parameters

    query

    The query item to add.

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

    See

    AWFRequestQuery

    Declaration

    Objective-C

    - (void)removeQuery:(nonnull AWFRequestQuery *)query;

    Swift

    func removeQuery(_ query: AWFRequestQuery)

    Parameters

    query

    The query item to remove.

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

    Declaration

    Objective-C

    - (void)removeAllQueries;

    Swift

    func removeAllQueries()

Comparing Request Options

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

    Declaration

    Objective-C

    - (BOOL)isEqualToRequestOptions:(nonnull AWFWeatherRequestOptions *)options;

    Swift

    func isEqual(to options: AWFWeatherRequestOptions) -> Bool

    Parameters

    options

    The request options with which to compare the receiver.

    Return Value

    YES if the request options are equal, otherwise NO.

  • Overrides an existing AWFWeatherRequestOptions instance’s options with those from another instance.

    Declaration

    Objective-C

    - (void)applyOptions:(nonnull AWFWeatherRequestOptions *)otherOptions;

    Swift

    func apply(_ otherOptions: AWFWeatherRequestOptions)

    Parameters

    otherOptions

    The options instance to apply to the existing instance

  • Initializes and returns a new AWFWeatherRequestOptions instance by copying the instance and then overriding the values from another instance provided by otherOptions.

    Declaration

    Objective-C

    - (nonnull AWFWeatherRequestOptions *)optionsByApplyingOptions:
        (nonnull AWFWeatherRequestOptions *)otherOptions;

    Swift

    func applying(_ otherOptions: AWFWeatherRequestOptions) -> AWFWeatherRequestOptions

    Parameters

    otherOptions

    The options instance to apply to the copy