Class: Schematic::Client
- Inherits:
-
Object
- Object
- Schematic::Client
- Defined in:
- lib/schematic/client.rb
Instance Method Summary collapse
- #accesstokens ⇒ Schematic::Accesstokens::Client
- #accounts ⇒ Schematic::Accounts::Client
- #billing ⇒ Schematic::Billing::Client
- #catalogs ⇒ Schematic::Catalogs::Client
- #checkout ⇒ Schematic::Checkout::Client
- #companies ⇒ Schematic::Companies::Client
- #components ⇒ Schematic::Components::Client
- #componentspublic ⇒ Schematic::Componentspublic::Client
- #credits ⇒ Schematic::Credits::Client
- #dataexports ⇒ Schematic::Dataexports::Client
- #entitlements ⇒ Schematic::Entitlements::Client
- #events ⇒ Schematic::Events::Client
- #features ⇒ Schematic::Features::Client
- #get_credit_ledger(request_options: {}, **_params) ⇒ untyped
- #initialize(api_key:, base_url: nil, max_retries: 2) ⇒ void constructor
- #insights ⇒ Schematic::Insights::Client
- #integrationsapi ⇒ Schematic::Integrationsapi::Client
- #licenses ⇒ Schematic::Licenses::Client
- #planbundle ⇒ Schematic::Planbundle::Client
- #plangroups ⇒ Schematic::Plangroups::Client
- #planmigrations ⇒ Schematic::Planmigrations::Client
- #plans ⇒ Schematic::Plans::Client
- #scheduledcheckout ⇒ Schematic::Scheduledcheckout::Client
- #webhooks ⇒ Schematic::Webhooks::Client
Constructor Details
#initialize(api_key:, base_url: nil, max_retries: 2) ⇒ void
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/schematic/client.rb', line 41 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", "X-Fern-Language" => "Ruby", "X-Schematic-Api-Key" => api_key.to_s }, max_retries: max_retries ) end |
Instance Method Details
#accesstokens ⇒ Schematic::Accesstokens::Client
154 155 156 |
# File 'lib/schematic/client.rb', line 154 def accesstokens @accesstokens ||= Schematic::Accesstokens::Client.new(client: @raw_client) end |
#accounts ⇒ Schematic::Accounts::Client
54 55 56 |
# File 'lib/schematic/client.rb', line 54 def accounts @accounts ||= Schematic::Accounts::Client.new(client: @raw_client) end |
#billing ⇒ Schematic::Billing::Client
59 60 61 |
# File 'lib/schematic/client.rb', line 59 def billing @billing ||= Schematic::Billing::Client.new(client: @raw_client) end |
#catalogs ⇒ Schematic::Catalogs::Client
69 70 71 |
# File 'lib/schematic/client.rb', line 69 def catalogs @catalogs ||= Schematic::Catalogs::Client.new(client: @raw_client) end |
#checkout ⇒ Schematic::Checkout::Client
74 75 76 |
# File 'lib/schematic/client.rb', line 74 def checkout @checkout ||= Schematic::Checkout::Client.new(client: @raw_client) end |
#companies ⇒ Schematic::Companies::Client
79 80 81 |
# File 'lib/schematic/client.rb', line 79 def companies @companies ||= Schematic::Companies::Client.new(client: @raw_client) end |
#components ⇒ Schematic::Components::Client
94 95 96 |
# File 'lib/schematic/client.rb', line 94 def components @components ||= Schematic::Components::Client.new(client: @raw_client) end |
#componentspublic ⇒ Schematic::Componentspublic::Client
144 145 146 |
# File 'lib/schematic/client.rb', line 144 def componentspublic @componentspublic ||= Schematic::Componentspublic::Client.new(client: @raw_client) end |
#credits ⇒ Schematic::Credits::Client
64 65 66 |
# File 'lib/schematic/client.rb', line 64 def credits @credits ||= Schematic::Credits::Client.new(client: @raw_client) end |
#dataexports ⇒ Schematic::Dataexports::Client
104 105 106 |
# File 'lib/schematic/client.rb', line 104 def dataexports @dataexports ||= Schematic::Dataexports::Client.new(client: @raw_client) end |
#entitlements ⇒ Schematic::Entitlements::Client
84 85 86 |
# File 'lib/schematic/client.rb', line 84 def entitlements @entitlements ||= Schematic::Entitlements::Client.new(client: @raw_client) end |
#events ⇒ Schematic::Events::Client
109 110 111 |
# File 'lib/schematic/client.rb', line 109 def events @events ||= Schematic::Events::Client.new(client: @raw_client) end |
#features ⇒ Schematic::Features::Client
114 115 116 |
# File 'lib/schematic/client.rb', line 114 def features @features ||= Schematic::Features::Client.new(client: @raw_client) end |
#get_credit_ledger(request_options: {}, **_params) ⇒ untyped
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/schematic/client.rb', line 17 def get_credit_ledger(request_options: {}, **_params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "billing/credits/ledger", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |
#insights ⇒ Schematic::Insights::Client
119 120 121 |
# File 'lib/schematic/client.rb', line 119 def insights @insights ||= Schematic::Insights::Client.new(client: @raw_client) end |
#integrationsapi ⇒ Schematic::Integrationsapi::Client
124 125 126 |
# File 'lib/schematic/client.rb', line 124 def integrationsapi @integrationsapi ||= Schematic::Integrationsapi::Client.new(client: @raw_client) end |
#licenses ⇒ Schematic::Licenses::Client
129 130 131 |
# File 'lib/schematic/client.rb', line 129 def licenses @licenses ||= Schematic::Licenses::Client.new(client: @raw_client) end |
#planbundle ⇒ Schematic::Planbundle::Client
99 100 101 |
# File 'lib/schematic/client.rb', line 99 def planbundle @planbundle ||= Schematic::Planbundle::Client.new(client: @raw_client) end |
#plangroups ⇒ Schematic::Plangroups::Client
134 135 136 |
# File 'lib/schematic/client.rb', line 134 def plangroups @plangroups ||= Schematic::Plangroups::Client.new(client: @raw_client) end |
#planmigrations ⇒ Schematic::Planmigrations::Client
139 140 141 |
# File 'lib/schematic/client.rb', line 139 def planmigrations @planmigrations ||= Schematic::Planmigrations::Client.new(client: @raw_client) end |
#plans ⇒ Schematic::Plans::Client
89 90 91 |
# File 'lib/schematic/client.rb', line 89 def plans @plans ||= Schematic::Plans::Client.new(client: @raw_client) end |
#scheduledcheckout ⇒ Schematic::Scheduledcheckout::Client
149 150 151 |
# File 'lib/schematic/client.rb', line 149 def scheduledcheckout @scheduledcheckout ||= Schematic::Scheduledcheckout::Client.new(client: @raw_client) end |
#webhooks ⇒ Schematic::Webhooks::Client
159 160 161 |
# File 'lib/schematic/client.rb', line 159 def webhooks @webhooks ||= Schematic::Webhooks::Client.new(client: @raw_client) end |