Class: FinchAPI::Resources::RequestForwarding

Inherits:
Object
  • Object
show all
Defined in:
lib/finch-api/resources/request_forwarding.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ RequestForwarding

Returns a new instance of RequestForwarding.

Parameters:



45
46
47
# File 'lib/finch-api/resources/request_forwarding.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

#forward(params) ⇒ FinchAPI::Models::RequestForwardingForwardResponse

The Forward API allows you to make direct requests to an employment system. If

Finch’s unified API doesn’t have a data model that cleanly fits your needs, then
Forward allows you to push or pull data models directly against an integration’s
API.

Parameters:

  • params (FinchAPI::Models::RequestForwardingForwardParams, Hash{Symbol=>Object})

    .

    @option params [String] :method_ The HTTP method for the forwarded request. Valid values include: ‘GET` , `POST`

    , `PUT` , `DELETE` , and `PATCH`.
    

    @option params [String] :route The URL route path for the forwarded request. This value must begin with a

    forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and
    underscores.
    

    @option params [String, nil] :data The body for the forwarded request. This value must be specified as either a

    string or a valid JSON object.
    

    @option params [Object, nil] :headers The HTTP headers to include on the forwarded request. This value must be

    specified as an object of key-value pairs. Example:
    `{"Content-Type": "application/xml", "X-API-Version": "v1" }`
    

    @option params [Object, nil] :params The query parameters for the forwarded request. This value must be specified as

    a valid JSON object rather than a query string.
    

    @option params [FinchAPI::RequestOptions, HashSymbol=>Object, nil] :request_options

Returns:



33
34
35
36
37
38
39
40
41
42
# File 'lib/finch-api/resources/request_forwarding.rb', line 33

def forward(params)
  parsed, options = FinchAPI::Models::RequestForwardingForwardParams.dump_request(params)
  @client.request(
    method: :post,
    path: "forward",
    body: parsed,
    model: FinchAPI::Models::RequestForwardingForwardResponse,
    options: options
  )
end