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

    public final var avoidInPaths: String? { get set }
  • Should all entity operations (createEntity, updateEntity, deleteEntity) be done inside a RequestBatch? Defaults to false. This is particularly useful if the backend service might otherwise log URLs containing sensitive information.

    See also

    RequestOptions.useBatch, if only some entity operations should be batched.

    Declaration

    Swift

    public final var batchEntityOperations: Bool { get set }
  • Should all executeMethod calls be done inside a RequestBatch? Defaults to false. This is particularly useful if the backend service might otherwise log URLs containing sensitive information.

    See also

    RequestOptions.useBatch, if only some method executions should be batched.

    Declaration

    Swift

    public final var batchExecuteMethods: Bool { get set }
  • Should all executeQuery calls be done inside a RequestBatch? Defaults to false. This is particularly useful if the backend service might otherwise log URLs containing sensitive information.

    See also

    RequestOptions.useBatch, if only some query executions should be batched.

    Declaration

    Swift

    public final var batchExecuteQueries: Bool { get set }
  • Should all entity link operations (createLink, updateLink, deleteLink) be done inside a RequestBatch? Defaults to false. This is particularly useful if the backend service might otherwise log URLs containing sensitive information.

    See also

    RequestOptions.useBatch, if only some link operations should be batched.

    Declaration

    Swift

    public final var batchLinkOperations: Bool { get set }
  • 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

    public final var cacheMetadata: Bool { get set }
  • Check data queries before sending them to the server. Defaults to true.

    See also

    DataQuery.check.

    Declaration

    Swift

    public final var checkQueries: Bool { get set }
  • Check query results after receiving them from the server. Defaults to true.

    See also

    QueryResult.check.

    Declaration

    Swift

    public final var checkResults: Bool { get set }
  • Check version header in OData responses. Defaults to true.

    Declaration

    Swift

    public final var checkVersion: Bool { get set }
  • Globally unique client identifier for the client, used to provide a default value for the “Client-Instance-ID” HTTP header.

    Declaration

    Swift

    public final var clientInstanceID: String? { get set }
  • Do createEntity calls return resulting entity state in response payload? Defaults to true.

    Declaration

    Swift

    public final var createReturnsContent: Bool { get set }
  • 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

    public final var csdlFetcher: CSDLFetcher? { get set }
  • CSDL options for parsing.

    See also

    CsdlOption.

    Declaration

    Swift

    public final var csdlOptions: Int { get set }
  • Format to be used for data interchange (ATOM or JSON). Defaults to JSON.

    See also

    DataFormat.

    Declaration

    Swift

    public final var dataFormat: Int { get set }
  • Version to be used for data interchange. If non-zero, this overrides any version specified in the service metadata.

    See also

    DataVersion.

    Declaration

    Swift

    public final var dataVersion: Int { get set }
  • 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

    public final var databaseOnly: Bool { get set }
  • Should DataService.updateEntity calls with EntityValue.deepUpdate automatically cascade to nested entities? Defaults to `false’.

    Declaration

    Swift

    public final var deepUpdateCascade: Bool { get set }
  • Should DataService.updateEntity calls with EntityValue.deepUpdate automatically use delta payload format? Defaults to `false’.

    Declaration

    Swift

    public final var deepUpdateDelta: Bool { get set }
  • If the backend system returns an ETag header when querying for an entity (or an “etag” annotation when querying for multiple entities), should deletes of the entity send the ETag value with an If-Match header? Defaults to true.

    Declaration

    Swift

    public final var deleteWithEntityTag: Bool { get set }
  • 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. Defaults to false.

    Declaration

    Swift

    public final var fixMissingEmptyLists: Bool { get set }
  • 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. Defaults to false.

    Declaration

    Swift

    public final var fixMissingNullValues: Bool { get set }
  • Should format parameter IEEE754Compatible enabled? Defaults to false.

    Declaration

    Swift

    public final var ieee754Compatible: Bool { get set }
  • Extra child elements for parsing main CSDL schema.

    Declaration

    Swift

    public final var includeElements: XmlElementList { get set }
  • Supplementary edmx:Reference elements. Defaults to an empty list.

    Declaration

    Swift

    public final var includeReferences: XmlElementList { get set }
  • Pre-parsed CSDL schemas, which may be referenced by the service metadata.

    Declaration

    Swift

    public final var includeSchemas: DataSchemaList { get set }
  • Defaults to 204 (HTTP No Content), forcing an implicit loadEntity call to be issued before createEntity returns, if the create response status from the server is >= 204. If this property has a value of 200 (HTTP OK) then an implicit loadEntity call will always be issued before createEntity returns, to retrieve the post-create entity state. If this property has a value of 0 then an implicit loadEntity call will never be issued.

    Declaration

    Swift

    public final var loadIfCreateStatus: Int { get set }
  • Defaults to 204 (HTTP No Content), forcing an implicit loadEntity call to be issued before updateEntity returns, if the update response status from the server is >= 204. If this property has a value of 200 (HTTP OK) then an implicit loadEntity call will always be issued before updateEntity returns, to retrieve the post-update entity state. If this property has a value of 0 then an implicit loadEntity call will never be issued.

    Declaration

    Swift

    public final var loadIfUpdateStatus: Int { get set }
  • Should data service error messages be logged? Defaults to true.

    Declaration

    Swift

    public final var logErrors: Bool { get set }
  • Should data service warning messages be logged? Defaults to true.

    Declaration

    Swift

    public final var logWarnings: Bool { get set }
  • 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

    public final var metadataFile: String? { get set }
  • Text of the service metadata, provider by the caller so it does not need to be loaded.

    Declaration

    Swift

    public final var metadataText: String? { get set }
  • 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

    public final var metadataURL: String? { get set }
  • HTTP method used by DataService.updateEntity when RequestOptions.updateMode is merge (the default update mode). A null default value allows DataService.updateEntity to determine the appropriate HTTP method for the OData version. Non-standard servers might require the use of patch method “PUT” for updates with merge semantics.

    Declaration

    Swift

    public final var patchMethod: String? { get set }
  • Response type accepted by DataService.pingServer. Defaults to “application/json,application/xml,application/atomsvc+xml”.

    Declaration

    Swift

    public final var pingAccept: String { get set }
  • HTTP method used by DataService.pingServer. Defaults to “GET”.

    Declaration

    Swift

    public final var pingMethod: String { get set }
  • Resource path used by DataService.pingServer. Defaults to “/” (the service document).

    Declaration

    Swift

    public final var pingResource: String { get set }
  • Custom file name for storage of client registration information. If not specified, then “~/ClientRegistration/.json” will be used.

    See also

    OnlineOdataProvider.registerClient, OnlineOdataProvider.serviceName.

    Declaration

    Swift

    public final var registrationFile: String? { get set }
  • Optional client ID for repeatable requests.

    Declaration

    Swift

    public final var repeatabilityClientID: GuidValue? { get set }
  • 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

    public final var requiresToken: String? { get set }
  • Does the service always require type metadata in client-sent complex/entity values. Defaults to false.

    Declaration

    Swift

    public final var requiresType: Bool { get set }
  • Should the client send Repeatable Requests in accordance with the original (2013) specification? Defaults to true.

    Declaration

    Swift

    public final var sendOriginalRepeatability: Bool { get set }
  • Should the client send Repeatable Requests in accordance with the standard (2020) specification? Defaults to true.

    Declaration

    Swift

    public final var sendStandardRepeatability: Bool { get set }
  • Does the service support parameter aliases? Defaults to true.

    Declaration

    Swift

    public final var supportsAlias: Bool { get set }
  • Does the service support OData batch requests? Defaults to true.

    See also

    DataService.processBatch

    Declaration

    Swift

    public final var supportsBatch: Bool { get set }
  • Does the service support repeatability deletion within a batch request? Defaults to true.

    Declaration

    Swift

    public final var supportsBatchForRepeatabilityDeletion: Bool { get set }
  • Does the service support bind operations. Defaults to true.

    See also

    EntityValue.bindEntity.

    Declaration

    Swift

    public final var supportsBind: Bool { get set }
  • Does the service support DELETE $RepeatableRequestsWithClientID/<Repeatability-Client-ID> for Repeatable Requests? Defaults to true if the service metadata'a EntityContainer is annotated with "Org.OData.Repeatability.V1.DeleteWithClientIDSupported.

    Declaration

    Swift

    public final var supportsDeleteWithClientID: Bool { get set }
  • Does the service support DELETE $RepeatableRequestWithRequestID/<Repeatability-Request-ID> for Repeatable Requests? Defaults to true if the service metadata'a EntityContainer is annotated with "Org.OData.Repeatability.V1.DeleteWithRequestIDSupported.

    Declaration

    Swift

    public final var supportsDeleteWithRequestID: Bool { get set }
  • Does the service support server-side change tracking (e.g. with delta links)? Defaults to true.

    Declaration

    Swift

    public final var supportsDelta: Bool { get set }
  • Does the service support link operations. Defaults to true.

    See also

    DataService.createLink, DataService.updateLink, DataService.deleteLink.

    Declaration

    Swift

    public final var supportsLink: Bool { get set }
  • Does the service support the following of next-links using the $skiptoken system query option. Defaults to true.

    Declaration

    Swift

    public final var supportsNext: Bool { get set }
  • Does the service support OData PATCH requests (or MERGE for OData versions < 3.0). Defaults to true.

    Declaration

    Swift

    public final var supportsPatch: Bool { get set }
  • Does the service support Repeatable Requests? Defaults to true.

    See also

    sendOriginalRepeatability, sendStandardRepeatability. If both are true, then both kinds of repeatability headers will be sent.

    Declaration

    Swift

    public final var supportsRepeatability: Bool { get set }
  • Does the service support unbind operations (unbind navigation property from an existing entity in delete)? Defaults to true.

    See also

    EntityValue.unbindEntity.

    Declaration

    Swift

    public final var supportsUnbind: Bool { get set }
  • Do updateEntity calls return resulting entity state in response payload? Defaults to true.

    Declaration

    Swift

    public final var updateReturnsContent: Bool { get set }
  • If the backend system returns an ETag header when querying for an entity (or an “etag” annotation when querying for multiple entities), should updates of the entity send the ETag value with an If-Match header? Defaults to true.

    Declaration

    Swift

    public final var updateWithEntityTag: Bool { get set }