Class: StickyIoRestfulApiV2025731::TypesController
- Inherits:
-
BaseController
- Object
- BaseController
- StickyIoRestfulApiV2025731::TypesController
- Defined in:
- lib/sticky_io_restful_api_v2025731/controllers/types_controller.rb
Overview
TypesController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_shipping_type(body, domain, v2_ext) ⇒ ApiResponse
Create a shipping type.
-
#delete_shipping_type(domain, v2_ext, shipping_id) ⇒ ApiResponse
Delete an existing shipping type.
-
#get_history_note_types(domain, v2_ext) ⇒ ApiResponse
A method to GET the different History Note Types.
-
#get_note_template_types(domain, v2_ext) ⇒ ApiResponse
A method to GET the different History Note Template Types.
-
#get_shipping_price_types(domain, v2_ext) ⇒ ApiResponse
Retrieve a list of shipping price types.
-
#get_shipping_type(domain, v2_ext, shipping_id) ⇒ ApiResponse
Fetch a specific shipping type object by ID.
-
#get_shipping_types(domain, v2_ext) ⇒ ApiResponse
Fetch a list of shipping type objects.
-
#update_shipping_type(body, domain, v2_ext) ⇒ ApiResponse
Update an existing shipping type.
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_shipping_type(body, domain, v2_ext) ⇒ ApiResponse
Create a shipping type. **Request Data** Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | — | — | — | — | — | | name | Required | - | String | The shipping type name. | | code | Required | - | String | The shipping type code. | description here
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/types_controller.rb', line 223 def create_shipping_type(body, domain, v2_ext) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/.{domain}{v2_ext}shipping_type', 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)) .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(CreateShippingType.method(:from_hash)) .is_api_response(true)) .execute end |
#delete_shipping_type(domain, v2_ext, shipping_id) ⇒ ApiResponse
Delete an existing shipping type. here
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/types_controller.rb', line 293 def delete_shipping_type(domain, v2_ext, shipping_id) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/.{domain}{v2_ext}shipping/{shipping_id}', 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)) .template_param(new_parameter(shipping_id, key: 'shipping_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(DeleteShippingType.method(:from_hash)) .is_api_response(true)) .execute end |
#get_history_note_types(domain, v2_ext) ⇒ ApiResponse
A method to GET the different History Note Types. **Response Data**\ Response parameters expected in each history note type object contained within the ‘data` field array: | Field | Data Type | Description
|
| ————————————— | ———— | ————————————– | | name | String | The history note type name. |
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/types_controller.rb', line 22 def get_history_note_types(domain, v2_ext) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}orders/histories/notes/types', 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)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(GetHistoryNoteTypes.method(:from_hash)) .is_api_response(true)) .execute end |
#get_note_template_types(domain, v2_ext) ⇒ ApiResponse
A method to GET the different History Note Template Types. **Response Data**\ Response parameters expected in each history note template object contained within the ‘data` field array: | Field | Data Type | Description
|
| ————————————— | ———— | ————————————– | | id | Integer | The history note template ID. | | name | String | The history note template name. | | description | String | The history note template description. |
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/types_controller.rb', line 61 def get_note_template_types(domain, v2_ext) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}orders/histories/notes/templates/types', 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)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(GetNoteTemplateTypes.method(:from_hash)) .is_api_response(true)) .execute end |
#get_shipping_price_types(domain, v2_ext) ⇒ ApiResponse
Retrieve a list of shipping price types. These types specify how an order will determine its shipping price. **Type IDs** | ID | Name | Description
|
| — | ———— |
———- | | 1 | Default | System default, use the shipping method profile settings to determine shipping price. | | 2 | Initial | Use the initial price specified in the shipping method profile. | | 3 | Subscription | Use the subscription price specified in the shipping method profile. | | 4 | Custom | Use a custom price consumed from an external source or related module. | **Response Data** Response parameters expected in each shipping price type object contained within the ‘data` field array: | Field | Data Type | Description | | ———— | ———— | ————————————– | | id | Integer | The shipping price type ID. | | name | String | The shipping price type name. | | active | Integer Flag | The shipping price type active status. |
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/types_controller.rb', line 190 def get_shipping_price_types(domain, v2_ext) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}shipping-price-types', 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)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(GetShippingPriceTypes.method(:from_hash)) .is_api_response(true)) .execute end |
#get_shipping_type(domain, v2_ext, shipping_id) ⇒ ApiResponse
Fetch a specific shipping type object by ID. **Response Data** Response parameters expected in the shipping type object contained within the data field object: | Field | Data Type | Description | | — | — | — | | id | Integer | The shipping type ID. | | name | String | The shipping type name. | | code | String | The shipping type code. | | created_at | String | A timestamp that represents when the shipping type was created. | | updated_at | String | A timestamp that represents when the shipping type was last updated. | here
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/types_controller.rb', line 138 def get_shipping_type(domain, v2_ext, shipping_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}shipping_type/{shipping_id}', 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)) .template_param(new_parameter(shipping_id, key: 'shipping_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(GetShippingType.method(:from_hash)) .is_api_response(true)) .execute end |
#get_shipping_types(domain, v2_ext) ⇒ ApiResponse
Fetch a list of shipping type objects. **Response Data** Response parameters expected in each shipping type object contained within the ‘data` field array: | Field | Data Type | Description | | — | — | — | | id | Integer | The shipping type ID. | | name | String | The shipping type name. | | code | String | The shipping type code. | | created_at | String | A timestamp that represents when the shipping type was created. | | updated_at | String | A timestamp that represents when the shipping type was last updated. |
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/types_controller.rb', line 99 def get_shipping_types(domain, v2_ext) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/.{domain}{v2_ext}shipping_type', 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)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('basic'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(GetShippingTypes.method(:from_hash)) .is_api_response(true)) .execute end |
#update_shipping_type(body, domain, v2_ext) ⇒ ApiResponse
Update an existing shipping type. **Request Data** Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | — | — | — | — | — | | name | Required | - | String | The shipping type name. | | code | Required | - | String | The shipping type code. | description here
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/sticky_io_restful_api_v2025731/controllers/types_controller.rb', line 261 def update_shipping_type(body, domain, v2_ext) @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/.{domain}{v2_ext}shipping_type/5', 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)) .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(UpdateShippingType.method(:from_hash)) .is_api_response(true)) .execute end |