Class: Sink::Resources::MixedParams::Duplicates

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Duplicates

Returns a new instance of Duplicates.

Parameters:



8
9
10
# File 'lib/sink/resources/mixed_params/duplicates.rb', line 8

def initialize(client:)
  @client = client
end

Instance Method Details

#body_and_path(_path_id = nil, params = {}, opts = {}) ⇒ Sink::Models::BasicSharedModelObject

Endpoint with a ‘requestBody` that defines a param with the same name in path

and body params

Parameters:

  • path_id (String)

    Path param description

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

    Attributes to send in this request. @option params [String] :body_id Body param description

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

    Options to specify HTTP behaviour for this request.

Returns:



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

def body_and_path(_path_id = nil, params = {}, opts = {})
  req = {
    method: :post,
    path: "/mixed_params/duplicates/body_and_path/#{params.fetch(:path_id)}",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::BasicSharedModelObject
  }
  @client.request(req, opts)
end

#query_and_body(params = {}, opts = {}) ⇒ Sink::Models::BasicSharedModelObject

Endpoint with a ‘requestBody` that defines a param with the same name in query

and body params

Parameters:

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

    Attributes to send in this request. @option params [String] :body_id Body param: Body param description

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

    Options to specify HTTP behaviour for this request.

Returns:



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/sink/resources/mixed_params/duplicates.rb', line 43

def query_and_body(params = {}, opts = {})
  query_params = [:query_id]
  req = {
    method: :post,
    path: "/mixed_params/duplicates/query_and_body",
    query: params.slice(*query_params),
    body: params.except(*query_params),
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::BasicSharedModelObject
  }
  @client.request(req, opts)
end

#query_and_path(_path_id = nil, params = {}, opts = {}) ⇒ Sink::Models::BasicSharedModelObject

Endpoint with a ‘requestBody` that defines a param with the same name in path

and query params

Parameters:

  • path_id (String)

    Path param description

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

    Attributes to send in this request. @option params [String] :query_id Query param description

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

    Options to specify HTTP behaviour for this request.

Returns:



67
68
69
70
71
72
73
74
75
# File 'lib/sink/resources/mixed_params/duplicates.rb', line 67

def query_and_path(_path_id = nil, params = {}, opts = {})
  req = {
    method: :post,
    path: "/mixed_params/duplicates/query_and_path/#{params.fetch(:path_id)}",
    query: params,
    model: Sink::Models::BasicSharedModelObject
  }
  @client.request(req, opts)
end