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
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"webrick": ">= 1.0"
}
},
"originGitCommit": "008b7147a27272499bf4b17fa96d4357ca3b62e9",
"originGitCommit": "686551a0297d2f37075b3586b030ff32be5c94f7",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "1.4.15",
"requestedVersion": "1.4.16",
"ciProvider": "github",
"sdkVersion": "1.4.15"
"sdkVersion": "1.4.16"
}
12 changes: 9 additions & 3 deletions .fern/replay.lock

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

5 changes: 5 additions & 0 deletions lib/schematic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
require_relative "schematic/types/onboarding_path"
require_relative "schematic/types/onboarding_requirement_status"
require_relative "schematic/types/onboarding_requirement_view"
require_relative "schematic/types/onboarding_stripe_import"
require_relative "schematic/types/onboarding_track"
require_relative "schematic/types/get_onboarding_state_resp"
require_relative "schematic/accounts/types/get_onboarding_state_response"
Expand Down Expand Up @@ -303,6 +304,7 @@
require_relative "schematic/types/entity_trait_detail_response_data"
require_relative "schematic/types/warning_tier"
require_relative "schematic/types/feature_entitlement"
require_relative "schematic/types/pending_migration_response_data"
require_relative "schematic/types/rule"
require_relative "schematic/types/scheduled_downgrade_response_data"
require_relative "schematic/types/company_detail_response_data"
Expand Down Expand Up @@ -683,6 +685,8 @@
require_relative "schematic/planmigrations/types/list_migrations_response"
require_relative "schematic/planmigrations/types/create_migration_response"
require_relative "schematic/planmigrations/types/get_migration_response"
require_relative "schematic/planmigrations/types/cancel_migration_response"
require_relative "schematic/planmigrations/types/complete_migration_now_response"
require_relative "schematic/planmigrations/types/retry_migration_response"
require_relative "schematic/planmigrations/types/count_migrations_params"
require_relative "schematic/planmigrations/types/count_migrations_response"
Expand Down Expand Up @@ -1028,6 +1032,7 @@
require_relative "schematic/planmigrations/types/count_company_migrations_request"
require_relative "schematic/planmigrations/types/list_migrations_request"
require_relative "schematic/planmigrations/types/create_migration_input"
require_relative "schematic/planmigrations/types/complete_migration_now_request_body"
require_relative "schematic/planmigrations/types/retry_migration_request_body"
require_relative "schematic/planmigrations/types/count_migrations_request"
require_relative "schematic/planmigrations/types/preview_migration_request_body"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module Schematic
module Accounts
module Types
class UpdateOnboardingStateRequestBody < Internal::Types::Model
field :dismissed, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :path, -> { Schematic::Types::OnboardingPath }, optional: true, nullable: false

field :pricing_page_url, -> { String }, optional: true, nullable: false
Expand Down
2 changes: 1 addition & 1 deletion lib/schematic/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def initialize(api_key:, base_url: nil, max_retries: 2)
@raw_client = Schematic::Internal::Http::RawClient.new(
base_url: base_url || Schematic::Environment::DEFAULT,
headers: {
"User-Agent" => "schematichq/1.4.15",
"User-Agent" => "schematichq/1.4.16",
"X-Fern-Language" => "Ruby",
"X-Schematic-Api-Key" => api_key.to_s
},
Expand Down
85 changes: 80 additions & 5 deletions lib/schematic/planmigrations/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def initialize(client:)
# client.planmigrations.list_company_migrations(
# migration_id: "migration_id",
# q: "q",
# status: "completed",
# status: "cancelled",
# limit: 1000000,
# offset: 1000000
# )
Expand Down Expand Up @@ -115,7 +115,7 @@ def retry_company_migration(request_options: {}, **params)
# client.planmigrations.count_company_migrations(
# migration_id: "migration_id",
# q: "q",
# status: "completed",
# status: "cancelled",
# limit: 1000000,
# offset: 1000000
# )
Expand Down Expand Up @@ -166,7 +166,7 @@ def count_company_migrations(request_options: {}, **params)
# @example
# client.planmigrations.list_migrations(
# plan_version_id: "plan_version_id",
# status: "completed",
# status: "cancelled",
# limit: 1000000,
# offset: 1000000
# )
Expand Down Expand Up @@ -213,7 +213,7 @@ def list_migrations(request_options: {}, **params)
# client.planmigrations.create_migration(
# plan_id: "plan_id",
# plan_version_id_to: "plan_version_id_to",
# strategy: "immediate",
# strategy: "end_of_billing_period",
# target_plan_type: "plan"
# )
#
Expand Down Expand Up @@ -276,6 +276,81 @@ def get_migration(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] :plan_version_migration_id
#
# @example
# client.planmigrations.cancel_migration(plan_version_migration_id: "plan_version_migration_id")
#
# @return [Schematic::Planmigrations::Types::CancelMigrationResponse]
def cancel_migration(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "POST",
path: "plan-version-migrations/#{URI.encode_uri_component(params[:plan_version_migration_id].to_s)}/cancel",
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::Planmigrations::Types::CancelMigrationResponse.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::Planmigrations::Types::CompleteMigrationNowRequestBody]
# @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] :plan_version_migration_id
#
# @example
# client.planmigrations.complete_migration_now(plan_version_migration_id: "plan_version_migration_id")
#
# @return [Schematic::Planmigrations::Types::CompleteMigrationNowResponse]
def complete_migration_now(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
request_data = Schematic::Planmigrations::Types::CompleteMigrationNowRequestBody.new(params).to_h
non_body_param_names = %w[plan_version_migration_id]
body = request_data.except(*non_body_param_names)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "POST",
path: "plan-version-migrations/#{URI.encode_uri_component(params[:plan_version_migration_id].to_s)}/complete-now",
body: body,
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::Planmigrations::Types::CompleteMigrationNowResponse.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::Planmigrations::Types::RetryMigrationRequestBody]
# @option request_options [String] :base_url
Expand Down Expand Up @@ -334,7 +409,7 @@ def retry_migration(request_options: {}, **params)
# @example
# client.planmigrations.count_migrations(
# plan_version_id: "plan_version_id",
# status: "completed",
# status: "cancelled",
# limit: 1000000,
# offset: 1000000
# )
Expand Down
13 changes: 13 additions & 0 deletions lib/schematic/planmigrations/types/cancel_migration_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Schematic
module Planmigrations
module Types
class CancelMigrationResponse < Internal::Types::Model
field :data, -> { Schematic::Types::PlanVersionMigrationResponseData }, optional: false, nullable: false

field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Schematic
module Planmigrations
module Types
class CompleteMigrationNowRequestBody < Internal::Types::Model
field :plan_version_migration_id, -> { String }, optional: false, nullable: false

field :proration_behavior, -> { Schematic::Types::MigrationProrationBehavior }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Schematic
module Planmigrations
module Types
class CompleteMigrationNowResponse < Internal::Types::Model
field :data, -> { Schematic::Types::PlanVersionMigrationResponseData }, optional: false, nullable: false

field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
2 changes: 1 addition & 1 deletion lib/schematic/plans/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def delete_plan_version(request_options: {}, **params)
# client.plans.publish_plan_version(
# plan_version_id: "plan_version_id",
# excluded_company_ids: ["excluded_company_ids"],
# migration_strategy: "immediate"
# migration_strategy: "end_of_billing_period"
# )
#
# @return [Schematic::Plans::Types::PublishPlanVersionResponse]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class PublishPlanVersionRequestBody < Internal::Types::Model

field :address, -> { Schematic::Types::CustomerBillingAddress }, optional: true, nullable: false

field :billing_cycle_anchor, -> { String }, optional: true, nullable: false

field :coupon_external_id, -> { String }, optional: true, nullable: false

field :custom_field_values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: true, nullable: false
Expand All @@ -24,6 +26,8 @@ class PublishPlanVersionRequestBody < Internal::Types::Model

field :phone, -> { String }, optional: true, nullable: false

field :prorate_first_period, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :proration_behavior, -> { Schematic::Types::MigrationProrationBehavior }, optional: true, nullable: false

field :require_no_migration, -> { Internal::Types::Boolean }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ class RetryCustomPlanBillingRequestBody < Internal::Types::Model

field :activation_strategy, -> { Schematic::Types::CustomPlanActivationStrategy }, optional: true, nullable: false

field :billing_cycle_anchor, -> { String }, optional: true, nullable: false

field :customer_email, -> { String }, optional: false, nullable: false

field :days_until_due, -> { Integer }, optional: true, nullable: false

field :prorate_first_period, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :send_invoice, -> { Internal::Types::Boolean }, optional: true, nullable: false
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/schematic/types/company_detail_response_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class CompanyDetailResponseData < Internal::Types::Model

field :payment_methods, -> { Internal::Types::Array[Schematic::Types::PaymentMethodResponseData] }, optional: false, nullable: false

field :pending_migration, -> { Schematic::Types::PendingMigrationResponseData }, optional: true, nullable: false

field :plan, -> { Schematic::Types::CompanyPlanWithBillingSubView }, optional: true, nullable: false

field :plans, -> { Internal::Types::Array[Schematic::Types::GenericPreviewObject] }, optional: false, nullable: false
Expand Down
2 changes: 2 additions & 0 deletions lib/schematic/types/credit_lease_response_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class CreditLeaseResponseData < Internal::Types::Model

field :released_at, -> { String }, optional: true, nullable: false

field :tracked_amount, -> { Integer }, optional: false, nullable: false

field :updated_at, -> { String }, optional: false, nullable: false
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/schematic/types/custom_plan_billing_response_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class CustomPlanBillingResponseData < Internal::Types::Model

field :plan_id, -> { String }, optional: false, nullable: false

field :prorate_first_period, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :published_at, -> { String }, optional: true, nullable: false

field :send_invoice, -> { Internal::Types::Boolean }, optional: false, nullable: false
Expand Down
10 changes: 10 additions & 0 deletions lib/schematic/types/get_onboarding_state_resp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,27 @@
module Schematic
module Types
class GetOnboardingStateResp < Internal::Types::Model
field :agent_connected_at, -> { String }, optional: true, nullable: false

field :dismissed_at, -> { String }, optional: true, nullable: false

field :environment_id, -> { String }, optional: true, nullable: false

field :milestones, -> { Internal::Types::Array[Schematic::Types::OnboardingMilestoneView] }, optional: false, nullable: false

field :path, -> { Schematic::Types::OnboardingPath }, optional: true, nullable: false

field :pricing_page_url, -> { String }, optional: true, nullable: false

field :requirements, -> { Internal::Types::Array[Schematic::Types::OnboardingRequirementView] }, optional: false, nullable: false

field :stripe_import, -> { Schematic::Types::OnboardingStripeImport }, optional: true, nullable: false

field :suggested_next, -> { Internal::Types::Array[Schematic::Types::OnboardingRequirement] }, optional: false, nullable: false

field :track, -> { Schematic::Types::OnboardingTrack }, optional: true, nullable: false

field :website_url, -> { String }, optional: true, nullable: false
end
end
end
1 change: 1 addition & 0 deletions lib/schematic/types/onboarding_requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Types
module OnboardingRequirement
extend Schematic::Internal::Types::Enum

CONNECT_AGENT = "connect_agent"
CONNECT_BILLING = "connect_billing"
CREATE_API_KEY = "create_api_key"
FIRST_FLAG_CHECK = "first_flag_check"
Expand Down
13 changes: 13 additions & 0 deletions lib/schematic/types/onboarding_stripe_import.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Schematic
module Types
module OnboardingStripeImport
extend Schematic::Internal::Types::Enum

COMPLETE = "complete"
NOT_STARTED = "not_started"
RUNNING = "running"
end
end
end
Loading