Class: NewDemoApiClient::AsyncClient
- Inherits:
-
Object
- Object
- NewDemoApiClient::AsyncClient
- Defined in:
- lib/test_sdk.rb
Instance Attribute Summary collapse
- #benchmark ⇒ NewDemoApiClient::AsyncBenchmarkClient readonly
- #company ⇒ NewDemoApiClient::AsyncCompanyClient readonly
- #deal ⇒ NewDemoApiClient::AsyncDealClient readonly
- #file ⇒ NewDemoApiClient::AsyncFileClient readonly
- #financials ⇒ NewDemoApiClient::AsyncFinancialsClient readonly
- #group ⇒ NewDemoApiClient::AsyncGroupClient readonly
- #macro ⇒ NewDemoApiClient::AsyncMacroClient readonly
- #metadata ⇒ NewDemoApiClient::AsyncMetadataClient readonly
- #product ⇒ NewDemoApiClient::AsyncProductClient readonly
- #talent ⇒ NewDemoApiClient::AsyncTalentClient readonly
- #unit_economics ⇒ NewDemoApiClient::AsyncUnitEconomicsClient readonly
- #user ⇒ NewDemoApiClient::AsyncUserClient 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::AsyncClient constructor
Constructor Details
#initialize(token:, base_url: nil, environment: NewDemoApiClient::Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil) ⇒ NewDemoApiClient::AsyncClient
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/test_sdk.rb', line 138 def initialize(token:, base_url: nil, environment: NewDemoApiClient::Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil) @async_request_client = NewDemoApiClient::AsyncRequestClient.new( base_url: base_url, environment: environment, max_retries: max_retries, timeout_in_seconds: timeout_in_seconds, token: token ) @user = NewDemoApiClient::AsyncUserClient.new(request_client: @async_request_client) @group = NewDemoApiClient::AsyncGroupClient.new(request_client: @async_request_client) @macro = NewDemoApiClient::AsyncMacroClient.new(request_client: @async_request_client) @company = NewDemoApiClient::AsyncCompanyClient.new(request_client: @async_request_client) @deal = NewDemoApiClient::AsyncDealClient.new(request_client: @async_request_client) @file = NewDemoApiClient::AsyncFileClient.new(request_client: @async_request_client) @financials = NewDemoApiClient::AsyncFinancialsClient.new(request_client: @async_request_client) @product = NewDemoApiClient::AsyncProductClient.new(request_client: @async_request_client) @talent = NewDemoApiClient::AsyncTalentClient.new(request_client: @async_request_client) @unit_economics = NewDemoApiClient::AsyncUnitEconomicsClient.new(request_client: @async_request_client) @metadata = NewDemoApiClient::AsyncMetadataClient.new(request_client: @async_request_client) @benchmark = NewDemoApiClient::AsyncBenchmarkClient.new(request_client: @async_request_client) end |
Instance Attribute Details
#benchmark ⇒ NewDemoApiClient::AsyncBenchmarkClient (readonly)
130 131 132 |
# File 'lib/test_sdk.rb', line 130 def benchmark @benchmark end |
#company ⇒ NewDemoApiClient::AsyncCompanyClient (readonly)
114 115 116 |
# File 'lib/test_sdk.rb', line 114 def company @company end |
#deal ⇒ NewDemoApiClient::AsyncDealClient (readonly)
116 117 118 |
# File 'lib/test_sdk.rb', line 116 def deal @deal end |
#file ⇒ NewDemoApiClient::AsyncFileClient (readonly)
118 119 120 |
# File 'lib/test_sdk.rb', line 118 def file @file end |
#financials ⇒ NewDemoApiClient::AsyncFinancialsClient (readonly)
120 121 122 |
# File 'lib/test_sdk.rb', line 120 def financials @financials end |
#group ⇒ NewDemoApiClient::AsyncGroupClient (readonly)
110 111 112 |
# File 'lib/test_sdk.rb', line 110 def group @group end |
#macro ⇒ NewDemoApiClient::AsyncMacroClient (readonly)
112 113 114 |
# File 'lib/test_sdk.rb', line 112 def macro @macro end |
#metadata ⇒ NewDemoApiClient::AsyncMetadataClient (readonly)
128 129 130 |
# File 'lib/test_sdk.rb', line 128 def @metadata end |
#product ⇒ NewDemoApiClient::AsyncProductClient (readonly)
122 123 124 |
# File 'lib/test_sdk.rb', line 122 def product @product end |
#talent ⇒ NewDemoApiClient::AsyncTalentClient (readonly)
124 125 126 |
# File 'lib/test_sdk.rb', line 124 def talent @talent end |
#unit_economics ⇒ NewDemoApiClient::AsyncUnitEconomicsClient (readonly)
126 127 128 |
# File 'lib/test_sdk.rb', line 126 def unit_economics @unit_economics end |
#user ⇒ NewDemoApiClient::AsyncUserClient (readonly)
108 109 110 |
# File 'lib/test_sdk.rb', line 108 def user @user end |
Instance Method Details
#healthz(request_options: nil) ⇒ NewDemoApiClient::HealthzResponse
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/test_sdk.rb', line 170 def healthz(request_options: nil) response = @async_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 || {}), **@async_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 "#{@async_request_client.get_url(request_options: )}/api/v1/healthz" end NewDemoApiClient::HealthzResponse.from_json(json_object: response.body) end |