Builder

@objc(SFMCSdkWrappedRequestBuilder)
public class Builder : NSObject

This is a helper class for request building.

  • Tag: Builder
  • Initializer for the Builder.

    Declaration

    Swift

    public override init()
  • Sets the Http method.

    Declaration

    Swift

    @objc
    public func method(_ method: String) -> Builder

    Parameters

    method

    http method

    Return Value

    self

  • Sets the network call request url.

    Declaration

    Swift

    @objc
    public func url(_ url: String) -> Builder

    Parameters

    url

    request url

    Return Value

    self

  • Sets the network call request url.

    Declaration

    Swift

    @objc
    public func url(base: String, path: String) -> Builder

    Parameters

    base

    base request url

    path

    request url path

    Return Value

    self

  • Adds or replaces existing header.

    Declaration

    Swift

    @objc
    public func addOrReplaceHeader(key: String, value: String) -> Builder

    Parameters

    key

    header key

    value

    header value

    Return Value

    self

  • Sets payload of the request.

    Declaration

    Swift

    @objc
    public func body(_ body: Data) -> Builder

    Parameters

    body

    payload

    Return Value

    self

  • Sets timeout on the request

    Declaration

    Swift

    @objc
    public func timeout(_ seconds: TimeInterval) -> Builder

    Parameters

    seconds

    timeout in seconds

    Return Value

    self

  • Sets rate limiting on the requet

    Declaration

    Swift

    @objc
    public func rateLimit(_ seconds: TimeInterval) -> Builder

    Parameters

    seconds

    rate limiting in seconds

    Return Value

    self

  • Sets name of the request

    Declaration

    Swift

    @objc
    public func name(_ name: String) -> Builder

    Parameters

    name

    request name

    Return Value

    self

  • Sets up tag on the request

    Declaration

    Swift

    @objc
    public func tag(_ tag: String) -> Builder

    Parameters

    tag

    request tag

    Return Value

    self

  • Builds request of given parameters.

    Declaration

    Swift

    @objc
    public func build() -> WrappedRequest?

    Return Value

    WrappedRequest instance