Module: Uber::API::Deliveries

Includes:
Utils
Included in:
Delivery::Client
Defined in:
lib/uber/api/deliveries.rb

Instance Method Summary collapse

Methods included from Utils

#perform_with_object, #perform_with_objects, #perform_without_object

Instance Method Details

#add_delivery(*args) ⇒ Object



15
16
17
18
# File 'lib/uber/api/deliveries.rb', line 15

def add_delivery(*args)
  arguments = Uber::Arguments.new(args)
  perform_with_object(:post, "/v1/deliveries", arguments.options, Delivery::Delivery, self.client)
end

#add_quote(*args) ⇒ Object



20
21
22
23
# File 'lib/uber/api/deliveries.rb', line 20

def add_quote(*args)
  arguments = Uber::Arguments.new(args)
  perform_with_objects(:post, "/v1/deliveries/quote", arguments.options, Delivery::Quote, self.client)
end

#add_rating(delivery_id, *args) ⇒ Object



39
40
41
42
43
# File 'lib/uber/api/deliveries.rb', line 39

def add_rating(delivery_id, *args)
  delivery_id = delivery_id.is_a?(Delivery::Delivery) ? delivery_id.delivery_id : delivery_id
  arguments = Uber::Arguments.new(args)
  perform_without_object(:post, "/v1/deliveries/#{delivery_id}/rating", arguments.options, self.client)
end

#cancel(delivery_id) ⇒ Object



50
51
52
53
# File 'lib/uber/api/deliveries.rb', line 50

def cancel(delivery_id)
  delivery_id = delivery_id.is_a?(Delivery::Delivery) ? delivery_id.delivery_id : delivery_id
  perform_without_object(:post, "/v1/deliveries/#{delivery_id}/cancel", {}, self.client)
end

#list(*args) ⇒ Object



10
11
12
13
# File 'lib/uber/api/deliveries.rb', line 10

def list(*args)
  arguments = Uber::Arguments.new(args)
  perform_with_objects(:get, "/v1/deliveries", arguments.options, Delivery::Delivery, self.client)
end

#rating_tags(delivery_id) ⇒ Object



45
46
47
48
# File 'lib/uber/api/deliveries.rb', line 45

def rating_tags(delivery_id)
  delivery_id = delivery_id.is_a?(Delivery::Delivery) ? delivery_id.delivery_id : delivery_id
  perform_with_objects(:get, "/v1/deliveries/#{delivery_id}/rating_tags", {}, Delivery::RatingTag, self.client)
end

#ratings(delivery_id) ⇒ Object



34
35
36
37
# File 'lib/uber/api/deliveries.rb', line 34

def ratings(delivery_id)
  delivery_id = delivery_id.is_a?(Delivery::Delivery) ? delivery_id.delivery_id : delivery_id
  perform_with_objects(:get, "/v1/deliveries/#{delivery_id}/ratings", {}, Delivery::Rating, self.client)
end

#receipt(delivery_id) ⇒ Object



29
30
31
32
# File 'lib/uber/api/deliveries.rb', line 29

def receipt(delivery_id)
  delivery_id = delivery_id.is_a?(Delivery::Delivery) ? delivery_id.delivery_id : delivery_id
  perform_with_object(:get, "/v1/deliveries/#{delivery_id}/receipt", {}, Delivery::Receipt, self.client)
end

#regionsObject



55
56
57
# File 'lib/uber/api/deliveries.rb', line 55

def regions
  perform_with_objects(:get, "/v1/deliveries/regions", {}, Delivery::Region, self.client)
end

#retrieve(delivery_id) ⇒ Object



25
26
27
# File 'lib/uber/api/deliveries.rb', line 25

def retrieve(delivery_id)
  perform_with_object(:get, "/v1/deliveries/#{delivery_id}", {}, Delivery::Delivery, self.client)
end