Class: ErpIntegration::Fulfil::Resources::CustomerShipmentReturn
- Inherits:
-
ApiResource
- Object
- ApiResource
- ErpIntegration::Fulfil::Resources::CustomerShipmentReturn
- Defined in:
- lib/erp_integration/fulfil/resources/customer_shipment_return.rb
Constant Summary
Constants included from PaginationMethods
PaginationMethods::DEFAULT_LIMIT, PaginationMethods::DEFAULT_OFFSET, PaginationMethods::MAX_LIMIT
Instance Attribute Summary
Attributes inherited from ApiResource
Attributes included from QueryMethods
#or_clauses, #selected_fields, #where_clauses
Attributes included from PaginationMethods
#limit_value, #offset_value, #page_number
Instance Method Summary collapse
- #create_default_package(id) ⇒ Object
- #create_package(id, options) ⇒ Object
- #generate_shipping_label(id) ⇒ Object
- #mark_as_done!(id) ⇒ Object
- #receive!(id) ⇒ Object
Methods inherited from ApiResource
#all, api_keys_pool, api_keys_pool=, client, config, #count, #each, #find_each, #initialize, model_name, model_name=
Methods included from QueryMethods
#or, #or!, #select, #select!, #where, #where!, #where_domain, #where_ilike, #where_in, #where_less_or_equal_to, #where_less_than, #where_like, #where_more_or_equal_to, #where_more_than, #where_not, #where_not_in
Methods included from Persistence
Methods included from PaginationMethods
#limit, #limit!, #offset, #offset!, #page, #page!
Methods included from FinderMethods
Methods included from Context
Constructor Details
This class inherits a constructor from ErpIntegration::Fulfil::ApiResource
Instance Method Details
#create_default_package(id) ⇒ Object
21 22 23 |
# File 'lib/erp_integration/fulfil/resources/customer_shipment_return.rb', line 21 def create_default_package(id) client.put("model/#{model_name}/#{id}/create_default_packages") end |
#create_package(id, options) ⇒ Object
25 26 27 |
# File 'lib/erp_integration/fulfil/resources/customer_shipment_return.rb', line 25 def create_package(id, ) client.put("model/#{model_name}/#{id}", ) end |
#generate_shipping_label(id) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/erp_integration/fulfil/resources/customer_shipment_return.rb', line 11 def generate_shipping_label(id) client.put("model/#{model_name}/#{id}/generate_shipping_labels") true # Workaround: Fulfil api does not return a json when status code is 200 (a.k.a. "Ok") # and faraday is having an error when trying to parse it. Let's skip the parse error # and move on. rescue Faraday::ParsingError true end |
#mark_as_done!(id) ⇒ Object
36 37 38 39 |
# File 'lib/erp_integration/fulfil/resources/customer_shipment_return.rb', line 36 def mark_as_done!(id) client.put("model/#{model_name}/#{id}/done") true end |
#receive!(id) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/erp_integration/fulfil/resources/customer_shipment_return.rb', line 29 def receive!(id) client.put("model/#{model_name}/#{id}/receive") true rescue Faraday::ParsingError true end |