Class: StickyIoRestfulApiV2025731::LineItemCustomOptionsController
- Inherits:
-
BaseController
- Object
- BaseController
- StickyIoRestfulApiV2025731::LineItemCustomOptionsController
- Defined in:
- lib/sticky_io_restful_api_v2025731/controllers/line_item_custom_options_controller.rb
Overview
LineItemCustomOptionsController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_update_line_item_custom_options(body, domain, v2_ext, subscription_id) ⇒ ApiResponse
Create or update line item custom options associated with a subscription ID.
-
#delete_line_item_custom_option(body, domain, v2_ext, subscription_id) ⇒ ApiResponse
Delete a line item custom option associated with a subscription ID.
-
#filter_line_item_custom_options(domain, v2_ext) ⇒ ApiResponse
Filter LineItemCustomOptions by any combination of the the following fields: ‘name` `value` `subscription_id` `order_id`.
-
#get_line_item_custom_options(order_id, domain, v2_ext, subscription_id) ⇒ ApiResponse
Fetch a list of line item custom items associated with a subscription ID.
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_update_line_item_custom_options(body, domain, v2_ext, subscription_id) ⇒ ApiResponse
Create or update line item custom options associated with a subscription ID. If ‘order_id` is not passed, then the platform will select the latest order on the subscription. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description
|
| —————- | ———– | ——- | ——— | ————————————– | | order_id | Optional | - | Integer | The (main) order ID associated with the subscription. If this parameter is not passed, then the platform will select the latest order on the subscription. | | options | Required | - | Array | An array of line item custom option objects. | | options.*.id | Optional | - | Integer | The line item custom option ID. If ‘name` or `value` is passed then the platform will perform an update on these values. | | options.*.name | Conditional | - | Integer | The line item custom option name. This field is required if `id` is not passed. | | options.*.value | Conditional | - | Integer | The line item custom option value. This field is required if `id` is not passed. | **Response Data**\ Response parameters expected in each line item custom option object contained within the `data` field array: | Field | Data Type | Description | | ————— | ——— | ————————————– | | id | Integer | The line item custom option ID. | | subscription_id | String | The line item subscription ID. | | name | String | The line item custom option name. | | value | String | The line item custom option value. | | order_id | Integer | The order_id associated with the line item. NOTE: If order_type_id is 2, this value is not the main order ID, and not displayed in the graphical user interface. | | order_type_id | Integer | The order type ID associated with the line item. NOTE: If order_type_id is 2, then the order_id value is not the main order ID, and not displayed in the graphical user interface. | | created_by | Integer | The user ID that created the line item custom option. | | updated_by | Integer | The user ID that last updated the line item custom option. | | created_at | String | A timestamp that represents when the line item custom option was created. | | updated_at | String | A timestamp that represents when the line item custom option was last updated. | TODO: type description here here
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 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_custom_options_controller.rb', line 131 def (body, domain, v2_ext, subscription_id) @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/.{domain}{v2_ext}subscriptions/{subscription_id}/line-item-options', 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(v2_ext, key: 'v2_ext') .is_required(true) .should_encode(true)) .template_param(new_parameter(subscription_id, key: 'subscription_id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type')) .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_line_item_custom_option(body, domain, v2_ext, subscription_id) ⇒ ApiResponse
Delete a line item custom option associated with a subscription ID. If order_id is not passed, then the platform will select the latest order on the subscription. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description
|
| ——– | ———– | ——- | ———— | ————————————– | | order_id | Optional | - | Integer | The (main) order ID associated with the subscription. If this parameter is not passed, then the platform will select the latest order on the subscription. | type description here here
178 179 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 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_custom_options_controller.rb', line 178 def delete_line_item_custom_option(body, domain, v2_ext, subscription_id) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/.{domain}{v2_ext}subscriptions/{subscription_id}/line-item-options/10', 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(v2_ext, key: 'v2_ext') .is_required(true) .should_encode(true)) .template_param(new_parameter(subscription_id, key: 'subscription_id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type')) .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 |
#filter_line_item_custom_options(domain, v2_ext) ⇒ ApiResponse
Filter LineItemCustomOptions by any combination of the the following fields: ‘name` `value` `subscription_id` `order_id`
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_custom_options_controller.rb', line 215 def (domain, v2_ext) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}subscriptions/line-item-options/filter', 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_line_item_custom_options(order_id, domain, v2_ext, subscription_id) ⇒ ApiResponse
Fetch a list of line item custom items associated with a subscription ID. If order ID is not passed, then the platform will select the latest order associated with the subscription.\ **Request Data**\ URL Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description
|
| ——– | ———– | ——- | ———— | ————————————– | | order_id | Optional | - | Integer | The (main) order ID associated with the subscription. If this parameter is not passed, then the platform will select the latest order on the subscription. | **Response Data**\ Response parameters expected in each line item custom option object contained within the ‘data` field array: | Field | Data Type | Description | | ————— | ——— | ————————————– | | id | Integer | The line item custom option ID. | | subscription_id | String | The line item subscription ID. | | name | String | The line item custom option name. | | value | String | The line item custom option value. | | order_id | Integer | The order_id associated with the line item. NOTE: If order_type_id is 2, this value is NOT the main order ID, and not displayed in the graphical user interface. | | order_type_id | Integer | The order type ID associated with the line item. This field has a default value of 1. NOTE: If order_type_id is 2, then the order_id value is NOT the main order ID, and not displayed in the graphical user interface. | | created_by | Integer | The user ID that created the line item custom option. | | updated_by | Integer | The user ID that last updated the line item custom option. | | created_at | String | A timestamp that represents when the line item custom option was created. | | updated_at | String | A timestamp that represents when the line item custom option was last updated. | represents the order ID associated with the subscription ID provided in the URL. here
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_custom_options_controller.rb', line 53 def (order_id, domain, v2_ext, subscription_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}subscriptions/{subscription_id}/line-item-options', Server::SERVER_1) .query_param(new_parameter(order_id, key: 'order_id') .is_required(true)) .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(subscription_id, key: 'subscription_id') .is_required(true) .should_encode(true)) .auth(Single.new('basic'))) .response(new_response_handler .is_response_void(true) .is_api_response(true)) .execute end |