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
# File 'lib/aftership-tracking-sdk/api/estimated_delivery_date.rb', line 19

def predict(body:,opts: {})
  if "" != ""
    body = {:'' => body}
  end
  opts[:body] = body
  data, _status_code, _headers = predict_with_http_info(opts: opts)
  data
end

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

Parameters:

Returns:



73
74
75
76
77
78
79
80
# File 'lib/aftership-tracking-sdk/api/estimated_delivery_date.rb', line 73

def predict_batch(body:,opts: {})
  if "" != ""
    body = {:'' => body}
  end
  opts[:body] = body
  data, _status_code, _headers = predict_batch_with_http_info(opts: opts)
  data
end

#predict_batch_with_http_info(opts: {}) ⇒ Object



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
114
115
116
117
118
119
# File 'lib/aftership-tracking-sdk/api/estimated_delivery_date.rb', line 82

def predict_batch_with_http_info(opts: {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EstimatedDeliveryDateApi.predict_batch ...'
  end



  # resource path
  local_var_path = "/tracking/2025-01/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 = 'PredictBatchResponse'
  
  new_options = opts.merge(
    :operation => :"EstimatedDeliveryDateApi.predict_batch",
    :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, 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
  return data, status_code, headers
end

#predict_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/estimated_delivery_date.rb', line 28

def predict_with_http_info(opts: {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EstimatedDeliveryDateApi.predict ...'
  end



  # resource path
  local_var_path = "/tracking/2025-01/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 = 'PredictResponse'
  
  new_options = opts.merge(
    :operation => :"EstimatedDeliveryDateApi.predict",
    :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, 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
  return data, status_code, headers
end