Class: DuffelAPI::Services::OrderChangeRequestsService
- Inherits:
-
BaseService
- Object
- BaseService
- DuffelAPI::Services::OrderChangeRequestsService
- Defined in:
- lib/duffel_api/services/order_change_requests_service.rb
Constant Summary
Constants inherited from BaseService
BaseService::DEFAULT_ALL_PARAMS
Instance Method Summary collapse
-
#create(options = {}) ⇒ Resources::OrderChangeRequest
Creates an order change request.
-
#get(id, options = {}) ⇒ Resources::OrderChangeRequest
Retrieves a single order change request by ID.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from DuffelAPI::Services::BaseService
Instance Method Details
#create(options = {}) ⇒ Resources::OrderChangeRequest
Creates an order change request
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/duffel_api/services/order_change_requests_service.rb', line 12 def create( = {}) path = "/air/order_change_requests" params = .delete(:params) || {} [:params] = {} [:params]["data"] = params begin response = make_request(:post, path, ) # Response doesn't raise any errors until #body is called response.tap(&:raw_body) end return if response.raw_body.nil? Resources::OrderChangeRequest.new(unenvelope_body(response.parsed_body), response) end |
#get(id, options = {}) ⇒ Resources::OrderChangeRequest
Retrieves a single order change request by ID
37 38 39 40 41 42 43 44 45 |
# File 'lib/duffel_api/services/order_change_requests_service.rb', line 37 def get(id, = {}) path = substitute_url_pattern("/air/order_change_requests/:id", "id" => id) response = make_request(:get, path, ) return if response.raw_body.nil? Resources::OrderChangeRequest.new(unenvelope_body(response.parsed_body), response) end |