Class: Sink::Resources::BodyParams
- Inherits:
-
Object
- Object
- Sink::Resources::BodyParams
- 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
Instance Attribute Summary collapse
- #objects ⇒ Sink::Resources::BodyParams::Objects readonly
- #unions ⇒ Sink::Resources::BodyParams::Unions readonly
Instance Method Summary collapse
-
#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.
-
#duplicate_subproperty(params = {}, opts = {}) ⇒ Sink::Models::ModelWithNestedModel
An edge case where there are nested sub-properties of the same name with possible clashes.
-
#enum_properties(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘requestBody` with various enums properties.
-
#initialize(client:) ⇒ BodyParams
constructor
A new instance of BodyParams.
-
#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.
-
#null_type(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘requestBody` that has an `type: null` schema that is defined as a model in the config.
-
#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.
-
#object_with_array_of_objects(params = {}, opts = {}) ⇒ nil
Endpoint with an object ‘requestBody` that has an array property with `object` items.
-
#object_with_union_properties(params = {}, opts = {}) ⇒ nil
Endpoint with an object ‘requestBody` that has properties with union types.
-
#only_read_only_properties(opts = {}) ⇒ nil
Endpoint with a ‘requestBody` that only has `readOnly` properties.
-
#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.
-
#property_model_ref(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘requestBody` that has a property that is defined as a model in the config.
-
#property_with_complex_union(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘requestBody` that has a property that is a union type of complex types.
-
#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.
-
#read_only_properties(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘requestBody` that sets `readOnly` to `true` on top level properties.
-
#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.
-
#top_level_all_of(params = {}, opts = {}) ⇒ Sink::Models::BodyParamTopLevelAllOfResponse
Endpoint with a ‘requestBody` making use of allOf.
-
#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.
-
#top_level_any_of(params = {}, opts = {}) ⇒ Sink::Models::BodyParamTopLevelAnyOfResponse::UnnamedTypeWithunionParent13, Sink::Models::BodyParamTopLevelAnyOfResponse::UnnamedTypeWithunionParent14
Endpoint with a ‘requestBody` making use of anyOf.
-
#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`.
-
#top_level_array(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘requestBody` that is an `array` type.
-
#top_level_array_with_children(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘requestBody` that is an `array` type with non-model children.
-
#top_level_array_with_other_params(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘requestBody` that is an `array` type.
-
#top_level_one_of(params = {}, opts = {}) ⇒ Sink::Models::BodyParamTopLevelOneOfResponse::UnnamedTypeWithunionParent15, Sink::Models::BodyParamTopLevelOneOfResponse::UnnamedTypeWithunionParent16
Endpoint with a ‘requestBody` making use of oneOf.
-
#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.
-
#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.
-
#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.
-
#unknown_object(params = {}, opts = {}) ⇒ nil
Endpoint with a ‘requestBody` that has an untyped object schema that is defined as a model in the config.
-
#with_default_body_param_optional(params = {}, opts = {}) ⇒ nil
Endpoint with an optional request property that has a default value set.
-
#with_default_body_param_required(params = {}, opts = {}) ⇒ nil
Endpoint with a required request property that has a default value set.
-
#with_model_property(params = {}, opts = {}) ⇒ nil
Endpoint with a request body that contains a property that points to a model reference.
Constructor Details
#initialize(client:) ⇒ BodyParams
Returns a new instance of BodyParams.
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
#objects ⇒ Sink::Resources::BodyParams::Objects (readonly)
7 8 9 |
# File 'lib/sink/resources/body_params.rb', line 7 def objects @objects end |
#unions ⇒ Sink::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.
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.
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
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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
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.
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.
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.
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.
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`.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 |