Class: Sink::Resources::PathParams
- Inherits:
-
Object
- Object
- Sink::Resources::PathParams
- Defined in:
- lib/sink/resources/path_params.rb
Instance Method Summary collapse
-
#colon_suffix(with_verb, opts = {}) ⇒ Sink::Models::PathParamColonSuffixResponse
Endpoint with a path param followed by a verb.
-
#dashed_param(dashed_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that uses a ‘dash` separator.
-
#date_param(date_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that is a date type.
-
#datetime_param(datetime_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that is a date-time type.
-
#enum_param(enum_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that is an enum type.
-
#file_extension(with_file_extension, opts = {}) ⇒ Sink::Models::PathParamFileExtensionResponse
Endpoint with a path param followed by a file extension.
-
#initialize(client:) ⇒ PathParams
constructor
A new instance of PathParams.
-
#integer_param(integer_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that is of an integer type.
-
#multiple(first, second, last, opts = {}) ⇒ Sink::Models::PathParamMultipleResponse
Endpoint with multiple path parameters.
-
#nullable_params(nullable_param_1, nullable_param_2, nullable_param_3, params = {}, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with nullable path parameters.
-
#params_mixed_types(integer_param, string_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with multiple path parameters that are of different types, e.g.
-
#query_param(with_query_param, opts = {}) ⇒ Sink::Models::PathParamQueryParamResponse
Endpoint with a path param followed by a query param in the path itself.
-
#singular(singular, opts = {}) ⇒ Sink::Models::PathParamSingularResponse
Endpoint with a singular path parameter.
Constructor Details
#initialize(client:) ⇒ PathParams
Returns a new instance of PathParams.
7 8 9 |
# File 'lib/sink/resources/path_params.rb', line 7 def initialize(client:) @client = client end |
Instance Method Details
#colon_suffix(with_verb, opts = {}) ⇒ Sink::Models::PathParamColonSuffixResponse
Endpoint with a path param followed by a verb.
17 18 19 20 21 22 23 24 |
# File 'lib/sink/resources/path_params.rb', line 17 def colon_suffix(with_verb, opts = {}) req = { method: :post, path: "/path_params/#{with_verb}:initiate", model: Sink::Models::PathParamColonSuffixResponse } @client.request(req, opts) end |
#dashed_param(dashed_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that uses a ‘dash` separator.
32 33 34 35 36 37 38 39 |
# File 'lib/sink/resources/path_params.rb', line 32 def dashed_param(dashed_param, opts = {}) req = { method: :post, path: "/path_params/#{dashed_param}", model: Sink::Models::BasicSharedModelObject } @client.request(req, opts) end |
#date_param(date_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that is a date type.
47 48 49 50 51 52 53 54 |
# File 'lib/sink/resources/path_params.rb', line 47 def date_param(date_param, opts = {}) req = { method: :post, path: "/path_params/dates/#{date_param}", model: Sink::Models::BasicSharedModelObject } @client.request(req, opts) end |
#datetime_param(datetime_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that is a date-time type.
62 63 64 65 66 67 68 69 |
# File 'lib/sink/resources/path_params.rb', line 62 def datetime_param(datetime_param, opts = {}) req = { method: :post, path: "/path_params/date_times/#{datetime_param}", model: Sink::Models::BasicSharedModelObject } @client.request(req, opts) end |
#enum_param(enum_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that is an enum type.
77 78 79 80 81 82 83 84 |
# File 'lib/sink/resources/path_params.rb', line 77 def enum_param(enum_param, opts = {}) req = { method: :post, path: "/path_params/enums/#{enum_param}", model: Sink::Models::BasicSharedModelObject } @client.request(req, opts) end |
#file_extension(with_file_extension, opts = {}) ⇒ Sink::Models::PathParamFileExtensionResponse
Endpoint with a path param followed by a file extension.
92 93 94 95 96 97 98 99 |
# File 'lib/sink/resources/path_params.rb', line 92 def file_extension(with_file_extension, opts = {}) req = { method: :post, path: "/path_params/#{with_file_extension}.json", model: Sink::Models::PathParamFileExtensionResponse } @client.request(req, opts) end |
#integer_param(integer_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with a singular path parameter that is of an integer type.
107 108 109 110 111 112 113 114 |
# File 'lib/sink/resources/path_params.rb', line 107 def integer_param(integer_param, opts = {}) req = { method: :post, path: "/path_params/#{integer_param}", model: Sink::Models::BasicSharedModelObject } @client.request(req, opts) end |
#multiple(first, second, last, opts = {}) ⇒ Sink::Models::PathParamMultipleResponse
Endpoint with multiple path parameters.
124 125 126 127 128 129 130 131 |
# File 'lib/sink/resources/path_params.rb', line 124 def multiple(first, second, last, opts = {}) req = { method: :post, path: "/path_params/#{first}/#{second}/#{last}", model: Sink::Models::PathParamMultipleResponse } @client.request(req, opts) end |
#nullable_params(nullable_param_1, nullable_param_2, nullable_param_3, params = {}, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with nullable path parameters.
In a spec file nullable path params are ambiguous and likely to be a mistake.
They are transformed to non-nullable as part of the spec normalization and a
diagnostic is emitted.
151 152 153 154 155 156 157 158 159 160 |
# File 'lib/sink/resources/path_params.rb', line 151 def nullable_params(nullable_param_1, nullable_param_2, nullable_param_3, params = {}, opts = {}) req = { method: :post, path: "/path_params/nullable/#{nullable_param_1}/#{nullable_param_2}/#{nullable_param_3}", body: params, headers: {"Content-Type" => "application/json"}, model: Sink::Models::BasicSharedModelObject } @client.request(req, opts) end |
#params_mixed_types(integer_param, string_param, opts = {}) ⇒ Sink::Models::BasicSharedModelObject
Endpoint with multiple path parameters that are of different types, e.g. one
integer type and the other string type.
170 171 172 173 174 175 176 177 |
# File 'lib/sink/resources/path_params.rb', line 170 def params_mixed_types(integer_param, string_param, opts = {}) req = { method: :post, path: "/path_params/mixed/#{integer_param}/#{string_param}", model: Sink::Models::BasicSharedModelObject } @client.request(req, opts) end |
#query_param(with_query_param, opts = {}) ⇒ Sink::Models::PathParamQueryParamResponse
Endpoint with a path param followed by a query param in the path itself.
185 186 187 188 189 190 191 192 |
# File 'lib/sink/resources/path_params.rb', line 185 def query_param(with_query_param, opts = {}) req = { method: :post, path: "/path_params/#{with_query_param}?beta=true", model: Sink::Models::PathParamQueryParamResponse } @client.request(req, opts) end |
#singular(singular, opts = {}) ⇒ Sink::Models::PathParamSingularResponse
Endpoint with a singular path parameter.
200 201 202 203 204 205 206 207 |
# File 'lib/sink/resources/path_params.rb', line 200 def singular(singular, opts = {}) req = { method: :post, path: "/path_params/#{singular}", model: Sink::Models::PathParamSingularResponse } @client.request(req, opts) end |