subskribe_dev 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,333 @@
1
+ =begin
2
+ #Subskribe API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.41
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module SwaggerClient
16
+ class SettingsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Activate unit of measure
23
+ # Activates the specified unit of measure making it available to be attached to charges
24
+ # @param id
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [nil]
27
+ def activate_unit_of_measure(id, opts = {})
28
+ activate_unit_of_measure_with_http_info(id, opts)
29
+ nil
30
+ end
31
+
32
+ # Activate unit of measure
33
+ # Activates the specified unit of measure making it available to be attached to charges
34
+ # @param id
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
37
+ def activate_unit_of_measure_with_http_info(id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: SettingsApi.activate_unit_of_measure ...'
40
+ end
41
+ # verify the required parameter 'id' is set
42
+ if @api_client.config.client_side_validation && id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'id' when calling SettingsApi.activate_unit_of_measure"
44
+ end
45
+ # resource path
46
+ local_var_path = '/unitsOfMeasure/{id}/activate'.sub('{' + 'id' + '}', id.to_s)
47
+
48
+ # query parameters
49
+ query_params = {}
50
+
51
+ # header parameters
52
+ header_params = {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = {}
58
+
59
+ # http body (model)
60
+ post_body = nil
61
+ auth_names = ['ApiKeyAuth']
62
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names)
68
+ if @api_client.config.debugging
69
+ @api_client.config.logger.debug "API called: SettingsApi#activate_unit_of_measure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
70
+ end
71
+ return data, status_code, headers
72
+ end
73
+ # Add unit of measure
74
+ # Add a new instance of unit of measure as specified by the input
75
+ # @param [Hash] opts the optional parameters
76
+ # @option opts [UnitOfMeasureJson] :body
77
+ # @return [UnitOfMeasureJson]
78
+ def add_unit_of_measure(opts = {})
79
+ data, _status_code, _headers = add_unit_of_measure_with_http_info(opts)
80
+ data
81
+ end
82
+
83
+ # Add unit of measure
84
+ # Add a new instance of unit of measure as specified by the input
85
+ # @param [Hash] opts the optional parameters
86
+ # @option opts [UnitOfMeasureJson] :body
87
+ # @return [Array<(UnitOfMeasureJson, Fixnum, Hash)>] UnitOfMeasureJson data, response status code and response headers
88
+ def add_unit_of_measure_with_http_info(opts = {})
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug 'Calling API: SettingsApi.add_unit_of_measure ...'
91
+ end
92
+ # resource path
93
+ local_var_path = '/unitsOfMeasure'
94
+
95
+ # query parameters
96
+ query_params = {}
97
+
98
+ # header parameters
99
+ header_params = {}
100
+ # HTTP header 'Accept' (if needed)
101
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
102
+ # HTTP header 'Content-Type'
103
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
104
+
105
+ # form parameters
106
+ form_params = {}
107
+
108
+ # http body (model)
109
+ post_body = @api_client.object_to_http_body(opts[:'body'])
110
+ auth_names = ['ApiKeyAuth']
111
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
112
+ :header_params => header_params,
113
+ :query_params => query_params,
114
+ :form_params => form_params,
115
+ :body => post_body,
116
+ :auth_names => auth_names,
117
+ :return_type => 'UnitOfMeasureJson')
118
+ if @api_client.config.debugging
119
+ @api_client.config.logger.debug "API called: SettingsApi#add_unit_of_measure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
120
+ end
121
+ return data, status_code, headers
122
+ end
123
+ # Delete unit of measure
124
+ # Delete the unit of measure by Id provided. Returns the deleted unit of measure object if successful.
125
+ # @param id
126
+ # @param [Hash] opts the optional parameters
127
+ # @return [UnitOfMeasureJson]
128
+ def delete_unit_of_measure(id, opts = {})
129
+ data, _status_code, _headers = delete_unit_of_measure_with_http_info(id, opts)
130
+ data
131
+ end
132
+
133
+ # Delete unit of measure
134
+ # Delete the unit of measure by Id provided. Returns the deleted unit of measure object if successful.
135
+ # @param id
136
+ # @param [Hash] opts the optional parameters
137
+ # @return [Array<(UnitOfMeasureJson, Fixnum, Hash)>] UnitOfMeasureJson data, response status code and response headers
138
+ def delete_unit_of_measure_with_http_info(id, opts = {})
139
+ if @api_client.config.debugging
140
+ @api_client.config.logger.debug 'Calling API: SettingsApi.delete_unit_of_measure ...'
141
+ end
142
+ # verify the required parameter 'id' is set
143
+ if @api_client.config.client_side_validation && id.nil?
144
+ fail ArgumentError, "Missing the required parameter 'id' when calling SettingsApi.delete_unit_of_measure"
145
+ end
146
+ # resource path
147
+ local_var_path = '/unitsOfMeasure/{id}'.sub('{' + 'id' + '}', id.to_s)
148
+
149
+ # query parameters
150
+ query_params = {}
151
+
152
+ # header parameters
153
+ header_params = {}
154
+ # HTTP header 'Accept' (if needed)
155
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
156
+
157
+ # form parameters
158
+ form_params = {}
159
+
160
+ # http body (model)
161
+ post_body = nil
162
+ auth_names = ['ApiKeyAuth']
163
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
164
+ :header_params => header_params,
165
+ :query_params => query_params,
166
+ :form_params => form_params,
167
+ :body => post_body,
168
+ :auth_names => auth_names,
169
+ :return_type => 'UnitOfMeasureJson')
170
+ if @api_client.config.debugging
171
+ @api_client.config.logger.debug "API called: SettingsApi#delete_unit_of_measure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
172
+ end
173
+ return data, status_code, headers
174
+ end
175
+ # Deprecate unit of measure
176
+ # Deprecates the specified unit of measure making it unavailable to be attached to charges going forward
177
+ # @param id
178
+ # @param [Hash] opts the optional parameters
179
+ # @return [nil]
180
+ def deprecate_unit_of_measure(id, opts = {})
181
+ deprecate_unit_of_measure_with_http_info(id, opts)
182
+ nil
183
+ end
184
+
185
+ # Deprecate unit of measure
186
+ # Deprecates the specified unit of measure making it unavailable to be attached to charges going forward
187
+ # @param id
188
+ # @param [Hash] opts the optional parameters
189
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
190
+ def deprecate_unit_of_measure_with_http_info(id, opts = {})
191
+ if @api_client.config.debugging
192
+ @api_client.config.logger.debug 'Calling API: SettingsApi.deprecate_unit_of_measure ...'
193
+ end
194
+ # verify the required parameter 'id' is set
195
+ if @api_client.config.client_side_validation && id.nil?
196
+ fail ArgumentError, "Missing the required parameter 'id' when calling SettingsApi.deprecate_unit_of_measure"
197
+ end
198
+ # resource path
199
+ local_var_path = '/unitsOfMeasure/{id}/deprecate'.sub('{' + 'id' + '}', id.to_s)
200
+
201
+ # query parameters
202
+ query_params = {}
203
+
204
+ # header parameters
205
+ header_params = {}
206
+ # HTTP header 'Accept' (if needed)
207
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
208
+
209
+ # form parameters
210
+ form_params = {}
211
+
212
+ # http body (model)
213
+ post_body = nil
214
+ auth_names = ['ApiKeyAuth']
215
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
216
+ :header_params => header_params,
217
+ :query_params => query_params,
218
+ :form_params => form_params,
219
+ :body => post_body,
220
+ :auth_names => auth_names)
221
+ if @api_client.config.debugging
222
+ @api_client.config.logger.debug "API called: SettingsApi#deprecate_unit_of_measure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
223
+ end
224
+ return data, status_code, headers
225
+ end
226
+ # Get units of measure
227
+ # Returns a paginated list of units of measure
228
+ # @param [Hash] opts the optional parameters
229
+ # @option opts [String] :cursor
230
+ # @option opts [Integer] :limit
231
+ # @return [UnitOfMeasurePaginationResponseJson]
232
+ def get_units_of_measure(opts = {})
233
+ data, _status_code, _headers = get_units_of_measure_with_http_info(opts)
234
+ data
235
+ end
236
+
237
+ # Get units of measure
238
+ # Returns a paginated list of units of measure
239
+ # @param [Hash] opts the optional parameters
240
+ # @option opts [String] :cursor
241
+ # @option opts [Integer] :limit
242
+ # @return [Array<(UnitOfMeasurePaginationResponseJson, Fixnum, Hash)>] UnitOfMeasurePaginationResponseJson data, response status code and response headers
243
+ def get_units_of_measure_with_http_info(opts = {})
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug 'Calling API: SettingsApi.get_units_of_measure ...'
246
+ end
247
+ # resource path
248
+ local_var_path = '/unitsOfMeasure'
249
+
250
+ # query parameters
251
+ query_params = {}
252
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
253
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
254
+
255
+ # header parameters
256
+ header_params = {}
257
+ # HTTP header 'Accept' (if needed)
258
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
259
+
260
+ # form parameters
261
+ form_params = {}
262
+
263
+ # http body (model)
264
+ post_body = nil
265
+ auth_names = ['ApiKeyAuth']
266
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
267
+ :header_params => header_params,
268
+ :query_params => query_params,
269
+ :form_params => form_params,
270
+ :body => post_body,
271
+ :auth_names => auth_names,
272
+ :return_type => 'UnitOfMeasurePaginationResponseJson')
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug "API called: SettingsApi#get_units_of_measure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
275
+ end
276
+ return data, status_code, headers
277
+ end
278
+ # Update unit of measure
279
+ # Update the unit of measure by Id provided.
280
+ # @param id
281
+ # @param [Hash] opts the optional parameters
282
+ # @option opts [UnitOfMeasureJson] :body
283
+ # @return [UnitOfMeasureJson]
284
+ def update_unit_of_measure(id, opts = {})
285
+ data, _status_code, _headers = update_unit_of_measure_with_http_info(id, opts)
286
+ data
287
+ end
288
+
289
+ # Update unit of measure
290
+ # Update the unit of measure by Id provided.
291
+ # @param id
292
+ # @param [Hash] opts the optional parameters
293
+ # @option opts [UnitOfMeasureJson] :body
294
+ # @return [Array<(UnitOfMeasureJson, Fixnum, Hash)>] UnitOfMeasureJson data, response status code and response headers
295
+ def update_unit_of_measure_with_http_info(id, opts = {})
296
+ if @api_client.config.debugging
297
+ @api_client.config.logger.debug 'Calling API: SettingsApi.update_unit_of_measure ...'
298
+ end
299
+ # verify the required parameter 'id' is set
300
+ if @api_client.config.client_side_validation && id.nil?
301
+ fail ArgumentError, "Missing the required parameter 'id' when calling SettingsApi.update_unit_of_measure"
302
+ end
303
+ # resource path
304
+ local_var_path = '/unitsOfMeasure/{id}'.sub('{' + 'id' + '}', id.to_s)
305
+
306
+ # query parameters
307
+ query_params = {}
308
+
309
+ # header parameters
310
+ header_params = {}
311
+ # HTTP header 'Accept' (if needed)
312
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
313
+
314
+ # form parameters
315
+ form_params = {}
316
+
317
+ # http body (model)
318
+ post_body = @api_client.object_to_http_body(opts[:'body'])
319
+ auth_names = ['ApiKeyAuth']
320
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
321
+ :header_params => header_params,
322
+ :query_params => query_params,
323
+ :form_params => form_params,
324
+ :body => post_body,
325
+ :auth_names => auth_names,
326
+ :return_type => 'UnitOfMeasureJson')
327
+ if @api_client.config.debugging
328
+ @api_client.config.logger.debug "API called: SettingsApi#update_unit_of_measure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
329
+ end
330
+ return data, status_code, headers
331
+ end
332
+ end
333
+ end