Class: StickyIoRestfulApiV2025731::SubscriptionController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb

Overview

SubscriptionController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from StickyIoRestfulApiV2025731::BaseController

Instance Method Details

#get_child_subscription(domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 204

def get_child_subscription(domain,
                           v3_ext,
                           new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}/child',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetChildSubscription.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_next_shipment_positions(domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 46

def get_next_shipment_positions(domain,
                                v3_ext,
                                new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}/next-positions',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetNextShipmentPositions.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_parent_subscription(domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 173

def get_parent_subscription(domain,
                            v3_ext,
                            new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}/parent',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetParentSubscription.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_subscription(domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 15

def get_subscription(domain,
                     v3_ext,
                     new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetSubscriptionGetSubscription.method(:from_hash))
                .is_api_response(true))
    .execute
end

#reschedule_subscription(body, domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here description here here

Parameters:

  • body (RescheduleSubscriptionRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 237

def reschedule_subscription(body,
                            domain,
                            v3_ext,
                            new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}/reschedule',
                                 Server::SERVER_1)
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(RescheduleSubscription.method(:from_hash))
                .is_api_response(true))
    .execute
end

#resume_subscription(domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 111

def resume_subscription(domain,
                        v3_ext,
                        new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}/resume',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ResumeSubscription.method(:from_hash))
                .is_api_response(true))
    .execute
end

#skip_next_shipment_positions(domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 142

def skip_next_shipment_positions(domain,
                                 v3_ext,
                                 new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}/skip',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SkipNextShipmentPositions.method(:from_hash))
                .is_api_response(true))
    .execute
end

#stop_subscription(domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 77

def stop_subscription(domain,
                      v3_ext,
                      new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}/stop',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(StopSubscription.method(:from_hash))
                .is_api_response(true)
                .local_error('404',
                             'Not Found',
                             StopSubscriptionStopSubscriptionException))
    .execute
end

#update_subscription(body, domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here description here here

Parameters:

  • body (UpdateSubscriptionRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 275

def update_subscription(body,
                        domain,
                        v3_ext,
                        new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}/update',
                                 Server::SERVER_1)
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(UpdateSubscriptionRecurringDayWithUseNewDayFlagBillingModelId.method(:from_hash))
                .is_api_response(true))
    .execute
end

#update_subscription_frequency(body, domain, v3_ext, new_sub_id) ⇒ ApiResponse

TODO: type endpoint description here type description here here

Parameters:

  • body (UpdateSubscriptionFrequencyRequest)

    Required parameter: TODO:

  • domain (String)

    Required parameter: TODO: type description here

  • v3_ext (String)

    Required parameter: TODO: type description here

  • new_sub_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/sticky_io_restful_api_v2025731/controllers/subscription_controller.rb', line 313

def update_subscription_frequency(body,
                                  domain,
                                  v3_ext,
                                  new_sub_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v3_ext}subscriptions/{new_sub_id}/updateFrequency',
                                 Server::SERVER_1)
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v3_ext, key: 'v3_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(new_sub_id, key: 'new_sub_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(UpdateSubscriptionFrequency.method(:from_hash))
                .is_api_response(true))
    .execute
end