Class: NewDemoApiClient::AsyncTalentClient

Inherits:
Object
  • Object
show all
Defined in:
lib/test_sdk/talent/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ NewDemoApiClient::AsyncTalentClient

Parameters:



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_clientNewDemoApiClient::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.

Examples:

api = NewDemoApiClient::Client.new(
  base_url: "https://api.example.com",
  environment: NewDemoApiClient::Environment::DEFAULT,
  token: "YOUR_AUTH_TOKEN"
)
api.talent.get_executive_profiles(group_id: 1, deal_id: 1)

Parameters:

Returns:



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.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      unless request_options.nil? || request_options&.additional_body_parameters.nil?
        req.body = { **(request_options&.additional_body_parameters || {}) }.compact
      end
      req.url "#{@request_client.get_url(request_options: 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.

Examples:

api = NewDemoApiClient::Client.new(
  base_url: "https://api.example.com",
  environment: NewDemoApiClient::Environment::DEFAULT,
  token: "YOUR_AUTH_TOKEN"
)
api.talent.get_seniority_count(group_id: 1, deal_id: 1)

Parameters:

Returns:



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.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      unless request_options.nil? || request_options&.additional_body_parameters.nil?
        req.body = { **(request_options&.additional_body_parameters || {}) }.compact
      end
      req.url "#{@request_client.get_url(request_options: 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.

Examples:

api = NewDemoApiClient::Client.new(
  base_url: "https://api.example.com",
  environment: NewDemoApiClient::Environment::DEFAULT,
  token: "YOUR_AUTH_TOKEN"
)
api.talent.get_team_growth_accounting(group_id: 1, deal_id: 1)

Parameters:

Returns:



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.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      unless request_options.nil? || request_options&.additional_body_parameters.nil?
        req.body = { **(request_options&.additional_body_parameters || {}) }.compact
      end
      req.url "#{@request_client.get_url(request_options: 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