Class: Dodopayments::Resources::Products::ShortLinks
- Inherits:
-
Object
- Object
- Dodopayments::Resources::Products::ShortLinks
- Defined in:
- lib/dodopayments/resources/products/short_links.rb
Instance Method Summary collapse
-
#create(id, slug:, static_checkout_params: nil, request_options: {}) ⇒ Dodopayments::Models::Products::ShortLinkCreateResponse
Some parameter documentations has been truncated, see Models::Products::ShortLinkCreateParams for more details.
-
#initialize(client:) ⇒ ShortLinks
constructor
private
A new instance of ShortLinks.
-
#list(page_number: nil, page_size: nil, product_id: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::Products::ShortLinkListResponse>
Lists all short links created by the business.
Constructor Details
#initialize(client:) ⇒ ShortLinks
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 ShortLinks.
68 69 70 |
# File 'lib/dodopayments/resources/products/short_links.rb', line 68 def initialize(client:) @client = client end |
Instance Method Details
#create(id, slug:, static_checkout_params: nil, request_options: {}) ⇒ Dodopayments::Models::Products::ShortLinkCreateResponse
Some parameter documentations has been truncated, see Models::Products::ShortLinkCreateParams for more details.
Gives a Short Checkout URL with custom slug for a product. Uses a Static Checkout URL under the hood.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/dodopayments/resources/products/short_links.rb', line 26 def create(id, params) parsed, = Dodopayments::Products::ShortLinkCreateParams.dump_request(params) @client.request( method: :post, path: ["products/%1$s/short_links", id], body: parsed, model: Dodopayments::Models::Products::ShortLinkCreateResponse, options: ) end |
#list(page_number: nil, page_size: nil, product_id: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::Products::ShortLinkListResponse>
Lists all short links created by the business.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/dodopayments/resources/products/short_links.rb', line 52 def list(params = {}) parsed, = Dodopayments::Products::ShortLinkListParams.dump_request(params) query = Dodopayments::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "products/short_links", query: query, page: Dodopayments::Internal::DefaultPageNumberPagination, model: Dodopayments::Models::Products::ShortLinkListResponse, options: ) end |