Class: NewDemoApiClient::AsyncTalentClient
- Inherits:
-
Object
- Object
- NewDemoApiClient::AsyncTalentClient
- Defined in:
- lib/test_sdk/talent/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#get_executive_profiles(group_id:, deal_id:, request_options: nil) ⇒ Array<NewDemoApiClient::ExecutiveProfile>
Get the profiles of the executives for the company associated with the deal.
-
#get_seniority_count(group_id:, deal_id:, request_options: nil) ⇒ Array<NewDemoApiClient::EndpointSeniorityCount>
Returns the number of employees at various seniority levels as of the endpoint of the talent data for the deal.
-
#get_team_growth_accounting(group_id:, deal_id:, request_options: nil) ⇒ Array<NewDemoApiClient::FunctionLevelGrowthAccounting>
The function-level growth accounting for employees within the company.
- #initialize(request_client:) ⇒ NewDemoApiClient::AsyncTalentClient constructor
Constructor Details
#initialize(request_client:) ⇒ NewDemoApiClient::AsyncTalentClient
142 143 144 |
# File 'lib/test_sdk/talent/client.rb', line 142 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ NewDemoApiClient::AsyncRequestClient (readonly)
138 139 140 |
# File 'lib/test_sdk/talent/client.rb', line 138 def request_client @request_client end |
Instance Method Details
#get_executive_profiles(group_id:, deal_id:, request_options: nil) ⇒ Array<NewDemoApiClient::ExecutiveProfile>
Get the profiles of the executives for the company associated with the deal.
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/test_sdk/talent/client.rb', line 159 def get_executive_profiles(group_id:, deal_id:, request_options: nil) Async do 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/group/#{group_id}/deal/#{deal_id}/data/executive-profiles" end parsed_json = JSON.parse(response.body) parsed_json&.map do |item| item = item.to_json NewDemoApiClient::ExecutiveProfile.from_json(json_object: item) end end end |
#get_seniority_count(group_id:, deal_id:, request_options: nil) ⇒ Array<NewDemoApiClient::EndpointSeniorityCount>
Returns the number of employees at various seniority levels as of the endpoint
of the talent data for the deal.
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/test_sdk/talent/client.rb', line 199 def get_seniority_count(group_id:, deal_id:, request_options: nil) Async do 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/group/#{group_id}/deal/#{deal_id}/data/seniority-count" end parsed_json = JSON.parse(response.body) parsed_json&.map do |item| item = item.to_json NewDemoApiClient::EndpointSeniorityCount.from_json(json_object: item) end end end |
#get_team_growth_accounting(group_id:, deal_id:, request_options: nil) ⇒ Array<NewDemoApiClient::FunctionLevelGrowthAccounting>
The function-level growth accounting for employees within the company. Measure
how many users join, churn, or
resurrect, at the function level, for each period there is data.
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/test_sdk/talent/client.rb', line 240 def get_team_growth_accounting(group_id:, deal_id:, request_options: nil) Async do 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/group/#{group_id}/deal/#{deal_id}/data/team-growth-accounting" end parsed_json = JSON.parse(response.body) parsed_json&.map do |item| item = item.to_json NewDemoApiClient::FunctionLevelGrowthAccounting.from_json(json_object: item) end end end |