Class: AftershipAPI::CourierApi
- Inherits:
-
Object
- Object
- AftershipAPI::CourierApi
- Defined in:
- lib/aftership-tracking-sdk/api/courier.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
- #detect_courier(body:, opts: {}) ⇒ Model::DetectCourierResponse
- #detect_courier_with_http_info(opts: {}) ⇒ Object
-
#get_all_couriers(opts: {}) ⇒ Model::GetAllCouriersResponse
get_all_couriers Return a list of all couriers.
- #get_all_couriers_with_http_info(opts: {}) ⇒ Object
-
#get_user_couriers(opts: {}) ⇒ Model::GetUserCouriersResponse
get_user_couriers Return a list of .
- #get_user_couriers_with_http_info(opts: {}) ⇒ Object
-
#initialize(api_client = ApiClient.default) ⇒ CourierApi
constructor
A new instance of CourierApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ CourierApi
Returns a new instance of CourierApi.
9 10 11 |
# File 'lib/aftership-tracking-sdk/api/courier.rb', line 9 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
7 8 9 |
# File 'lib/aftership-tracking-sdk/api/courier.rb', line 7 def api_client @api_client end |
Instance Method Details
#detect_courier(body:, opts: {}) ⇒ Model::DetectCourierResponse
19 20 21 22 23 24 25 26 |
# File 'lib/aftership-tracking-sdk/api/courier.rb', line 19 def detect_courier(body:,opts: {}) if "" != "" body = {:'' => body} end opts[:body] = body data, _status_code, _headers = detect_courier_with_http_info(opts: opts) data end |
#detect_courier_with_http_info(opts: {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 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 |
# File 'lib/aftership-tracking-sdk/api/courier.rb', line 28 def detect_courier_with_http_info(opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CourierApi.detect_courier ...' end # resource path local_var_path = "/tracking/2024-10/couriers/detect" method = :'POST' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'DetectCourierResponse' = opts.merge( :operation => :"CourierApi.detect_courier", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CourierApi#detect_courier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_all_couriers(opts: {}) ⇒ Model::GetAllCouriersResponse
get_all_couriers Return a list of all couriers.
71 72 73 74 |
# File 'lib/aftership-tracking-sdk/api/courier.rb', line 71 def get_all_couriers(opts: {}) data, _status_code, _headers = get_all_couriers_with_http_info(opts: opts) data end |
#get_all_couriers_with_http_info(opts: {}) ⇒ Object
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 106 107 108 109 110 111 112 113 |
# File 'lib/aftership-tracking-sdk/api/courier.rb', line 76 def get_all_couriers_with_http_info(opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CourierApi.get_all_couriers ...' end # resource path local_var_path = "/tracking/2024-10/couriers/all" method = :'GET' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'GetAllCouriersResponse' = opts.merge( :operation => :"CourierApi.get_all_couriers", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CourierApi#get_all_couriers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_user_couriers(opts: {}) ⇒ Model::GetUserCouriersResponse
get_user_couriers Return a list of .
119 120 121 122 |
# File 'lib/aftership-tracking-sdk/api/courier.rb', line 119 def get_user_couriers(opts: {}) data, _status_code, _headers = get_user_couriers_with_http_info(opts: opts) data end |
#get_user_couriers_with_http_info(opts: {}) ⇒ Object
124 125 126 127 128 129 130 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 160 161 |
# File 'lib/aftership-tracking-sdk/api/courier.rb', line 124 def get_user_couriers_with_http_info(opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CourierApi.get_user_couriers ...' end # resource path local_var_path = "/tracking/2024-10/couriers" method = :'GET' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'GetUserCouriersResponse' = opts.merge( :operation => :"CourierApi.get_user_couriers", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CourierApi#get_user_couriers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |