Class: Sink::Resources::PathParams

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PathParams

Returns a new instance of PathParams.

Parameters:



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.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

  • datetime_param (Time)

    An ISO 8601 timestamp for when the card was created. UTC time zone.

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

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

  • first (String)
  • second (String)
  • last (String)
  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

  • nullable_param_1 (String)
  • nullable_param_2 (String)
  • nullable_param_3 (Symbol, NullableParam3)
  • params (Hash{Symbol => Object}) (defaults to: {})

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

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

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

  • integer_param (Integer)
  • string_param (String)
  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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