ServiceOptions

open class ServiceOptions: ObjectBase

Options for interaction with a data service.

  • Default initializer.

    Declaration

    Swift

    override public init()
  • Characters that must be avoided in the path component of URLs (e.g. in OData key predicates or function parameters), even when percent-encoded. This mey be the case with certain client or server environments which limit the characters permitted in paths (usually due to security concerns). When this option is set, other options (e.g. supportsAlias, supportsBatch) may be required to enable such characters to be passed in another way.

    Declaration

    Swift

    open var avoidInPaths: String?
  • Should loaded service metadata be cached in a local file? If metadataFile is non-null, then the cache file name will be metadataFile with .cache appended. If metadataFile is nil, then the cache file name will be the service name with .csdl.cache appended.

    See also

    DataService.loadMetadata.

    Declaration

    Swift

    open var cacheMetadata: Bool
  • Check data queries before sending them to the server. Defaults to true.

    See also

    DataQuery.check.

    Declaration

    Swift

    open var checkQueries: Bool
  • Check query results after receiving them from the server. Defaults to true.

    See also

    QueryResult.check.

    Declaration

    Swift

    open var checkResults: Bool
  • Check version header in OData responses. Defaults to true.

    Declaration

    Swift

    open var checkVersion: Bool
  • CSDL fetcher which can resolve CSDL references when loading metadata. This overrides a data service’s default mechanism to load metadata over HTTP.

    Declaration

    Swift

    open var csdlFetcher: CSDLFetcher?
  • CSDL options for parsing.

    See also

    CsdlOption.

    Declaration

    Swift

    open var csdlOptions: Int
  • Format to be used for data interchange (ATOM or JSON). Defaults to JSON.

    See also

    DataFormat.

    Declaration

    Swift

    open var dataFormat: Int
  • Version to be used for data interchange. If non-zero, this overrides any version specified in the service metadata.

    See also

    DataVersion.

    Declaration

    Swift

    open var dataVersion: Int
  • Is this service only to be used with a local database? By default, a service can be used both online (remote service) and offline (local database).

    Declaration

    Swift

    open var databaseOnly: Bool
  • If set to true and the server returns no value for a collection-typed property of an entity then parser will return an empty collection and validation will not fail. Note: this property is only considered if checkResults is set to true and the property to be queried is selected or expanded in the query False by default.

    Declaration

    Swift

    open var fixMissingEmptyLists: Bool
  • If set to true and the server returns no value for a non collection-typed property of an entity then parser will return a null value and validation will not fail. Note: this property is only considered if checkResults is set to true and the property to be queried is selected or expanded in the query False by default.

    Declaration

    Swift

    open var fixMissingNullValues: Bool
  • Pre-parsed CSDL schemas, which may be referenced by the service metadata.

    Declaration

    Swift

    open var includeSchemas: DataSchemaList
  • Should data service error messages be logged? Defaults to true.

    Declaration

    Swift

    open var logErrors: Bool
  • Should data service warning messages be logged? Defaults to true.

    Declaration

    Swift

    open var logWarnings: Bool
  • Name of local file containing OData CSDL service metadata for the data service. If this is nil, then metadata will be fetched from the remote service.

    Declaration

    Swift

    open var metadataFile: String?
  • Text of the service metadata, provider by the caller so it does not need to be loaded.

    Declaration

    Swift

    open var metadataText: String?
  • Alternate location of OData CSDL service metadata. Can be an absolute URL, or a relative URL (relative to the service root URL). Use this if the preferred service metadata document appears at a URL other than that formed by appending $metadata to the service root URL.

    Declaration

    Swift

    open var metadataURL: String?
  • Response type accepted by DataService.pingServer. Defaults to application/json,application/xml,application/atomsvc+xml.

    Declaration

    Swift

    open var pingAccept: String
  • HTTP method used by DataService.pingServer. Defaults to HEAD.

    Declaration

    Swift

    open var pingMethod: String
  • Resource path used by DataService.pingServer. Defaults to / (the service document).

    Declaration

    Swift

    open var pingResource: String
  • Does the service require a security token for change requests? Defaults to X-CSRF-Token. A token is obtained, implicitly if needed, by a call to DataService.pingServer.

    Declaration

    Swift

    open var requiresToken: String?
  • Does the service always require type metadata in client-sent complex/entity values.

    Declaration

    Swift

    open var requiresType: Bool
  • Does the service support parameter aliases? True by default.

    Declaration

    Swift

    open var supportsAlias: Bool
  • Does the service support OData batch requests? True by default.

    See also

    DataService.processBatch

    Declaration

    Swift

    open var supportsBatch: Bool
  • Does the service support bind operations. True by default.

    See also

    EntityValue.bindEntity.

    Declaration

    Swift

    open var supportsBind: Bool
  • Does the service support server-side change tracking (e.g. with delta links)? True by default.

    Declaration

    Swift

    open var supportsDelta: Bool
  • Does the service support the following of next-links using the $skiptoken system query option. True by default.

    Declaration

    Swift

    open var supportsNext: Bool
  • Does the service support OData PATCH requests (or MERGE for OData versions < 3.0). True by default.

    Declaration

    Swift

    open var supportsPatch: Bool
  • Does the service support unbind operations (unbind navigation property from an existing entity in delete)? True by default.

    See also

    EntityValue.unbindEntity.

    Declaration

    Swift

    open var supportsUnbind: Bool