Class: Sink::Resources::MixedParams

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

Defined Under Namespace

Classes: Duplicates

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ MixedParams

Returns a new instance of MixedParams.

Parameters:



10
11
12
13
# File 'lib/sink/resources/mixed_params.rb', line 10

def initialize(client:)
  @client = client
  @duplicates = Sink::Resources::MixedParams::Duplicates.new(client: client)
end

Instance Attribute Details

#duplicatesSink::Resources::MixedParams::Duplicates (readonly)



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

def duplicates
  @duplicates
end

Instance Method Details

#body_with_top_level_one_of_and_path(path_param, params = {}, opts = {}) ⇒ nil

Endpoint with a ‘requestBody` making use of oneOf, and a path param.

See
https://linear.app/stainless/issue/STA-4902/orb-java-unresolved-reference-customerid-externalcustomerid

Parameters:

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

    Attributes to send in this request. @option params [Symbol, Kind] :kind @option params [String] :bar @option params [String] :foo

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


30
31
32
33
34
35
36
37
38
39
# File 'lib/sink/resources/mixed_params.rb', line 30

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

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

Endpoint with a ‘requestBody` that defines both query and body params

Parameters:

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

    Attributes to send in this request. @option params [String, nil] :query_param Query param: Query param description @option params [String, nil] :body_param Body param: Body param description

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

    Options to specify HTTP behaviour for this request.

Returns:



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/sink/resources/mixed_params.rb', line 50

def query_and_body(params = {}, opts = {})
  query_params = [:query_param]
  req = {
    method: :post,
    path: "/mixed_params/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_body_and_path(path_param = nil, params = {}, opts = {}) ⇒ Sink::Models::BasicSharedModelObject

Endpoint with a ‘requestBody` that defines query, body and path params

Parameters:

  • path_param (String) (defaults to: nil)

    Path param: Path param description

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

    Attributes to send in this request. @option params [String, nil] :query_param Query param: Query param description @option params [String, nil] :body_param Body param: Body param description

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

    Options to specify HTTP behaviour for this request.

Returns:



74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/sink/resources/mixed_params.rb', line 74

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