Class: WhopSDK::Resources::Shipments
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Shipments
- Defined in:
- lib/whop_sdk/resources/shipments.rb
Overview
Shipments
Instance Method Summary collapse
-
#create(company_id:, payment_id:, tracking_code:, request_options: {}) ⇒ WhopSDK::Models::Shipment
Some parameter documentations has been truncated, see Models::ShipmentCreateParams for more details.
-
#initialize(client:) ⇒ Shipments
constructor
private
A new instance of Shipments.
-
#list(after: nil, before: nil, company_id: nil, first: nil, last: nil, payment_id: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ShipmentListResponse>
Returns a paginated list of shipments, with optional filtering by payment, company, or user.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Shipment
Retrieves the details of an existing shipment.
Constructor Details
#initialize(client:) ⇒ Shipments
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Shipments.
112 113 114 |
# File 'lib/whop_sdk/resources/shipments.rb', line 112 def initialize(client:) @client = client end |
Instance Method Details
#create(company_id:, payment_id:, tracking_code:, request_options: {}) ⇒ WhopSDK::Models::Shipment
Some parameter documentations has been truncated, see Models::ShipmentCreateParams for more details.
Create a new shipment with a tracking code for a specific payment within a company.
Required permissions:
-
‘shipment:create`
-
‘payment:basic:read`
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/whop_sdk/resources/shipments.rb', line 31 def create(params) parsed, = WhopSDK::ShipmentCreateParams.dump_request(params) @client.request( method: :post, path: "shipments", body: parsed, model: WhopSDK::Shipment, options: ) end |
#list(after: nil, before: nil, company_id: nil, first: nil, last: nil, payment_id: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ShipmentListResponse>
Returns a paginated list of shipments, with optional filtering by payment, company, or user.
Required permissions:
-
‘shipment:basic:read`
-
‘payment:basic:read`
96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/whop_sdk/resources/shipments.rb', line 96 def list(params = {}) parsed, = WhopSDK::ShipmentListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "shipments", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::ShipmentListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Shipment
Retrieves the details of an existing shipment.
Required permissions:
-
‘shipment:basic:read`
-
‘payment:basic:read`
58 59 60 61 62 63 64 65 |
# File 'lib/whop_sdk/resources/shipments.rb', line 58 def retrieve(id, params = {}) @client.request( method: :get, path: ["shipments/%1$s", id], model: WhopSDK::Shipment, options: params[:request_options] ) end |