Class: AftershipAPI::EstimatedDeliveryDateApi

Inherits:
Object
  • Object
show all
Defined in:
lib/aftership-tracking-sdk/api/estimated_delivery_date.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EstimatedDeliveryDateApi

Returns a new instance of EstimatedDeliveryDateApi.



9
10
11
# File 'lib/aftership-tracking-sdk/api/estimated_delivery_date.rb', line 9

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



7
8
9
# File 'lib/aftership-tracking-sdk/api/estimated_delivery_date.rb', line 7

def api_client
  @api_client
end

Instance Method Details

#predict(body:, opts: {}) ⇒ Model::PredictResponse

Parameters:

Returns:



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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/aftership-tracking-sdk/api/estimated_delivery_date.rb', line 19

def predict(body:, opts: {})
  opts[:body] = body
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EstimatedDeliveryDateApi.predict ...'
  end


  # resource path
  local_var_path = "/tracking/2025-07/estimated-delivery-date/predict"
  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 = 'EstimatedDeliveryDateResponse'

  new_options = opts.merge(
    :operation => :"EstimatedDeliveryDateApi.predict",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => return_type
  )

  data, _status_code, headers = @api_client.call_api(method, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EstimatedDeliveryDateApi#predict\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end

  resp = Model::PredictResponse.new
  resp.data = data
  resp.response_header = headers
  resp
end

#predict_batch(body:, opts: {}) ⇒ Model::PredictBatchResponse

Parameters:

Returns:



66
67
68
69
70
71
72
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/aftership-tracking-sdk/api/estimated_delivery_date.rb', line 66

def predict_batch(body:, opts: {})
  opts[:body] = body
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EstimatedDeliveryDateApi.predict_batch ...'
  end


  # resource path
  local_var_path = "/tracking/2025-07/estimated-delivery-date/predict-batch"
  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 = 'PredictBatchResponseData'

  new_options = opts.merge(
    :operation => :"EstimatedDeliveryDateApi.predict_batch",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => return_type
  )

  data, _status_code, headers = @api_client.call_api(method, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EstimatedDeliveryDateApi#predict_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end

  resp = Model::PredictBatchResponse.new
  resp.data = data
  resp.response_header = headers
  resp
end