Class: NewDemoApiClient::TalentClient
- Inherits:
-
Object
- Object
- NewDemoApiClient::TalentClient
- 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::TalentClient constructor
Constructor Details
#initialize(request_client:) ⇒ NewDemoApiClient::TalentClient
17 18 19 |
# File 'lib/test_sdk/talent/client.rb', line 17 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ NewDemoApiClient::RequestClient (readonly)
13 14 15 |
# File 'lib/test_sdk/talent/client.rb', line 13 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.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/test_sdk/talent/client.rb', line 34 def get_executive_profiles(group_id:, deal_id:, 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/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 |
#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.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/test_sdk/talent/client.rb', line 72 def get_seniority_count(group_id:, deal_id:, 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/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 |
#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.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/test_sdk/talent/client.rb', line 111 def get_team_growth_accounting(group_id:, deal_id:, 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/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 |