Class: Sink::Resources::BodyParams

Inherits:
Object
  • Object
show all
Defined in:
lib/sink/resources/body_params.rb,
lib/sink/resources/body_params/unions.rb,
lib/sink/resources/body_params/objects.rb

Defined Under Namespace

Classes: Objects, Unions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ BodyParams

Returns a new instance of BodyParams.

Parameters:



13
14
15
16
17
# File 'lib/sink/resources/body_params.rb', line 13

def initialize(client:)
  @client = client
  @objects = Sink::Resources::BodyParams::Objects.new(client: client)
  @unions = Sink::Resources::BodyParams::Unions.new(client: client)
end

Instance Attribute Details

#objectsSink::Resources::BodyParams::Objects (readonly)



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

def objects
  @objects
end

#unionsSink::Resources::BodyParams::Unions (readonly)



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

def unions
  @unions
end

Instance Method Details

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

Endpoint with a ‘requestBody` that has an `type: string` schema and content

`application/octet-stream` that is defined as a model in the config.

Parameters:

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

    Attributes to send in this request. @option params [String] :binary_string_body

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


28
29
30
31
32
33
34
35
36
37
# File 'lib/sink/resources/body_params.rb', line 28

def binary_string_type(params = {}, opts = {})
  req = {
    method: :post,
    path: "/body_params/binary_string_type",
    body: params[:binary_string_body],
    headers: {"Content-Type" => "application/octet-stream"},
    model: NilClass
  }
  @client.request(req, opts)
end

#duplicate_subproperty(params = {}, opts = {}) ⇒ Sink::Models::ModelWithNestedModel

An edge case where there are nested sub-properties of the same name with

possible clashes.

Parameters:

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

    Attributes to send in this request. @option params [Baz, nil] :baz @option params [Foo, nil] :foo @option params [FooBar, nil] :foo_bar @option params [Mapping, nil] :mapping @option params [Array<Mapping>, nil] :mappings

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

    Options to specify HTTP behaviour for this request.

Returns:



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

def duplicate_subproperty(params = {}, opts = {})
  req = {
    method: :post,
    path: "/body_params/with_duplicate_subproperty",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::ModelWithNestedModel
  }
  @client.request(req, opts)
end

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

Endpoint with a ‘requestBody` with various enums properties

Parameters:

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

    Attributes to send in this request. @option params [Integer, nil] :code @option params [Float, nil] :cost @option params [Boolean, nil] :enabled @option params [Symbol, Kind, nil] :kind

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


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

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

#nested_request_models(params = {}, opts = {}) ⇒ Sink::Models::ModelWithNestedModel

Should return a ModelWithNestedModel object with a ‘properties` field that we

can rename in the Stainless config to a prettier name.

Parameters:

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

    Attributes to send in this request. @option params [Sink::Models::NestedRequestModelA, nil] :data

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

    Options to specify HTTP behaviour for this request.

Returns:



94
95
96
97
98
99
100
101
102
103
# File 'lib/sink/resources/body_params.rb', line 94

def nested_request_models(params = {}, opts = {})
  req = {
    method: :post,
    path: "/body_params/with_nested_models",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::ModelWithNestedModel
  }
  @client.request(req, opts)
end

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

Endpoint with a ‘requestBody` that has an `type: null` schema that is defined as

a model in the config.

Parameters:

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

    Attributes to send in this request. @option params [String] :name @option params [nil] :null_type_prop

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


115
116
117
118
119
120
121
122
123
124
# File 'lib/sink/resources/body_params.rb', line 115

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

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

Endpoint with a ‘requestBody` that has an `additionalProperties` object schema

that is defined as a model in the config.

Parameters:

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

    Attributes to send in this request. @option params [Hash] :model_ref @option params [String] :name

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


136
137
138
139
140
141
142
143
144
145
# File 'lib/sink/resources/body_params.rb', line 136

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

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

Endpoint with an object ‘requestBody` that has an array property with `object`

items.

Parameters:

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

    Attributes to send in this request. @option params [Array<ArrayProp>, nil] :array_prop

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


156
157
158
159
160
161
162
163
164
165
# File 'lib/sink/resources/body_params.rb', line 156

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

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

Endpoint with an object ‘requestBody` that has properties with union types.

Parameters:

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

    Attributes to send in this request. @option params [Bar::UnnamedTypeWithunionParent8, Sink::Models::SimpleObject] :bar @option params [Boolean, Float, Object, String] :foo

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


176
177
178
179
180
181
182
183
184
185
# File 'lib/sink/resources/body_params.rb', line 176

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

#only_read_only_properties(opts = {}) ⇒ nil

Endpoint with a ‘requestBody` that only has `readOnly` properties

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


192
193
194
195
196
197
198
199
200
# File 'lib/sink/resources/body_params.rb', line 192

def only_read_only_properties(opts = {})
  req = {
    method: :patch,
    path: "/body_params/only_read_only_properties",
    headers: {"Content-Type" => "application/json"},
    model: NilClass
  }
  @client.request(req, opts)
end

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

Endpoint with a ‘requestBody` that has a schema that is defined as a model in

the config with "param" in the name.

Parameters:

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

    Attributes to send in this request. @option params [Hash] :model_ref @option params [String] :name

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


212
213
214
215
216
217
218
219
220
221
# File 'lib/sink/resources/body_params.rb', line 212

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

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

Endpoint with a ‘requestBody` that has a property that is defined as a model in

the config.

Parameters:

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

    Attributes to send in this request. @option params [Sink::Models::MyModel] :model_ref @option params [String] :name

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


233
234
235
236
237
238
239
240
241
242
# File 'lib/sink/resources/body_params.rb', line 233

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

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

Endpoint with a ‘requestBody` that has a property that is a union type of

complex types.

Parameters:

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

    Attributes to send in this request. @option params [String] :name @option params [Unions::UnnamedTypeWithunionParent10, Unions::UnnamedTypeWithunionParent9] :unions This is an object with required properties

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


254
255
256
257
258
259
260
261
262
263
# File 'lib/sink/resources/body_params.rb', line 254

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

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

Endpoint with a ‘requestBody` that has a property that is a union type of

complex types with a lot of nesting.

Parameters:

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

    Attributes to send in this request. @option params [Array<Filter::UnnamedTypeWithunionParent11, Filter::UnnamedTypeWithunionParent12>, nil] :filters

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


274
275
276
277
278
279
280
281
282
283
# File 'lib/sink/resources/body_params.rb', line 274

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

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

Endpoint with a ‘requestBody` that sets `readOnly` to `true` on top level

properties

Parameters:

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

    Attributes to send in this request. @option params [Boolean, nil] :in_both

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


294
295
296
297
298
299
300
301
302
303
# File 'lib/sink/resources/body_params.rb', line 294

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

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

Endpoint with a ‘requestBody` that has an `additionalProperties` string schema

that is defined as a model in the config.

Parameters:

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

    Attributes to send in this request. @option params [Hash] :model_ref @option params [String] :name

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


315
316
317
318
319
320
321
322
323
324
# File 'lib/sink/resources/body_params.rb', line 315

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

#top_level_all_of(params = {}, opts = {}) ⇒ Sink::Models::BodyParamTopLevelAllOfResponse

Endpoint with a ‘requestBody` making use of allOf.

Parameters:

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

    Attributes to send in this request. @option params [Boolean] :is_foo @option params [Symbol, Kind] :kind

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

    Options to specify HTTP behaviour for this request.

Returns:



335
336
337
338
339
340
341
342
343
344
# File 'lib/sink/resources/body_params.rb', line 335

def top_level_all_of(params = {}, opts = {})
  req = {
    method: :post,
    path: "/body_params/top_level_allOf",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::BodyParamTopLevelAllOfResponse
  }
  @client.request(req, opts)
end

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

Endpoint with a ‘requestBody` making use of allOf where one of the properties is

an object type.

Parameters:

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

    Attributes to send in this request. @option params [Symbol, Kind] :kind @option params [NestedObj, nil] :nested_obj This is an object with required properties

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


356
357
358
359
360
361
362
363
364
365
# File 'lib/sink/resources/body_params.rb', line 356

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

#top_level_any_of(params = {}, opts = {}) ⇒ Sink::Models::BodyParamTopLevelAnyOfResponse::UnnamedTypeWithunionParent13, Sink::Models::BodyParamTopLevelAnyOfResponse::UnnamedTypeWithunionParent14

Endpoint with a ‘requestBody` making use of anyOf.

Parameters:

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

    Attributes to send in this request. @option params [Symbol, Kind] :kind @option params [Boolean] :is_foo

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (Sink::Models::BodyParamTopLevelAnyOfResponse::UnnamedTypeWithunionParent13, Sink::Models::BodyParamTopLevelAnyOfResponse::UnnamedTypeWithunionParent14)


376
377
378
379
380
381
382
383
384
385
# File 'lib/sink/resources/body_params.rb', line 376

def top_level_any_of(params = {}, opts = {})
  req = {
    method: :post,
    path: "/body_params/top_level_anyOf",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Unknown
  }
  @client.request(req, opts)
end

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

Endpoint with a ‘requestBody` pointing to a $ref’d schema that is an ‘anyOf`.

Parameters:

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

    Attributes to send in this request. @option params [Symbol, Kind] :kind @option params [Boolean] :is_foo

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

    Options to specify HTTP behaviour for this request.

Returns:



396
397
398
399
400
401
402
403
404
405
# File 'lib/sink/resources/body_params.rb', line 396

def top_level_any_of_with_ref(params = {}, opts = {})
  req = {
    method: :post,
    path: "/body_params/top_level_anyOf_with_ref",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::BasicSharedModelObject
  }
  @client.request(req, opts)
end

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

Endpoint with a ‘requestBody` that is an `array` type.

Parameters:

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

    Attributes to send in this request. @option params [Array<Sink::Models::BasicSharedModelObject>] :items

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


415
416
417
418
419
420
421
422
423
424
# File 'lib/sink/resources/body_params.rb', line 415

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

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

Endpoint with a ‘requestBody` that is an `array` type with non-model children.

Parameters:

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

    Attributes to send in this request. @option params [Array<Item>] :items

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


434
435
436
437
438
439
440
441
442
443
# File 'lib/sink/resources/body_params.rb', line 434

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

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

Endpoint with a ‘requestBody` that is an `array` type.

Parameters:

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

    Attributes to send in this request. @option params [String] :id Query param: @option params [Array<Sink::Models::BasicSharedModelObject>] :items Body param:

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


454
455
456
457
458
459
460
461
462
463
464
# File 'lib/sink/resources/body_params.rb', line 454

def top_level_array_with_other_params(params = {}, opts = {})
  req = {
    method: :post,
    path: "/body_params/top_level_array_with_other_params",
    body: params[:items],
    query: params.except(:items),
    headers: {"Content-Type" => "application/json"},
    model: NilClass
  }
  @client.request(req, opts)
end

#top_level_one_of(params = {}, opts = {}) ⇒ Sink::Models::BodyParamTopLevelOneOfResponse::UnnamedTypeWithunionParent15, Sink::Models::BodyParamTopLevelOneOfResponse::UnnamedTypeWithunionParent16

Endpoint with a ‘requestBody` making use of oneOf.

Parameters:

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

    Attributes to send in this request. @option params [Symbol, Kind] :kind @option params [Boolean] :is_foo

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (Sink::Models::BodyParamTopLevelOneOfResponse::UnnamedTypeWithunionParent15, Sink::Models::BodyParamTopLevelOneOfResponse::UnnamedTypeWithunionParent16)


475
476
477
478
479
480
481
482
483
484
# File 'lib/sink/resources/body_params.rb', line 475

def top_level_one_of(params = {}, opts = {})
  req = {
    method: :post,
    path: "/body_params/top_level_oneOf",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Unknown
  }
  @client.request(req, opts)
end

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

Endpoint with a ‘requestBody` making use of oneOf but only contains one entry in

the union.

Parameters:

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

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

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


495
496
497
498
499
500
501
502
503
504
# File 'lib/sink/resources/body_params.rb', line 495

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

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

The request body being set to a $ref that is a shared type in the stainless

config correctly references it.

Parameters:

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

    Attributes to send in this request. @option params [Sink::Models::SimpleObject, nil] :bar @option params [String, nil] :foo

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


516
517
518
519
520
521
522
523
524
525
# File 'lib/sink/resources/body_params.rb', line 516

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

#union_overlapping_prop(params = {}, opts = {}) ⇒ Sink::Models::BodyParamUnionOverlappingPropResponse

Endpoint with a ‘requestBody` making use of anyOf where the same property is

defined in both variants.

Parameters:

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

    Attributes to send in this request. @option params [Boolean, nil] :foo FOO 2

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

    Options to specify HTTP behaviour for this request.

Returns:



536
537
538
539
540
541
542
543
544
545
# File 'lib/sink/resources/body_params.rb', line 536

def union_overlapping_prop(params = {}, opts = {})
  req = {
    method: :post,
    path: "/body_params/top_level_anyOf_overlapping_property",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::BodyParamUnionOverlappingPropResponse
  }
  @client.request(req, opts)
end

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

Endpoint with a ‘requestBody` that has an untyped object schema that is defined

as a model in the config.

Parameters:

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

    Attributes to send in this request. @option params [String] :name @option params [Object] :unknown_object_prop

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


557
558
559
560
561
562
563
564
565
566
# File 'lib/sink/resources/body_params.rb', line 557

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

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

Endpoint with an optional request property that has a default value set.

Parameters:

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

    Attributes to send in this request. @option params [String, nil] :my_version_body_param @option params [Boolean, nil] :normal_param

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


577
578
579
580
581
582
583
584
585
586
# File 'lib/sink/resources/body_params.rb', line 577

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

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

Endpoint with a required request property that has a default value set.

Parameters:

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

    Attributes to send in this request. @option params [String] :my_version_body_param @option params [Boolean] :normal_param

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


597
598
599
600
601
602
603
604
605
606
# File 'lib/sink/resources/body_params.rb', line 597

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

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

Endpoint with a request body that contains a property that points to a model

reference.

Parameters:

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

    Attributes to send in this request. @option params [String, nil] :foo @option params [Sink::Models::MyModel, nil] :my_model

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


618
619
620
621
622
623
624
625
626
627
# File 'lib/sink/resources/body_params.rb', line 618

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