Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"webrick": ">= 1.0"
}
},
"originGitCommit": "df83a2723a19055c70199e3b0b78b77e9c394838",
"sdkVersion": "1.4.5"
"originGitCommit": "26286134afce586aa5dbd02bffc9f25da6217032",
"sdkVersion": "1.4.6"
}
211 changes: 8 additions & 203 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
schematichq (1.4.5)
schematichq (1.4.6)
wasmtime (>= 19.0)
websocket (>= 1.2)

Expand Down
6 changes: 6 additions & 0 deletions lib/schematic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
require_relative "schematic/types/billing_coupon_response_data"
require_relative "schematic/billing/types/list_coupons_response"
require_relative "schematic/billing/types/upsert_billing_coupon_response"
require_relative "schematic/billing/types/delete_billing_coupon_response"
require_relative "schematic/billing/types/delete_billing_customer_response"
require_relative "schematic/types/billing_customer_response_data"
require_relative "schematic/billing/types/upsert_billing_customer_response"
require_relative "schematic/billing/types/list_customers_with_subscriptions_params"
Expand All @@ -98,6 +100,7 @@
require_relative "schematic/types/invoice_response_data"
require_relative "schematic/billing/types/list_invoices_response"
require_relative "schematic/billing/types/upsert_invoice_response"
require_relative "schematic/billing/types/delete_billing_invoice_response"
require_relative "schematic/billing/types/list_meters_params"
require_relative "schematic/types/billing_meter_response_data"
require_relative "schematic/billing/types/list_meters_response"
Expand Down Expand Up @@ -622,6 +625,8 @@
require_relative "schematic/webhooks/types/get_webhook_response"
require_relative "schematic/webhooks/types/update_webhook_response"
require_relative "schematic/webhooks/types/delete_webhook_response"
require_relative "schematic/types/test_webhook_response_data"
require_relative "schematic/webhooks/types/send_test_webhook_action_response"
require_relative "schematic/webhooks/types/count_webhooks_params"
require_relative "schematic/webhooks/types/count_webhooks_response"
require_relative "schematic/types/api_error"
Expand Down Expand Up @@ -908,5 +913,6 @@
require_relative "schematic/webhooks/types/list_webhooks_request"
require_relative "schematic/webhooks/types/create_webhook_request_body"
require_relative "schematic/webhooks/types/update_webhook_request_body"
require_relative "schematic/webhooks/types/test_webhook_request_body"
require_relative "schematic/webhooks/types/count_webhooks_request"
require_relative "schematic/environment"
96 changes: 96 additions & 0 deletions lib/schematic/billing/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,70 @@ def upsert_billing_coupon(request_options: {}, **params)
end
end

# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :billing_id
#
# @return [Schematic::Billing::Types::DeleteBillingCouponResponse]
def delete_billing_coupon(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "DELETE",
path: "billing/coupons/#{URI.encode_uri_component(params[:billing_id].to_s)}",
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Schematic::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
Schematic::Billing::Types::DeleteBillingCouponResponse.load(response.body)
else
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end

# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :billing_id
#
# @return [Schematic::Billing::Types::DeleteBillingCustomerResponse]
def delete_billing_customer(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "DELETE",
path: "billing/customer/#{URI.encode_uri_component(params[:billing_id].to_s)}",
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Schematic::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
Schematic::Billing::Types::DeleteBillingCustomerResponse.load(response.body)
else
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end

# @param request_options [Hash]
# @param params [Schematic::Billing::Types::CreateBillingCustomerRequestBody]
# @option request_options [String] :base_url
Expand Down Expand Up @@ -292,6 +356,38 @@ def upsert_invoice(request_options: {}, **params)
end
end

# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :billing_id
#
# @return [Schematic::Billing::Types::DeleteBillingInvoiceResponse]
def delete_billing_invoice(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "DELETE",
path: "billing/invoices/#{URI.encode_uri_component(params[:billing_id].to_s)}",
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Schematic::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
Schematic::Billing::Types::DeleteBillingInvoiceResponse.load(response.body)
else
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end

# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
Expand Down
12 changes: 12 additions & 0 deletions lib/schematic/billing/types/delete_billing_coupon_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Billing
module Types
class DeleteBillingCouponResponse < Internal::Types::Model
field :data, -> { Schematic::Types::DeleteResponse }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
Loading