Class: StickyIoRestfulApiV2025731::TrialWorkflowsController

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

Overview

TrialWorkflowsController

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

#copy_trial_workflow(domain, v2_ext) ⇒ ApiResponse

Copy a trial workflow.

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/sticky_io_restful_api_v2025731/controllers/trial_workflows_controller.rb', line 278

def copy_trial_workflow(domain,
                        v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}trial-workflows/1/copy',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#create_trial_workflow(body, domain, v2_ext) ⇒ ApiResponse

Create a trial workflow. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | ——————————— | ——– | — | ———— | ————————————– | | name | Required | - | String | The trial workflow name. | | is_active | Optional | 1 | Integer Flag | The trial workflow active status. | | units | Required | - | Array | Array of trial workflow unit objects associated with this trial workflow. | | units.*.step_number | Required | - | Integer | The step number in which this trial workflow unit’s configurations will be enforced. | | units.*.name | Required | - | String | The trial workflow unit name. | | units.*.duration | Optional | ‘null` | Integer | The amount of days used to determine the next recurring date during this trial workflow unit’s billing event. | | units.*.price | Optional | ‘null` | Float | Custom line item price to be charged during this trial workflow unit’s billing event. | | units.*.product_id | Optional | 1 | Integer | Custom product ID to be selected for purchase during this trial workflow unit’s billing event. | | units.*.is_shippable | Optional | 1 | Integer Flag | Specifies whether or not a line item will ship during this trial workflow unit’s billing event. | | units.*.is_notifiable | Optional | 1 | Integer Flag | Specifies whether or not an order confirmation email will get sent during this trial workflow unit’s billing event. | | units.*.is_one_time_pairable | Optional | 1 | Integer Flag | Specifies if one time paired products can be attached during this trial workflow unit’s billing event. | | units.*.is_parent_cancellable | Optional | 0 | Integer Flag | Specified whether or not to refund the parent order associated with this trial workflow unit’s billing event. | | units.*.shipping_price_type_id | Optional | 1 | Integer | An identifier that tells the system how to determine the shipping charge on a specified trial workflow unit. See Get Shipping Price Type API for allowed values. | | units.*.shipping_price | Required Sometimes | ‘null` | Float

| The custom shipping price to be used on this trial workflow unit.

Applicable when shipping_price_type_id is 4. | description here

Parameters:

  • body (CreateTrialWorkflowRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/sticky_io_restful_api_v2025731/controllers/trial_workflows_controller.rb', line 250

def create_trial_workflow(body,
                          domain,
                          v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}trial-workflows',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .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(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#delete_trial_workflow(domain, v2_ext) ⇒ ApiResponse

Delete an existing trial workflow.

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/sticky_io_restful_api_v2025731/controllers/trial_workflows_controller.rb', line 385

def delete_trial_workflow(domain,
                          v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/.{domain}{v2_ext}trial-workflows/1',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_one_trial_workflow(domain, v2_ext) ⇒ ApiResponse

Fetch a specific trial workflow object by ID. **Response Data**\ Response parameters expected in the trial workflow object contained within the data field object: | Field | Data Type | Description

|

| ————————————— | ———— | ————————————– | | id | Integer | The trial workflow ID.

|

| name | String | The trial workflow name. | | is_active | Integer Flag | The trial workflow active status. | | is_deleted | Integer Flag | The trial workflow deleted status. | | created_by | Integer | The user ID that created the trial workflow. | | updated_by | Integer | The user ID that last updated the trial workflow. | | created_at | String | A timestamp that represents when the trial workflow was created. | | updated_at | String | A timestamp that represents when the trial workflow was last updated. | | units | Array | Array of trial workflow unit objects associated with this trial workflow. | | units.*.id | Integer | The trial workflow unit ID. | | units.*.trial_workflow_id | Integer | The trial workflow ID associated with this trial workflow unit. | | units.*.step_number | Integer | The step number in which this trial workflow unit’s configurations will be enforced. | | units.*.name | String | The trial workflow unit name. | | units.*.duration | Integer | The amount of days used to determine the next recurring date during this trial workflow unit’s billing event. | | units.*.price | Float | Custom line item price to be charged during this trial workflow unit’s billing event. | | units.*.product_id | Integer | Custom product ID to be selected for purchase during this trial workflow unit’s billing event. | | units.*.is_shippable | Integer Flag | Specifies whether or not a line item will ship during this trial workflow unit’s billing event. | | units.*.is_notifiable | Integer Flag | Specifies whether or not an order confirmation email will get sent during this trial workflow unit’s billing event. | | units.*.is_one_time_pairable | Integer Flag | Specifies if one time paired products can be attached during this trial workflow unit’s billing event. | | units.*.is_active | Integer Flag | The trial workflow unit active status. | | units.*.is_deleted | Integer Flag | The trial workflow unit deleted status. | | units.*.created_by | Integer | The user ID that created the trial workflow unit. | | units.*.updated_by | Integer | The user ID that last updated the trial workflow unit. | | units.*.created_at | String | A timestamp that represents when the trial workflow unit was created. | | units.*.updated_at | String | A timestamp that represents when the trial workflow unit was last updated. | | units.*.is_parent_cancellable | Integer Flag | Specified whether or not to refund the parent order associated with this trial workflow unit’s billing event. | | units.*.shipping_price_type_id | Integer | An identifier that tells the system how to determine the shipping charge on a specified trial workflow unit. See Get Shipping Price Type API for allowed values. | | units.*.shipping_price | Float | The custom shipping price to be used on this trial workflow unit. Applicable when shipping_price_type_id is 4. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/sticky_io_restful_api_v2025731/controllers/trial_workflows_controller.rb', line 179

def get_one_trial_workflow(domain,
                           v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}trial-workflows/1',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_trial_workflows(domain, v2_ext) ⇒ ApiResponse

Fetch a list of trial workflow objects. **Response Data**\ Response parameters expected in each trial workflow object contained within the ‘data` field array: | Field | Data Type | Description

|

| ————————————— | ———— | ————————————– | | id | Integer | The trial workflow ID.

|

| name | String | The trial workflow name. | | is_active | Integer Flag | The trial workflow active status. | | is_deleted | Integer Flag | The trial workflow deleted status. | | created_by | Integer | The user ID that created the trial workflow. | | updated_by | Integer | The user ID that last updated the trial workflow. | | created_at | String | A timestamp that represents when the trial workflow was created. | | updated_at | String | A timestamp that represents when the trial workflow was last updated. | | units | Array | Array of trial workflow unit objects associated with this trial workflow. | | units.*.id | Integer | The trial workflow unit ID. | | units.*.trial_workflow_id | Integer | The trial workflow ID associated with this trial workflow unit. | | units.*.step_number | Integer | The step number in which this trial workflow unit’s configurations will be enforced. | | units.*.name | String | The trial workflow unit name. | | units.*.duration | Integer | The amount of days used to determine the next recurring date during this trial workflow unit’s billing event. | | units.*.price | Float | Custom line item price to be charged during this trial workflow unit’s billing event. | | units.*.product_id | Integer | Custom product ID to be selected for purchase during this trial workflow unit’s billing event. | | units.*.is_shippable | Integer Flag | Specifies whether or not a line item will ship during this trial workflow unit’s billing event. | | units.*.is_notifiable | Integer Flag | Specifies whether or not an order confirmation email will get sent during this trial workflow unit’s billing event. | | units.*.is_one_time_pairable | Integer Flag | Specifies if one time paired products can be attached during this trial workflow unit’s billing event. | | units.*.is_active | Integer Flag | The trial workflow unit active status. | | units.*.is_deleted | Integer Flag | The trial workflow unit deleted status. | | units.*.created_by | Integer | The user ID that created the trial workflow unit. | | units.*.updated_by | Integer | The user ID that last updated the trial workflow unit. | | units.*.created_at | String | A timestamp that represents when the trial workflow unit was created. | | units.*.updated_at | String | A timestamp that represents when the trial workflow unit was last updated. | | units.*.is_parent_cancellable | Integer Flag | Specified whether or not to refund the parent order associated with this trial workflow unit’s billing event. | | units.*.shipping_price_type_id | Integer | An identifier that tells the system how to determine the shipping charge on a specified trial workflow unit. See Get Shipping Price Type API for allowed values. | | units.*.shipping_price | Float | The custom shipping price to be used on this trial workflow unit. Applicable when shipping_price_type_id is 4. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/sticky_io_restful_api_v2025731/controllers/trial_workflows_controller.rb', line 84

def get_trial_workflows(domain,
                        v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}trial-workflows',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#relate_many_to_offer(body, domain, v2_ext) ⇒ ApiResponse

Associate 1 or more trial workflows to a single offer. **Request Data** Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| —————– | ———– | ——- | ———— | ————————————– | | ids | Required | - | Array | An array of objects specifying offers to associate. | | ids.*.id | Required | - | Integer | The offer ID that will relate to trial workflow associated with this API request. | | ids.*.is_default | Optional | 0 | Integer Flag | Specifies whether or not the trial workflow associated with this request will be the default trial workflow for the offer associated with this request. | description here

Parameters:

  • body (RelateManyToOfferRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
# File 'lib/sticky_io_restful_api_v2025731/controllers/trial_workflows_controller.rb', line 463

def relate_many_to_offer(body,
                         domain,
                         v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}trial-workflow-offer/184/relate',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .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(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#relate_to_offer(body, domain, v2_ext) ⇒ ApiResponse

Associate a trial workflow to an offer. **Request Data** A request body is not required for this API call. However, you can send the following request parameter(s): | Field | Requirement | Default | Data Type | Description

|

| ———- | ———– | ——- | ———— | ————————————– | | is_default | Optional | 0 | Integer Flag | Specifies whether or not the trial workflow associated with this request will be the default trial workflow for the offer associated with this request. | description here

Parameters:

  • body (RelateToOfferRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/sticky_io_restful_api_v2025731/controllers/trial_workflows_controller.rb', line 420

def relate_to_offer(body,
                    domain,
                    v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}trial-workflows/1/offer/196',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .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(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#unrelate_from_offer(domain, v2_ext) ⇒ ApiResponse

Break the association between a trial workflow and an existing offer.

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
# File 'lib/sticky_io_restful_api_v2025731/controllers/trial_workflows_controller.rb', line 491

def unrelate_from_offer(domain,
                        v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/.{domain}{v2_ext}trial-workflows/1/offer/196',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#update_trial_workflow(body, domain, v2_ext) ⇒ ApiResponse

Update an existing trial workflow. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | ——————————— | ——– | — | ———— | ————————————– | | replace | Optional | 0 | Integer Flag | Specifies whether or not to append or replace trial workflow units passed in the ‘units` array. | | name | Optional | - | String | The trial workflow name. | | is_active | Optional | 1 | Integer Flag | The trial workflow active status. | | units | Required | - | Array | Array of trial workflow unit objects associated with this trial workflow. | | units.*.id | Optional | - | Integer | The trial workflow unit ID. Only specify this parameter when you want to update an existing trial workflow unit within the trial workflow. | | units.*.step_number | Required Sometimes | - | Integer

| The step number in which this trial workflow unit's configurations will

be enforced. Required when ‘id` is specified in a given trial workflow unit object. | | units.*.name | Required Sometimes | - | String

| The trial workflow unit name. Required when `id` is specified in a

given trial workflow unit object. | | units.*.duration | Optional | ‘null` | Integer | The amount of days used to determine the next recurring date during this trial workflow unit’s billing event. | | units.*.price | Optional | ‘null` | Float | Custom line item price to be charged during this trial workflow unit’s billing event. | | units.*.product_id | Optional | 1 | Integer | Custom product ID to be selected for purchase during this trial workflow unit’s billing event. | | units.*.is_shippable | Optional | 1 | Integer Flag | Specifies whether or not a line item will ship during this trial workflow unit’s billing event. | | units.*.is_notifiable | Optional | 1 | Integer Flag | Specifies whether or not an order confirmation email will get sent during this trial workflow unit’s billing event. | | units.*.is_one_time_pairable | Optional | 1 | Integer Flag | Specifies if one time paired products can be attached during this trial workflow unit’s billing event. | | units.*.is_parent_cancellable | Optional | 0 | Integer Flag | Specified whether or not to refund the parent order associated with this trial workflow unit’s billing event. | | units.*.shipping_price_type_id | Optional | 1 | Integer | An identifier that tells the system how to determine the shipping charge on a specified trial workflow unit. See Get Shipping Price Type API for allowed values. | | units.*.shipping_price | Required Sometimes | ‘null` | Float

| The custom shipping price to be used on this trial workflow unit.

Applicable when shipping_price_type_id is 4. | description here

Parameters:

  • body (UpdateTrialWorkflowRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/sticky_io_restful_api_v2025731/controllers/trial_workflows_controller.rb', line 357

def update_trial_workflow(body,
                          domain,
                          v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}trial-workflows/4',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .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(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end