Class: NewDemoApiClient::Client
- Inherits:
-
Object
- Object
- NewDemoApiClient::Client
- Defined in:
- lib/test_sdk.rb
Instance Attribute Summary collapse
- #benchmark ⇒ NewDemoApiClient::BenchmarkClient readonly
- #company ⇒ NewDemoApiClient::CompanyClient readonly
- #deal ⇒ NewDemoApiClient::DealClient readonly
- #file ⇒ NewDemoApiClient::FileClient readonly
- #financials ⇒ NewDemoApiClient::FinancialsClient readonly
- #group ⇒ NewDemoApiClient::GroupClient readonly
- #macro ⇒ NewDemoApiClient::MacroClient readonly
- #metadata ⇒ NewDemoApiClient::MetadataClient readonly
- #product ⇒ NewDemoApiClient::ProductClient readonly
- #talent ⇒ NewDemoApiClient::TalentClient readonly
- #unit_economics ⇒ NewDemoApiClient::UnitEconomicsClient readonly
- #user ⇒ NewDemoApiClient::UserClient readonly
Instance Method Summary collapse
- #healthz(request_options: nil) ⇒ NewDemoApiClient::HealthzResponse
- #initialize(token:, base_url: nil, environment: NewDemoApiClient::Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil) ⇒ NewDemoApiClient::Client constructor
Constructor Details
#initialize(token:, base_url: nil, environment: NewDemoApiClient::Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil) ⇒ NewDemoApiClient::Client
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/test_sdk.rb', line 53 def initialize(token:, base_url: nil, environment: NewDemoApiClient::Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil) @request_client = NewDemoApiClient::RequestClient.new( base_url: base_url, environment: environment, max_retries: max_retries, timeout_in_seconds: timeout_in_seconds, token: token ) @user = NewDemoApiClient::UserClient.new(request_client: @request_client) @group = NewDemoApiClient::GroupClient.new(request_client: @request_client) @macro = NewDemoApiClient::MacroClient.new(request_client: @request_client) @company = NewDemoApiClient::CompanyClient.new(request_client: @request_client) @deal = NewDemoApiClient::DealClient.new(request_client: @request_client) @file = NewDemoApiClient::FileClient.new(request_client: @request_client) @financials = NewDemoApiClient::FinancialsClient.new(request_client: @request_client) @product = NewDemoApiClient::ProductClient.new(request_client: @request_client) @talent = NewDemoApiClient::TalentClient.new(request_client: @request_client) @unit_economics = NewDemoApiClient::UnitEconomicsClient.new(request_client: @request_client) @metadata = NewDemoApiClient::MetadataClient.new(request_client: @request_client) @benchmark = NewDemoApiClient::BenchmarkClient.new(request_client: @request_client) end |
Instance Attribute Details
#benchmark ⇒ NewDemoApiClient::BenchmarkClient (readonly)
45 46 47 |
# File 'lib/test_sdk.rb', line 45 def benchmark @benchmark end |
#company ⇒ NewDemoApiClient::CompanyClient (readonly)
29 30 31 |
# File 'lib/test_sdk.rb', line 29 def company @company end |
#deal ⇒ NewDemoApiClient::DealClient (readonly)
31 32 33 |
# File 'lib/test_sdk.rb', line 31 def deal @deal end |
#file ⇒ NewDemoApiClient::FileClient (readonly)
33 34 35 |
# File 'lib/test_sdk.rb', line 33 def file @file end |
#financials ⇒ NewDemoApiClient::FinancialsClient (readonly)
35 36 37 |
# File 'lib/test_sdk.rb', line 35 def financials @financials end |
#group ⇒ NewDemoApiClient::GroupClient (readonly)
25 26 27 |
# File 'lib/test_sdk.rb', line 25 def group @group end |
#macro ⇒ NewDemoApiClient::MacroClient (readonly)
27 28 29 |
# File 'lib/test_sdk.rb', line 27 def macro @macro end |
#metadata ⇒ NewDemoApiClient::MetadataClient (readonly)
43 44 45 |
# File 'lib/test_sdk.rb', line 43 def @metadata end |
#product ⇒ NewDemoApiClient::ProductClient (readonly)
37 38 39 |
# File 'lib/test_sdk.rb', line 37 def product @product end |
#talent ⇒ NewDemoApiClient::TalentClient (readonly)
39 40 41 |
# File 'lib/test_sdk.rb', line 39 def talent @talent end |
#unit_economics ⇒ NewDemoApiClient::UnitEconomicsClient (readonly)
41 42 43 |
# File 'lib/test_sdk.rb', line 41 def unit_economics @unit_economics end |
#user ⇒ NewDemoApiClient::UserClient (readonly)
23 24 25 |
# File 'lib/test_sdk.rb', line 23 def user @user end |
Instance Method Details
#healthz(request_options: nil) ⇒ NewDemoApiClient::HealthzResponse
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/test_sdk.rb', line 85 def healthz(request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/api/v1/healthz" end NewDemoApiClient::HealthzResponse.from_json(json_object: response.body) end |