Class: StickyIoRestfulApiV2025731::ConfigurationsController

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

Overview

ConfigurationsController

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

#create_configuration(body, domain, v2_ext, offer_id) ⇒ ApiResponse

Create a new offer configuration. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | name | Required | - | String | The configuration name. Accepted values are strings length between 1-255 | billing_model_id | Optional | - | Integer | The billing model ID for the offer configuration. | product_id | Optional | - | Integer | The product ID for the offer configuration. | default_quantity | Optional | - | Integer | Default quantity for the product. | price | Optional| - | Float | Price for the product | is_upsell | Optional | - | Integer flag | Specifies wether or not it is an upsell | step_number | Optional | - | Integer | The step number in which the offer configuration will be applied description here

Parameters:

  • body (CreateConfigurationRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • offer_id (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/sticky_io_restful_api_v2025731/controllers/configurations_controller.rb', line 131

def create_configuration(body,
                         domain,
                         v2_ext,
                         offer_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}offers/{offer_id}/configurations',
                                 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))
               .template_param(new_parameter(offer_id, key: 'offer_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('bearer')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CreateConfiguration.method(:from_hash))
                .is_api_response(true))
    .execute
end

#delete_configuration(domain, v2_ext, offer_id, offer_configuration_id) ⇒ ApiResponse

Delete an existing offer configuration. description here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • offer_id (String)

    Required parameter: TODO: type description here

  • offer_configuration_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/sticky_io_restful_api_v2025731/controllers/configurations_controller.rb', line 16

def delete_configuration(domain,
                         v2_ext,
                         offer_id,
                         offer_configuration_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/.{domain}{v2_ext}offers/{offer_id}/configurations/{offer_configuration_id}',
                                 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))
               .template_param(new_parameter(offer_id, key: 'offer_id')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(offer_configuration_id, key: 'offer_configuration_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(DeleteConfiguration.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_configuration(domain, v2_ext, offer_id, offer_configuration_id) ⇒ ApiResponse

Fetch a specific offer configuration object by ID. **Response Data**\ Response parameters expected in the configuration object contained within the data field object: | Field | Data Type | Description | | - | - | - | | id | Integer | The configuration ID. | name | String | The configuration name. | default_quantity | Integer | Default quantity for the configuration | price | Float | Price for the configuration | is_upsell | Integer flag | Specifies wether or not it is an upsell | step_number | Integer | The step number in which the offer configuration will be applied description here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • offer_id (String)

    Required parameter: TODO: type description here

  • offer_configuration_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/sticky_io_restful_api_v2025731/controllers/configurations_controller.rb', line 180

def get_configuration(domain,
                      v2_ext,
                      offer_id,
                      offer_configuration_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}offers/{offer_id}/configurations/{offer_configuration_id}',
                                 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))
               .template_param(new_parameter(offer_id, key: 'offer_id')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(offer_configuration_id, key: 'offer_configuration_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(GetConfiguration.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_configurations(domain, v2_ext, offer_id) ⇒ ApiResponse

Returns a list of all the offer configuration objects. **Response Data**\ Response parameters expected in the configuration object contained within the data field array: | Field | Data Type | Description | | - | - | - | | id | Integer | The configuration ID. | name | String | The configuration name. | default_quantity | Integer | Default quantity for the configuration | price | Float | Price for the configuration | is_upsell | Integer flag | Specifies wether or not it is an upsell | step_number | Integer | The step number in which the offer configuration will be applied

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • offer_id (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/sticky_io_restful_api_v2025731/controllers/configurations_controller.rb', line 227

def get_configurations(domain,
                       v2_ext,
                       offer_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}offers/{offer_id}/configurations',
                                 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))
               .template_param(new_parameter(offer_id, key: 'offer_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(GetConfigurations.method(:from_hash))
                .is_api_response(true))
    .execute
end

#update_configuration(body, domain, v2_ext, offer_id, offer_configuration_id) ⇒ ApiResponse

Update an existing offer configuration. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | name | Required | - | String | The configuration name. Accepted values are strings length between 1-255 | billing_model_id | Optional | - | Integer | The billing model ID for the offer configuration. | product_id | Optional | - | Integer | The product ID for the offer configuration. | default_quantity | Optional | - | Integer | Default quantity for the product. | price | Optional| - | Float | Price for the product | trial_product_id | Optional | - | Integer | The Trial Product ID. | is_upsell | Optional | - | Integer flag | Specifies wether or not it is an upsell | step_number | Optional | - | Integer | The step number in which the offer configuration will be applied description here description here

Parameters:

  • body (UpdateConfigurationRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • offer_id (String)

    Required parameter: TODO: type description here

  • offer_configuration_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



73
74
75
76
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
104
105
# File 'lib/sticky_io_restful_api_v2025731/controllers/configurations_controller.rb', line 73

def update_configuration(body,
                         domain,
                         v2_ext,
                         offer_id,
                         offer_configuration_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}offers/{offer_id}/configurations/{offer_configuration_id}',
                                 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))
               .template_param(new_parameter(offer_id, key: 'offer_id')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(offer_configuration_id, key: 'offer_configuration_id')
                                .is_required(true)
                                .should_encode(true))
               .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(UpdateConfiguration.method(:from_hash))
                .is_api_response(true))
    .execute
end