Class: WhopSDK::Resources::Shipments
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Shipments
- Defined in:
- lib/whop_sdk/resources/shipments.rb,
sig/whop_sdk/resources/shipments.rbs
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.
111 112 113 |
# File 'lib/whop_sdk/resources/shipments.rb', line 111 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:createpayment:basic:read
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/whop_sdk/resources/shipments.rb', line 30 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:readpayment:basic:read
95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/whop_sdk/resources/shipments.rb', line 95 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:readpayment:basic:read
57 58 59 60 61 62 63 64 |
# File 'lib/whop_sdk/resources/shipments.rb', line 57 def retrieve(id, params = {}) @client.request( method: :get, path: ["shipments/%1$s", id], model: WhopSDK::Shipment, options: params[:request_options] ) end |