Class: Sink::Resources::HeaderParams

Inherits:
Object
  • Object
show all
Defined in:
lib/sink/resources/header_params.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ HeaderParams

Returns a new instance of HeaderParams.

Parameters:



7
8
9
# File 'lib/sink/resources/header_params.rb', line 7

def initialize(client:)
  @client = client
end

Instance Method Details

#arrays(params = {}, opts = {}) ⇒ nil

Endpoint with a ‘type: null` header param, which we should turn into a string

type.

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [Array<Integer>] :x_required_int_array Header param: @option params [Array<String>] :x_required_string_array Header param: @option params [String, nil] :body_argument Body param: @option params [Array<Integer>, nil] :x_optional_int_array Header param: @option params [Array<String>, nil] :x_optional_string_array Header param:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


24
25
26
27
28
29
30
31
32
33
# File 'lib/sink/resources/header_params.rb', line 24

def arrays(params = {}, opts = {})
  req = {
    method: :post,
    path: "/header_params/arrays",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: NilClass
  }
  @client.request(req, opts)
end

#client_argument(params = {}, opts = {}) ⇒ nil

The ‘X-Client-Secret` header shouldn’t be included in params definitions as it

is already sent as a client argument.

Whereas the `X-Custom-Endpoint-Header` should be included as it is only used
here.

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [String, nil] :foo Body param: @option params [String, nil] :x_custom_endpoint_header Header param:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


48
49
50
51
52
53
54
55
56
57
# File 'lib/sink/resources/header_params.rb', line 48

def client_argument(params = {}, opts = {})
  req = {
    method: :post,
    path: "/header_params/client_argument",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: NilClass
  }
  @client.request(req, opts)
end

#nullable_type(params = {}, opts = {}) ⇒ nil

Endpoint with a ‘type: null` header param, which we should turn into a string

type.

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [String, nil] :body_argument Body param: @option params [String, nil] :x_null Header param:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


69
70
71
72
73
74
75
76
77
78
# File 'lib/sink/resources/header_params.rb', line 69

def nullable_type(params = {}, opts = {})
  req = {
    method: :post,
    path: "/header_params/nullable_type",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: NilClass
  }
  @client.request(req, opts)
end