test_sdk 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/core/file_utilities.rb +26 -0
- data/lib/environment.rb +7 -0
- data/lib/gemconfig.rb +14 -0
- data/lib/requests.rb +166 -0
- data/lib/test_sdk/benchmark/client.rb +1031 -0
- data/lib/test_sdk/company/client.rb +474 -0
- data/lib/test_sdk/deal/client.rb +584 -0
- data/lib/test_sdk/file/client.rb +692 -0
- data/lib/test_sdk/financials/client.rb +97 -0
- data/lib/test_sdk/group/client.rb +737 -0
- data/lib/test_sdk/macro/client.rb +422 -0
- data/lib/test_sdk/metadata/client.rb +95 -0
- data/lib/test_sdk/product/client.rb +419 -0
- data/lib/test_sdk/talent/client.rb +266 -0
- data/lib/test_sdk/types/account_manager_response.rb +74 -0
- data/lib/test_sdk/types/all_data_metadata_response.rb +68 -0
- data/lib/test_sdk/types/area.rb +74 -0
- data/lib/test_sdk/types/authenticate_api_key_response.rb +55 -0
- data/lib/test_sdk/types/available_categories_response.rb +5 -0
- data/lib/test_sdk/types/available_models_response.rb +69 -0
- data/lib/test_sdk/types/band_response.rb +83 -0
- data/lib/test_sdk/types/benchmark_quantile.rb +465 -0
- data/lib/test_sdk/types/categories_metadata_response.rb +72 -0
- data/lib/test_sdk/types/category_growth_rates.rb +143 -0
- data/lib/test_sdk/types/category_metadata.rb +79 -0
- data/lib/test_sdk/types/category_metadata_default_user_type.rb +8 -0
- data/lib/test_sdk/types/cohorts_response.rb +132 -0
- data/lib/test_sdk/types/column_metadata.rb +110 -0
- data/lib/test_sdk/types/column_mini_metadata.rb +83 -0
- data/lib/test_sdk/types/columns_metadata_response.rb +72 -0
- data/lib/test_sdk/types/company_response.rb +120 -0
- data/lib/test_sdk/types/concentration_endpoint_cdf_detail.rb +96 -0
- data/lib/test_sdk/types/concentration_endpoint_top_users_detail.rb +72 -0
- data/lib/test_sdk/types/concentration_response.rb +103 -0
- data/lib/test_sdk/types/concentration_timeseries_detail.rb +159 -0
- data/lib/test_sdk/types/contribution_response.rb +135 -0
- data/lib/test_sdk/types/create_api_key_response.rb +55 -0
- data/lib/test_sdk/types/create_file_for_signed_url_response.rb +127 -0
- data/lib/test_sdk/types/create_file_response.rb +113 -0
- data/lib/test_sdk/types/deal_combined_metrics_response.rb +477 -0
- data/lib/test_sdk/types/deal_data_availablity_response.rb +109 -0
- data/lib/test_sdk/types/deal_with_files_response.rb +194 -0
- data/lib/test_sdk/types/endpoint_seniority_count.rb +66 -0
- data/lib/test_sdk/types/executive_profile.rb +91 -0
- data/lib/test_sdk/types/executive_profile_position.rb +97 -0
- data/lib/test_sdk/types/file_response.rb +113 -0
- data/lib/test_sdk/types/file_type.rb +14 -0
- data/lib/test_sdk/types/financial_metrics.rb +113 -0
- data/lib/test_sdk/types/financials_response.rb +102 -0
- data/lib/test_sdk/types/frequency.rb +9 -0
- data/lib/test_sdk/types/function_level_growth_accounting.rb +111 -0
- data/lib/test_sdk/types/gcs_signed_url_response.rb +81 -0
- data/lib/test_sdk/types/group_response.rb +158 -0
- data/lib/test_sdk/types/group_user.rb +124 -0
- data/lib/test_sdk/types/group_with_users_response.rb +170 -0
- data/lib/test_sdk/types/growth_accounting_response.rb +226 -0
- data/lib/test_sdk/types/healthz_response.rb +55 -0
- data/lib/test_sdk/types/http_validation_error.rb +61 -0
- data/lib/test_sdk/types/income_statement_entry.rb +81 -0
- data/lib/test_sdk/types/model_metadata.rb +76 -0
- data/lib/test_sdk/types/models_metadata_response.rb +76 -0
- data/lib/test_sdk/types/paginated_response_company_response.rb +83 -0
- data/lib/test_sdk/types/paginated_response_deal_with_files_response.rb +84 -0
- data/lib/test_sdk/types/paginated_response_file_response.rb +83 -0
- data/lib/test_sdk/types/paginated_response_group_user.rb +83 -0
- data/lib/test_sdk/types/permission_model.rb +65 -0
- data/lib/test_sdk/types/priority.rb +10 -0
- data/lib/test_sdk/types/product_info_response.rb +65 -0
- data/lib/test_sdk/types/role_response.rb +95 -0
- data/lib/test_sdk/types/scale.rb +72 -0
- data/lib/test_sdk/types/scale_model.rb +80 -0
- data/lib/test_sdk/types/scale_models_response.rb +5 -0
- data/lib/test_sdk/types/scaling.rb +10 -0
- data/lib/test_sdk/types/status.rb +12 -0
- data/lib/test_sdk/types/tradeoff_model.rb +95 -0
- data/lib/test_sdk/types/tradeoff_models_response.rb +5 -0
- data/lib/test_sdk/types/unit.rb +12 -0
- data/lib/test_sdk/types/unit_economics_info_response.rb +55 -0
- data/lib/test_sdk/types/user_accounting_response.rb +168 -0
- data/lib/test_sdk/types/user_role_response.rb +77 -0
- data/lib/test_sdk/types/user_type.rb +12 -0
- data/lib/test_sdk/types/user_with_groups_response.rb +140 -0
- data/lib/test_sdk/types/user_with_permissions_response.rb +153 -0
- data/lib/test_sdk/types/validation_error.rb +76 -0
- data/lib/test_sdk/types/validation_error_loc_item.rb +52 -0
- data/lib/test_sdk/types/weather_components.rb +123 -0
- data/lib/test_sdk/types/weather_gauge.rb +76 -0
- data/lib/test_sdk/types/weather_market_context.rb +109 -0
- data/lib/test_sdk/types/weather_metadata.rb +113 -0
- data/lib/test_sdk/unit_economics/client.rb +124 -0
- data/lib/test_sdk/user/client.rb +363 -0
- data/lib/test_sdk.rb +190 -0
- data/lib/types_export.rb +77 -0
- metadata +251 -0
@@ -0,0 +1,113 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
class FinancialMetrics
|
8
|
+
# @return [String] The date of the financial metrics.
|
9
|
+
attr_reader :date
|
10
|
+
# @return [Float] The lifetime gross margin, integrated over all time.
|
11
|
+
attr_reader :lifetime_gross_margin
|
12
|
+
# @return [Float] The lifetime operating margin, integrated over all time.
|
13
|
+
attr_reader :lifetime_operating_margin
|
14
|
+
# @return [Float] The rule of 40, defined as the year over year growth plus the operating margin,
|
15
|
+
# with slight smoothing to handle variations.
|
16
|
+
attr_reader :rule_of40
|
17
|
+
# @return [Float] The magic number, defined as the revenue growth divided by the offset sales and
|
18
|
+
# marketing cost, with slight smoothing to handle variations.
|
19
|
+
attr_reader :magic_number
|
20
|
+
# @return [Float] The burn multiple, defined as the cash burn divided by the revenue growth, with
|
21
|
+
# slight smoothing to handle variations. The operating margin is used in place of
|
22
|
+
# the cash burn if the cash burn is not available. Not defined if the revenue
|
23
|
+
# growth is negative.
|
24
|
+
attr_reader :burn_multiple
|
25
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
attr_reader :additional_properties
|
27
|
+
# @return [Object]
|
28
|
+
attr_reader :_field_set
|
29
|
+
protected :_field_set
|
30
|
+
|
31
|
+
OMIT = Object.new
|
32
|
+
|
33
|
+
# @param date [String] The date of the financial metrics.
|
34
|
+
# @param lifetime_gross_margin [Float] The lifetime gross margin, integrated over all time.
|
35
|
+
# @param lifetime_operating_margin [Float] The lifetime operating margin, integrated over all time.
|
36
|
+
# @param rule_of40 [Float] The rule of 40, defined as the year over year growth plus the operating margin,
|
37
|
+
# with slight smoothing to handle variations.
|
38
|
+
# @param magic_number [Float] The magic number, defined as the revenue growth divided by the offset sales and
|
39
|
+
# marketing cost, with slight smoothing to handle variations.
|
40
|
+
# @param burn_multiple [Float] The burn multiple, defined as the cash burn divided by the revenue growth, with
|
41
|
+
# slight smoothing to handle variations. The operating margin is used in place of
|
42
|
+
# the cash burn if the cash burn is not available. Not defined if the revenue
|
43
|
+
# growth is negative.
|
44
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
45
|
+
# @return [NewDemoApiClient::FinancialMetrics]
|
46
|
+
def initialize(date:, lifetime_gross_margin: OMIT, lifetime_operating_margin: OMIT, rule_of40: OMIT,
|
47
|
+
magic_number: OMIT, burn_multiple: OMIT, additional_properties: nil)
|
48
|
+
@date = date
|
49
|
+
@lifetime_gross_margin = lifetime_gross_margin if lifetime_gross_margin != OMIT
|
50
|
+
@lifetime_operating_margin = lifetime_operating_margin if lifetime_operating_margin != OMIT
|
51
|
+
@rule_of40 = rule_of40 if rule_of40 != OMIT
|
52
|
+
@magic_number = magic_number if magic_number != OMIT
|
53
|
+
@burn_multiple = burn_multiple if burn_multiple != OMIT
|
54
|
+
@additional_properties = additional_properties
|
55
|
+
@_field_set = {
|
56
|
+
"date": date,
|
57
|
+
"lifetime_gross_margin": lifetime_gross_margin,
|
58
|
+
"lifetime_operating_margin": lifetime_operating_margin,
|
59
|
+
"rule_of_40": rule_of40,
|
60
|
+
"magic_number": magic_number,
|
61
|
+
"burn_multiple": burn_multiple
|
62
|
+
}.reject do |_k, v|
|
63
|
+
v == OMIT
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Deserialize a JSON object to an instance of FinancialMetrics
|
68
|
+
#
|
69
|
+
# @param json_object [String]
|
70
|
+
# @return [NewDemoApiClient::FinancialMetrics]
|
71
|
+
def self.from_json(json_object:)
|
72
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
73
|
+
parsed_json = JSON.parse(json_object)
|
74
|
+
date = parsed_json["date"]
|
75
|
+
lifetime_gross_margin = parsed_json["lifetime_gross_margin"]
|
76
|
+
lifetime_operating_margin = parsed_json["lifetime_operating_margin"]
|
77
|
+
rule_of40 = parsed_json["rule_of_40"]
|
78
|
+
magic_number = parsed_json["magic_number"]
|
79
|
+
burn_multiple = parsed_json["burn_multiple"]
|
80
|
+
new(
|
81
|
+
date: date,
|
82
|
+
lifetime_gross_margin: lifetime_gross_margin,
|
83
|
+
lifetime_operating_margin: lifetime_operating_margin,
|
84
|
+
rule_of40: rule_of40,
|
85
|
+
magic_number: magic_number,
|
86
|
+
burn_multiple: burn_multiple,
|
87
|
+
additional_properties: struct
|
88
|
+
)
|
89
|
+
end
|
90
|
+
|
91
|
+
# Serialize an instance of FinancialMetrics to a JSON object
|
92
|
+
#
|
93
|
+
# @return [String]
|
94
|
+
def to_json(*_args)
|
95
|
+
@_field_set&.to_json
|
96
|
+
end
|
97
|
+
|
98
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
99
|
+
# hash and check each fields type against the current object's property
|
100
|
+
# definitions.
|
101
|
+
#
|
102
|
+
# @param obj [Object]
|
103
|
+
# @return [Void]
|
104
|
+
def self.validate_raw(obj:)
|
105
|
+
obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.")
|
106
|
+
obj.lifetime_gross_margin&.is_a?(Float) != false || raise("Passed value for field obj.lifetime_gross_margin is not the expected type, validation failed.")
|
107
|
+
obj.lifetime_operating_margin&.is_a?(Float) != false || raise("Passed value for field obj.lifetime_operating_margin is not the expected type, validation failed.")
|
108
|
+
obj.rule_of40&.is_a?(Float) != false || raise("Passed value for field obj.rule_of40 is not the expected type, validation failed.")
|
109
|
+
obj.magic_number&.is_a?(Float) != false || raise("Passed value for field obj.magic_number is not the expected type, validation failed.")
|
110
|
+
obj.burn_multiple&.is_a?(Float) != false || raise("Passed value for field obj.burn_multiple is not the expected type, validation failed.")
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "frequency"
|
4
|
+
require_relative "income_statement_entry"
|
5
|
+
require_relative "category_growth_rates"
|
6
|
+
require_relative "financial_metrics"
|
7
|
+
require "ostruct"
|
8
|
+
require "json"
|
9
|
+
|
10
|
+
module NewDemoApiClient
|
11
|
+
class FinancialsResponse
|
12
|
+
# @return [NewDemoApiClient::Frequency] The frequency of the financial data.
|
13
|
+
attr_reader :freq
|
14
|
+
# @return [Array<NewDemoApiClient::IncomeStatementEntry>] The entries in the income statement.
|
15
|
+
attr_reader :income_statement
|
16
|
+
# @return [Array<NewDemoApiClient::CategoryGrowthRates>] The growth rates for each category. The c{x}gr values will occur where x matches
|
17
|
+
# the frequency.
|
18
|
+
attr_reader :category_growth_rates
|
19
|
+
# @return [Array<NewDemoApiClient::FinancialMetrics>] Derived financial metrics for the company.
|
20
|
+
attr_reader :financial_metrics
|
21
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
+
attr_reader :additional_properties
|
23
|
+
# @return [Object]
|
24
|
+
attr_reader :_field_set
|
25
|
+
protected :_field_set
|
26
|
+
|
27
|
+
OMIT = Object.new
|
28
|
+
|
29
|
+
# @param freq [NewDemoApiClient::Frequency] The frequency of the financial data.
|
30
|
+
# @param income_statement [Array<NewDemoApiClient::IncomeStatementEntry>] The entries in the income statement.
|
31
|
+
# @param category_growth_rates [Array<NewDemoApiClient::CategoryGrowthRates>] The growth rates for each category. The c{x}gr values will occur where x matches
|
32
|
+
# the frequency.
|
33
|
+
# @param financial_metrics [Array<NewDemoApiClient::FinancialMetrics>] Derived financial metrics for the company.
|
34
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
35
|
+
# @return [NewDemoApiClient::FinancialsResponse]
|
36
|
+
def initialize(freq: OMIT, income_statement: OMIT, category_growth_rates: OMIT, financial_metrics: OMIT,
|
37
|
+
additional_properties: nil)
|
38
|
+
@freq = freq if freq != OMIT
|
39
|
+
@income_statement = income_statement if income_statement != OMIT
|
40
|
+
@category_growth_rates = category_growth_rates if category_growth_rates != OMIT
|
41
|
+
@financial_metrics = financial_metrics if financial_metrics != OMIT
|
42
|
+
@additional_properties = additional_properties
|
43
|
+
@_field_set = {
|
44
|
+
"freq": freq,
|
45
|
+
"income_statement": income_statement,
|
46
|
+
"category_growth_rates": category_growth_rates,
|
47
|
+
"financial_metrics": financial_metrics
|
48
|
+
}.reject do |_k, v|
|
49
|
+
v == OMIT
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# Deserialize a JSON object to an instance of FinancialsResponse
|
54
|
+
#
|
55
|
+
# @param json_object [String]
|
56
|
+
# @return [NewDemoApiClient::FinancialsResponse]
|
57
|
+
def self.from_json(json_object:)
|
58
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
59
|
+
parsed_json = JSON.parse(json_object)
|
60
|
+
freq = parsed_json["freq"]
|
61
|
+
income_statement = parsed_json["income_statement"]&.map do |item|
|
62
|
+
item = item.to_json
|
63
|
+
NewDemoApiClient::IncomeStatementEntry.from_json(json_object: item)
|
64
|
+
end
|
65
|
+
category_growth_rates = parsed_json["category_growth_rates"]&.map do |item|
|
66
|
+
item = item.to_json
|
67
|
+
NewDemoApiClient::CategoryGrowthRates.from_json(json_object: item)
|
68
|
+
end
|
69
|
+
financial_metrics = parsed_json["financial_metrics"]&.map do |item|
|
70
|
+
item = item.to_json
|
71
|
+
NewDemoApiClient::FinancialMetrics.from_json(json_object: item)
|
72
|
+
end
|
73
|
+
new(
|
74
|
+
freq: freq,
|
75
|
+
income_statement: income_statement,
|
76
|
+
category_growth_rates: category_growth_rates,
|
77
|
+
financial_metrics: financial_metrics,
|
78
|
+
additional_properties: struct
|
79
|
+
)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Serialize an instance of FinancialsResponse to a JSON object
|
83
|
+
#
|
84
|
+
# @return [String]
|
85
|
+
def to_json(*_args)
|
86
|
+
@_field_set&.to_json
|
87
|
+
end
|
88
|
+
|
89
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
90
|
+
# hash and check each fields type against the current object's property
|
91
|
+
# definitions.
|
92
|
+
#
|
93
|
+
# @param obj [Object]
|
94
|
+
# @return [Void]
|
95
|
+
def self.validate_raw(obj:)
|
96
|
+
obj.freq&.is_a?(NewDemoApiClient::Frequency) != false || raise("Passed value for field obj.freq is not the expected type, validation failed.")
|
97
|
+
obj.income_statement&.is_a?(Array) != false || raise("Passed value for field obj.income_statement is not the expected type, validation failed.")
|
98
|
+
obj.category_growth_rates&.is_a?(Array) != false || raise("Passed value for field obj.category_growth_rates is not the expected type, validation failed.")
|
99
|
+
obj.financial_metrics&.is_a?(Array) != false || raise("Passed value for field obj.financial_metrics is not the expected type, validation failed.")
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
# Represents the growth accounting metrics at the function level for a company.
|
8
|
+
# This model captures the changes in employee count within specific functions over
|
9
|
+
# time.
|
10
|
+
class FunctionLevelGrowthAccounting
|
11
|
+
# @return [String] The function or department within the company.
|
12
|
+
attr_reader :function
|
13
|
+
# @return [String] The date of the entry in YYYYQ format.
|
14
|
+
attr_reader :date
|
15
|
+
# @return [Integer] The number of active employees in the function during the period.
|
16
|
+
attr_reader :active
|
17
|
+
# @return [Integer] The number of new employees in the function during the period.
|
18
|
+
attr_reader :new
|
19
|
+
# @return [Integer] The number of employees retained in the function from the last period.
|
20
|
+
attr_reader :retained
|
21
|
+
# @return [Integer] The number of employees who left and returned to the function.
|
22
|
+
attr_reader :resurrected
|
23
|
+
# @return [Integer] The number of employees who left the function during the period.
|
24
|
+
attr_reader :churned
|
25
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
attr_reader :additional_properties
|
27
|
+
# @return [Object]
|
28
|
+
attr_reader :_field_set
|
29
|
+
protected :_field_set
|
30
|
+
|
31
|
+
OMIT = Object.new
|
32
|
+
|
33
|
+
# @param function [String] The function or department within the company.
|
34
|
+
# @param date [String] The date of the entry in YYYYQ format.
|
35
|
+
# @param active [Integer] The number of active employees in the function during the period.
|
36
|
+
# @param new [Integer] The number of new employees in the function during the period.
|
37
|
+
# @param retained [Integer] The number of employees retained in the function from the last period.
|
38
|
+
# @param resurrected [Integer] The number of employees who left and returned to the function.
|
39
|
+
# @param churned [Integer] The number of employees who left the function during the period.
|
40
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
41
|
+
# @return [NewDemoApiClient::FunctionLevelGrowthAccounting]
|
42
|
+
def initialize(function:, date:, active:, new:, retained:, resurrected:, churned:, additional_properties: nil)
|
43
|
+
@function = function
|
44
|
+
@date = date
|
45
|
+
@active = active
|
46
|
+
@new = new
|
47
|
+
@retained = retained
|
48
|
+
@resurrected = resurrected
|
49
|
+
@churned = churned
|
50
|
+
@additional_properties = additional_properties
|
51
|
+
@_field_set = {
|
52
|
+
"function": function,
|
53
|
+
"date": date,
|
54
|
+
"active": active,
|
55
|
+
"new": new,
|
56
|
+
"retained": retained,
|
57
|
+
"resurrected": resurrected,
|
58
|
+
"churned": churned
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Deserialize a JSON object to an instance of FunctionLevelGrowthAccounting
|
63
|
+
#
|
64
|
+
# @param json_object [String]
|
65
|
+
# @return [NewDemoApiClient::FunctionLevelGrowthAccounting]
|
66
|
+
def self.from_json(json_object:)
|
67
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
68
|
+
parsed_json = JSON.parse(json_object)
|
69
|
+
function = parsed_json["function"]
|
70
|
+
date = parsed_json["date"]
|
71
|
+
active = parsed_json["active"]
|
72
|
+
new = parsed_json["new"]
|
73
|
+
retained = parsed_json["retained"]
|
74
|
+
resurrected = parsed_json["resurrected"]
|
75
|
+
churned = parsed_json["churned"]
|
76
|
+
new(
|
77
|
+
function: function,
|
78
|
+
date: date,
|
79
|
+
active: active,
|
80
|
+
new: new,
|
81
|
+
retained: retained,
|
82
|
+
resurrected: resurrected,
|
83
|
+
churned: churned,
|
84
|
+
additional_properties: struct
|
85
|
+
)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Serialize an instance of FunctionLevelGrowthAccounting to a JSON object
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
def to_json(*_args)
|
92
|
+
@_field_set&.to_json
|
93
|
+
end
|
94
|
+
|
95
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
96
|
+
# hash and check each fields type against the current object's property
|
97
|
+
# definitions.
|
98
|
+
#
|
99
|
+
# @param obj [Object]
|
100
|
+
# @return [Void]
|
101
|
+
def self.validate_raw(obj:)
|
102
|
+
obj.function.is_a?(String) != false || raise("Passed value for field obj.function is not the expected type, validation failed.")
|
103
|
+
obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.")
|
104
|
+
obj.active.is_a?(Integer) != false || raise("Passed value for field obj.active is not the expected type, validation failed.")
|
105
|
+
obj.new.is_a?(Integer) != false || raise("Passed value for field obj.new is not the expected type, validation failed.")
|
106
|
+
obj.retained.is_a?(Integer) != false || raise("Passed value for field obj.retained is not the expected type, validation failed.")
|
107
|
+
obj.resurrected.is_a?(Integer) != false || raise("Passed value for field obj.resurrected is not the expected type, validation failed.")
|
108
|
+
obj.churned.is_a?(Integer) != false || raise("Passed value for field obj.churned is not the expected type, validation failed.")
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
class GcsSignedURLResponse
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :method
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :url
|
12
|
+
# @return [Hash{String => Object}]
|
13
|
+
attr_reader :fields
|
14
|
+
# @return [Hash{String => Object}]
|
15
|
+
attr_reader :headers
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param method [String]
|
25
|
+
# @param url [String]
|
26
|
+
# @param fields [Hash{String => Object}]
|
27
|
+
# @param headers [Hash{String => Object}]
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [NewDemoApiClient::GcsSignedURLResponse]
|
30
|
+
def initialize(method:, url:, fields: OMIT, headers: OMIT, additional_properties: nil)
|
31
|
+
@method = method
|
32
|
+
@url = url
|
33
|
+
@fields = fields if fields != OMIT
|
34
|
+
@headers = headers if headers != OMIT
|
35
|
+
@additional_properties = additional_properties
|
36
|
+
@_field_set = { "method": method, "url": url, "fields": fields, "headers": headers }.reject do |_k, v|
|
37
|
+
v == OMIT
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# Deserialize a JSON object to an instance of GcsSignedURLResponse
|
42
|
+
#
|
43
|
+
# @param json_object [String]
|
44
|
+
# @return [NewDemoApiClient::GcsSignedURLResponse]
|
45
|
+
def self.from_json(json_object:)
|
46
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
47
|
+
parsed_json = JSON.parse(json_object)
|
48
|
+
method = parsed_json["method"]
|
49
|
+
url = parsed_json["url"]
|
50
|
+
fields = parsed_json["fields"]
|
51
|
+
headers = parsed_json["headers"]
|
52
|
+
new(
|
53
|
+
method: method,
|
54
|
+
url: url,
|
55
|
+
fields: fields,
|
56
|
+
headers: headers,
|
57
|
+
additional_properties: struct
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Serialize an instance of GcsSignedURLResponse to a JSON object
|
62
|
+
#
|
63
|
+
# @return [String]
|
64
|
+
def to_json(*_args)
|
65
|
+
@_field_set&.to_json
|
66
|
+
end
|
67
|
+
|
68
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
69
|
+
# hash and check each fields type against the current object's property
|
70
|
+
# definitions.
|
71
|
+
#
|
72
|
+
# @param obj [Object]
|
73
|
+
# @return [Void]
|
74
|
+
def self.validate_raw(obj:)
|
75
|
+
obj.method.is_a?(String) != false || raise("Passed value for field obj.method is not the expected type, validation failed.")
|
76
|
+
obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
|
77
|
+
obj.fields&.is_a?(Hash) != false || raise("Passed value for field obj.fields is not the expected type, validation failed.")
|
78
|
+
obj.headers&.is_a?(Hash) != false || raise("Passed value for field obj.headers is not the expected type, validation failed.")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,158 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require_relative "account_manager_response"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module NewDemoApiClient
|
9
|
+
class GroupResponse
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :name
|
12
|
+
# @return [String] The domain of the group
|
13
|
+
attr_reader :domain
|
14
|
+
# @return [String] The thumbnail URL of the group
|
15
|
+
attr_reader :thumbnail_url
|
16
|
+
# @return [String] The email address for analysis to be sent to
|
17
|
+
attr_reader :analysis_email
|
18
|
+
# @return [Boolean] Whether the group has access to the data API
|
19
|
+
attr_reader :data_api_access
|
20
|
+
# @return [Integer]
|
21
|
+
attr_reader :id
|
22
|
+
# @return [DateTime]
|
23
|
+
attr_reader :created_at
|
24
|
+
# @return [DateTime]
|
25
|
+
attr_reader :updated_at
|
26
|
+
# @return [Boolean]
|
27
|
+
attr_reader :is_archived
|
28
|
+
# @return [NewDemoApiClient::AccountManagerResponse]
|
29
|
+
attr_reader :account_manager
|
30
|
+
# @return [Integer]
|
31
|
+
attr_reader :user_count
|
32
|
+
# @return [Integer]
|
33
|
+
attr_reader :deal_count
|
34
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
35
|
+
attr_reader :additional_properties
|
36
|
+
# @return [Object]
|
37
|
+
attr_reader :_field_set
|
38
|
+
protected :_field_set
|
39
|
+
|
40
|
+
OMIT = Object.new
|
41
|
+
|
42
|
+
# @param name [String]
|
43
|
+
# @param domain [String] The domain of the group
|
44
|
+
# @param thumbnail_url [String] The thumbnail URL of the group
|
45
|
+
# @param analysis_email [String] The email address for analysis to be sent to
|
46
|
+
# @param data_api_access [Boolean] Whether the group has access to the data API
|
47
|
+
# @param id [Integer]
|
48
|
+
# @param created_at [DateTime]
|
49
|
+
# @param updated_at [DateTime]
|
50
|
+
# @param is_archived [Boolean]
|
51
|
+
# @param account_manager [NewDemoApiClient::AccountManagerResponse]
|
52
|
+
# @param user_count [Integer]
|
53
|
+
# @param deal_count [Integer]
|
54
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
55
|
+
# @return [NewDemoApiClient::GroupResponse]
|
56
|
+
def initialize(name:, domain:, id:, thumbnail_url: OMIT, analysis_email: OMIT, data_api_access: OMIT,
|
57
|
+
created_at: OMIT, updated_at: OMIT, is_archived: OMIT, account_manager: OMIT, user_count: OMIT, deal_count: OMIT, additional_properties: nil)
|
58
|
+
@name = name
|
59
|
+
@domain = domain
|
60
|
+
@thumbnail_url = thumbnail_url if thumbnail_url != OMIT
|
61
|
+
@analysis_email = analysis_email if analysis_email != OMIT
|
62
|
+
@data_api_access = data_api_access if data_api_access != OMIT
|
63
|
+
@id = id
|
64
|
+
@created_at = created_at if created_at != OMIT
|
65
|
+
@updated_at = updated_at if updated_at != OMIT
|
66
|
+
@is_archived = is_archived if is_archived != OMIT
|
67
|
+
@account_manager = account_manager if account_manager != OMIT
|
68
|
+
@user_count = user_count if user_count != OMIT
|
69
|
+
@deal_count = deal_count if deal_count != OMIT
|
70
|
+
@additional_properties = additional_properties
|
71
|
+
@_field_set = {
|
72
|
+
"name": name,
|
73
|
+
"domain": domain,
|
74
|
+
"thumbnail_url": thumbnail_url,
|
75
|
+
"analysis_email": analysis_email,
|
76
|
+
"data_api_access": data_api_access,
|
77
|
+
"id": id,
|
78
|
+
"created_at": created_at,
|
79
|
+
"updated_at": updated_at,
|
80
|
+
"is_archived": is_archived,
|
81
|
+
"account_manager": account_manager,
|
82
|
+
"user_count": user_count,
|
83
|
+
"deal_count": deal_count
|
84
|
+
}.reject do |_k, v|
|
85
|
+
v == OMIT
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# Deserialize a JSON object to an instance of GroupResponse
|
90
|
+
#
|
91
|
+
# @param json_object [String]
|
92
|
+
# @return [NewDemoApiClient::GroupResponse]
|
93
|
+
def self.from_json(json_object:)
|
94
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
95
|
+
parsed_json = JSON.parse(json_object)
|
96
|
+
name = parsed_json["name"]
|
97
|
+
domain = parsed_json["domain"]
|
98
|
+
thumbnail_url = parsed_json["thumbnail_url"]
|
99
|
+
analysis_email = parsed_json["analysis_email"]
|
100
|
+
data_api_access = parsed_json["data_api_access"]
|
101
|
+
id = parsed_json["id"]
|
102
|
+
created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
|
103
|
+
updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
|
104
|
+
is_archived = parsed_json["is_archived"]
|
105
|
+
if parsed_json["account_manager"].nil?
|
106
|
+
account_manager = nil
|
107
|
+
else
|
108
|
+
account_manager = parsed_json["account_manager"].to_json
|
109
|
+
account_manager = NewDemoApiClient::AccountManagerResponse.from_json(json_object: account_manager)
|
110
|
+
end
|
111
|
+
user_count = parsed_json["user_count"]
|
112
|
+
deal_count = parsed_json["deal_count"]
|
113
|
+
new(
|
114
|
+
name: name,
|
115
|
+
domain: domain,
|
116
|
+
thumbnail_url: thumbnail_url,
|
117
|
+
analysis_email: analysis_email,
|
118
|
+
data_api_access: data_api_access,
|
119
|
+
id: id,
|
120
|
+
created_at: created_at,
|
121
|
+
updated_at: updated_at,
|
122
|
+
is_archived: is_archived,
|
123
|
+
account_manager: account_manager,
|
124
|
+
user_count: user_count,
|
125
|
+
deal_count: deal_count,
|
126
|
+
additional_properties: struct
|
127
|
+
)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Serialize an instance of GroupResponse to a JSON object
|
131
|
+
#
|
132
|
+
# @return [String]
|
133
|
+
def to_json(*_args)
|
134
|
+
@_field_set&.to_json
|
135
|
+
end
|
136
|
+
|
137
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
138
|
+
# hash and check each fields type against the current object's property
|
139
|
+
# definitions.
|
140
|
+
#
|
141
|
+
# @param obj [Object]
|
142
|
+
# @return [Void]
|
143
|
+
def self.validate_raw(obj:)
|
144
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
145
|
+
obj.domain.is_a?(String) != false || raise("Passed value for field obj.domain is not the expected type, validation failed.")
|
146
|
+
obj.thumbnail_url&.is_a?(String) != false || raise("Passed value for field obj.thumbnail_url is not the expected type, validation failed.")
|
147
|
+
obj.analysis_email&.is_a?(String) != false || raise("Passed value for field obj.analysis_email is not the expected type, validation failed.")
|
148
|
+
obj.data_api_access&.is_a?(Boolean) != false || raise("Passed value for field obj.data_api_access is not the expected type, validation failed.")
|
149
|
+
obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
150
|
+
obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
151
|
+
obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
152
|
+
obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
|
153
|
+
obj.account_manager.nil? || NewDemoApiClient::AccountManagerResponse.validate_raw(obj: obj.account_manager)
|
154
|
+
obj.user_count&.is_a?(Integer) != false || raise("Passed value for field obj.user_count is not the expected type, validation failed.")
|
155
|
+
obj.deal_count&.is_a?(Integer) != false || raise("Passed value for field obj.deal_count is not the expected type, validation failed.")
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|