Class: Sink::Resources::HeaderParams
- Inherits:
-
Object
- Object
- Sink::Resources::HeaderParams
- Defined in:
- lib/sink/resources/header_params.rb
Instance Method Summary collapse
-
#arrays(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘type: null` header param, which we should turn into a string type.
-
#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.
-
#initialize(client:) ⇒ HeaderParams
constructor
A new instance of HeaderParams.
-
#nullable_type(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘type: null` header param, which we should turn into a string type.
Constructor Details
#initialize(client:) ⇒ HeaderParams
Returns a new instance of HeaderParams.
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.
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.
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.
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 |