Class: StickyIoRestfulApiV2025731::NotesController

Inherits:
BaseController show all
Defined in:
lib/sticky_io_restful_api_v2025731/controllers/notes_controller.rb

Overview

NotesController

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_history_notes(start_at, end_at, domain, v2_ext) ⇒ ApiResponse

Query method to GET history notes added between a given period of time. MAX time is 30 days. Results will be paginated. **Response Data**\ Response parameters expected in each History Note object contained within the ‘data` field array: | Field | Data Type | Description

|

| ————————————— | ———— | ————————————– | | order_id | Integer | The History Note ID. | | message | Integer | The History Note message. | | created_at | Object | Contains details of when the History Note was created. | | created_at.date | String | A timestamp when the History Note was created. | | created_at.timezone_type | Integer | The timezone type number where the History Note was created.

|

| created_at.timezone | String | The name of the timezone where the History Note was created.

|

| author | Integer | The History Note author ID. | | type_name | String | The History Note type name.

Parameters:

  • start_at (String)

    Required parameter: TODO: type description here

  • end_at (String)

    Required parameter: TODO: type description here

  • 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.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/sticky_io_restful_api_v2025731/controllers/notes_controller.rb', line 41

def get_history_notes(start_at,
                      end_at,
                      domain,
                      v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}orders/histories',
                                 Server::SERVER_1)
               .query_param(new_parameter(start_at, key: 'start_at')
                             .is_required(true))
               .query_param(new_parameter(end_at, key: 'end_at')
                             .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))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetHistoryNotes.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_history_notes_single_order(domain, v2_ext, order_id) ⇒ ApiResponse

Retrieve all history notes for a given Order ID. Results will be paginated. **Response Data**\ Response parameters expected in each History Note object contained within the ‘data` field array: | Field | Data Type | Description

|

| ————————————— | ———— | ————————————– | | order_id | Integer | The History Note ID. | | message | Integer | The History Note message. | | created_at | Object | Contains details of when the History Note was created. | | created_at.date | String | A timestamp when the History Note was created. | | created_at.timezone_type | Integer | The timezone type number where the History Note was created.

|

| created_at.timezone | String | The name of the timezone where the History Note was created.

|

| author | Integer | The History Note author ID. | | type_name | String | The History Note type name. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • order_id (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/sticky_io_restful_api_v2025731/controllers/notes_controller.rb', line 100

def get_history_notes_single_order(domain,
                                   v2_ext,
                                   order_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}orders/{order_id}/histories',
                                 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(order_id, key: 'order_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(GetHistoryNotesSingleOrder.method(:from_hash))
                .is_api_response(true))
    .execute
end