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,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
class ProductInfoResponse
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :user_type
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :metric
|
12
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
attr_reader :additional_properties
|
14
|
+
# @return [Object]
|
15
|
+
attr_reader :_field_set
|
16
|
+
protected :_field_set
|
17
|
+
|
18
|
+
OMIT = Object.new
|
19
|
+
|
20
|
+
# @param user_type [String]
|
21
|
+
# @param metric [String]
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [NewDemoApiClient::ProductInfoResponse]
|
24
|
+
def initialize(user_type:, metric:, additional_properties: nil)
|
25
|
+
@user_type = user_type
|
26
|
+
@metric = metric
|
27
|
+
@additional_properties = additional_properties
|
28
|
+
@_field_set = { "user_type": user_type, "metric": metric }
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deserialize a JSON object to an instance of ProductInfoResponse
|
32
|
+
#
|
33
|
+
# @param json_object [String]
|
34
|
+
# @return [NewDemoApiClient::ProductInfoResponse]
|
35
|
+
def self.from_json(json_object:)
|
36
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
37
|
+
parsed_json = JSON.parse(json_object)
|
38
|
+
user_type = parsed_json["user_type"]
|
39
|
+
metric = parsed_json["metric"]
|
40
|
+
new(
|
41
|
+
user_type: user_type,
|
42
|
+
metric: metric,
|
43
|
+
additional_properties: struct
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Serialize an instance of ProductInfoResponse to a JSON object
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
def to_json(*_args)
|
51
|
+
@_field_set&.to_json
|
52
|
+
end
|
53
|
+
|
54
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
55
|
+
# hash and check each fields type against the current object's property
|
56
|
+
# definitions.
|
57
|
+
#
|
58
|
+
# @param obj [Object]
|
59
|
+
# @return [Void]
|
60
|
+
def self.validate_raw(obj:)
|
61
|
+
obj.user_type.is_a?(String) != false || raise("Passed value for field obj.user_type is not the expected type, validation failed.")
|
62
|
+
obj.metric.is_a?(String) != false || raise("Passed value for field obj.metric is not the expected type, validation failed.")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module NewDemoApiClient
|
8
|
+
class RoleResponse
|
9
|
+
# @return [Integer]
|
10
|
+
attr_reader :id
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :name
|
13
|
+
# @return [DateTime]
|
14
|
+
attr_reader :created_at
|
15
|
+
# @return [DateTime]
|
16
|
+
attr_reader :updated_at
|
17
|
+
# @return [Boolean]
|
18
|
+
attr_reader :is_archived
|
19
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
+
attr_reader :additional_properties
|
21
|
+
# @return [Object]
|
22
|
+
attr_reader :_field_set
|
23
|
+
protected :_field_set
|
24
|
+
|
25
|
+
OMIT = Object.new
|
26
|
+
|
27
|
+
# @param id [Integer]
|
28
|
+
# @param name [String]
|
29
|
+
# @param created_at [DateTime]
|
30
|
+
# @param updated_at [DateTime]
|
31
|
+
# @param is_archived [Boolean]
|
32
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
33
|
+
# @return [NewDemoApiClient::RoleResponse]
|
34
|
+
def initialize(id:, name:, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, additional_properties: nil)
|
35
|
+
@id = id
|
36
|
+
@name = name
|
37
|
+
@created_at = created_at if created_at != OMIT
|
38
|
+
@updated_at = updated_at if updated_at != OMIT
|
39
|
+
@is_archived = is_archived if is_archived != OMIT
|
40
|
+
@additional_properties = additional_properties
|
41
|
+
@_field_set = {
|
42
|
+
"id": id,
|
43
|
+
"name": name,
|
44
|
+
"created_at": created_at,
|
45
|
+
"updated_at": updated_at,
|
46
|
+
"is_archived": is_archived
|
47
|
+
}.reject do |_k, v|
|
48
|
+
v == OMIT
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Deserialize a JSON object to an instance of RoleResponse
|
53
|
+
#
|
54
|
+
# @param json_object [String]
|
55
|
+
# @return [NewDemoApiClient::RoleResponse]
|
56
|
+
def self.from_json(json_object:)
|
57
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
58
|
+
parsed_json = JSON.parse(json_object)
|
59
|
+
id = parsed_json["id"]
|
60
|
+
name = parsed_json["name"]
|
61
|
+
created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
|
62
|
+
updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
|
63
|
+
is_archived = parsed_json["is_archived"]
|
64
|
+
new(
|
65
|
+
id: id,
|
66
|
+
name: name,
|
67
|
+
created_at: created_at,
|
68
|
+
updated_at: updated_at,
|
69
|
+
is_archived: is_archived,
|
70
|
+
additional_properties: struct
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Serialize an instance of RoleResponse to a JSON object
|
75
|
+
#
|
76
|
+
# @return [String]
|
77
|
+
def to_json(*_args)
|
78
|
+
@_field_set&.to_json
|
79
|
+
end
|
80
|
+
|
81
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
82
|
+
# hash and check each fields type against the current object's property
|
83
|
+
# definitions.
|
84
|
+
#
|
85
|
+
# @param obj [Object]
|
86
|
+
# @return [Void]
|
87
|
+
def self.validate_raw(obj:)
|
88
|
+
obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
89
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
90
|
+
obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
91
|
+
obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
92
|
+
obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
class Scale
|
8
|
+
# @return [String] The metric whose scale is used to subset the benchmark data.
|
9
|
+
attr_reader :metric
|
10
|
+
# @return [Float] Low end of the scale.
|
11
|
+
attr_reader :low
|
12
|
+
# @return [Float] High end of the scale.
|
13
|
+
attr_reader :high
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param metric [String] The metric whose scale is used to subset the benchmark data.
|
23
|
+
# @param low [Float] Low end of the scale.
|
24
|
+
# @param high [Float] High end of the scale.
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
# @return [NewDemoApiClient::Scale]
|
27
|
+
def initialize(metric:, low:, high:, additional_properties: nil)
|
28
|
+
@metric = metric
|
29
|
+
@low = low
|
30
|
+
@high = high
|
31
|
+
@additional_properties = additional_properties
|
32
|
+
@_field_set = { "metric": metric, "low": low, "high": high }
|
33
|
+
end
|
34
|
+
|
35
|
+
# Deserialize a JSON object to an instance of Scale
|
36
|
+
#
|
37
|
+
# @param json_object [String]
|
38
|
+
# @return [NewDemoApiClient::Scale]
|
39
|
+
def self.from_json(json_object:)
|
40
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
41
|
+
parsed_json = JSON.parse(json_object)
|
42
|
+
metric = parsed_json["metric"]
|
43
|
+
low = parsed_json["low"]
|
44
|
+
high = parsed_json["high"]
|
45
|
+
new(
|
46
|
+
metric: metric,
|
47
|
+
low: low,
|
48
|
+
high: high,
|
49
|
+
additional_properties: struct
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Serialize an instance of Scale to a JSON object
|
54
|
+
#
|
55
|
+
# @return [String]
|
56
|
+
def to_json(*_args)
|
57
|
+
@_field_set&.to_json
|
58
|
+
end
|
59
|
+
|
60
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
61
|
+
# hash and check each fields type against the current object's property
|
62
|
+
# definitions.
|
63
|
+
#
|
64
|
+
# @param obj [Object]
|
65
|
+
# @return [Void]
|
66
|
+
def self.validate_raw(obj:)
|
67
|
+
obj.metric.is_a?(String) != false || raise("Passed value for field obj.metric is not the expected type, validation failed.")
|
68
|
+
obj.low.is_a?(Float) != false || raise("Passed value for field obj.low is not the expected type, validation failed.")
|
69
|
+
obj.high.is_a?(Float) != false || raise("Passed value for field obj.high is not the expected type, validation failed.")
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "band_response"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module NewDemoApiClient
|
8
|
+
class ScaleModel
|
9
|
+
# @return [Array<Hash{String => Float}>] Raw data points used to generate the scaling model. Dictionary of the two
|
10
|
+
# metrics, x then y.
|
11
|
+
attr_reader :raw_data
|
12
|
+
# @return [Array<Hash{String => Float}>] Predicted center trend line of the scaling model. Dictioary of the two metrics,
|
13
|
+
# x then y.
|
14
|
+
attr_reader :pred
|
15
|
+
# @return [Array<NewDemoApiClient::BandResponse>] Bands representing the range of the scaling model.
|
16
|
+
attr_reader :bands
|
17
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
18
|
+
attr_reader :additional_properties
|
19
|
+
# @return [Object]
|
20
|
+
attr_reader :_field_set
|
21
|
+
protected :_field_set
|
22
|
+
|
23
|
+
OMIT = Object.new
|
24
|
+
|
25
|
+
# @param raw_data [Array<Hash{String => Float}>] Raw data points used to generate the scaling model. Dictionary of the two
|
26
|
+
# metrics, x then y.
|
27
|
+
# @param pred [Array<Hash{String => Float}>] Predicted center trend line of the scaling model. Dictioary of the two metrics,
|
28
|
+
# x then y.
|
29
|
+
# @param bands [Array<NewDemoApiClient::BandResponse>] Bands representing the range of the scaling model.
|
30
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
31
|
+
# @return [NewDemoApiClient::ScaleModel]
|
32
|
+
def initialize(raw_data:, pred:, bands:, additional_properties: nil)
|
33
|
+
@raw_data = raw_data
|
34
|
+
@pred = pred
|
35
|
+
@bands = bands
|
36
|
+
@additional_properties = additional_properties
|
37
|
+
@_field_set = { "raw_data": raw_data, "pred": pred, "bands": bands }
|
38
|
+
end
|
39
|
+
|
40
|
+
# Deserialize a JSON object to an instance of ScaleModel
|
41
|
+
#
|
42
|
+
# @param json_object [String]
|
43
|
+
# @return [NewDemoApiClient::ScaleModel]
|
44
|
+
def self.from_json(json_object:)
|
45
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
46
|
+
parsed_json = JSON.parse(json_object)
|
47
|
+
raw_data = parsed_json["raw_data"]
|
48
|
+
pred = parsed_json["pred"]
|
49
|
+
bands = parsed_json["bands"]&.map do |item|
|
50
|
+
item = item.to_json
|
51
|
+
NewDemoApiClient::BandResponse.from_json(json_object: item)
|
52
|
+
end
|
53
|
+
new(
|
54
|
+
raw_data: raw_data,
|
55
|
+
pred: pred,
|
56
|
+
bands: bands,
|
57
|
+
additional_properties: struct
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Serialize an instance of ScaleModel 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.raw_data.is_a?(Array) != false || raise("Passed value for field obj.raw_data is not the expected type, validation failed.")
|
76
|
+
obj.pred.is_a?(Array) != false || raise("Passed value for field obj.pred is not the expected type, validation failed.")
|
77
|
+
obj.bands.is_a?(Array) != false || raise("Passed value for field obj.bands is not the expected type, validation failed.")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NewDemoApiClient
|
4
|
+
# The scaling type of the column. Geometric indicates exponential changes are
|
5
|
+
# expected, while arithmetic indicates linear changes.
|
6
|
+
class Scaling
|
7
|
+
GEOMETRIC = "geometric"
|
8
|
+
ARITHMETIC = "arithmetic"
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "scale"
|
4
|
+
require_relative "area"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module NewDemoApiClient
|
9
|
+
class TradeoffModel
|
10
|
+
# @return [NewDemoApiClient::Scale] Describes the revenue range of the data whose points represent the trade off.
|
11
|
+
attr_reader :scale
|
12
|
+
# @return [Array<Hash{String => Float}>] Raw data points used to generate the scaling model. Dictionary of the two
|
13
|
+
# metrics, x then y.
|
14
|
+
attr_reader :raw_data
|
15
|
+
# @return [Array<Hash{String => Float}>] Additional raw data points which were not used in the model fit due to oulier
|
16
|
+
# status. Dictionary of the two metrics, x then y.
|
17
|
+
attr_reader :discarded_raw_data
|
18
|
+
# @return [Array<NewDemoApiClient::Area>] Areas representing the range of the scaling model. The x-y coordinates describe
|
19
|
+
# a surface containing 1 - alpha share of the data points.
|
20
|
+
attr_reader :areas
|
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 scale [NewDemoApiClient::Scale] Describes the revenue range of the data whose points represent the trade off.
|
30
|
+
# @param raw_data [Array<Hash{String => Float}>] Raw data points used to generate the scaling model. Dictionary of the two
|
31
|
+
# metrics, x then y.
|
32
|
+
# @param discarded_raw_data [Array<Hash{String => Float}>] Additional raw data points which were not used in the model fit due to oulier
|
33
|
+
# status. Dictionary of the two metrics, x then y.
|
34
|
+
# @param areas [Array<NewDemoApiClient::Area>] Areas representing the range of the scaling model. The x-y coordinates describe
|
35
|
+
# a surface containing 1 - alpha share of the data points.
|
36
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
37
|
+
# @return [NewDemoApiClient::TradeoffModel]
|
38
|
+
def initialize(scale:, raw_data:, discarded_raw_data:, areas:, additional_properties: nil)
|
39
|
+
@scale = scale
|
40
|
+
@raw_data = raw_data
|
41
|
+
@discarded_raw_data = discarded_raw_data
|
42
|
+
@areas = areas
|
43
|
+
@additional_properties = additional_properties
|
44
|
+
@_field_set = { "scale": scale, "raw_data": raw_data, "discarded_raw_data": discarded_raw_data, "areas": areas }
|
45
|
+
end
|
46
|
+
|
47
|
+
# Deserialize a JSON object to an instance of TradeoffModel
|
48
|
+
#
|
49
|
+
# @param json_object [String]
|
50
|
+
# @return [NewDemoApiClient::TradeoffModel]
|
51
|
+
def self.from_json(json_object:)
|
52
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
53
|
+
parsed_json = JSON.parse(json_object)
|
54
|
+
if parsed_json["scale"].nil?
|
55
|
+
scale = nil
|
56
|
+
else
|
57
|
+
scale = parsed_json["scale"].to_json
|
58
|
+
scale = NewDemoApiClient::Scale.from_json(json_object: scale)
|
59
|
+
end
|
60
|
+
raw_data = parsed_json["raw_data"]
|
61
|
+
discarded_raw_data = parsed_json["discarded_raw_data"]
|
62
|
+
areas = parsed_json["areas"]&.map do |item|
|
63
|
+
item = item.to_json
|
64
|
+
NewDemoApiClient::Area.from_json(json_object: item)
|
65
|
+
end
|
66
|
+
new(
|
67
|
+
scale: scale,
|
68
|
+
raw_data: raw_data,
|
69
|
+
discarded_raw_data: discarded_raw_data,
|
70
|
+
areas: areas,
|
71
|
+
additional_properties: struct
|
72
|
+
)
|
73
|
+
end
|
74
|
+
|
75
|
+
# Serialize an instance of TradeoffModel to a JSON object
|
76
|
+
#
|
77
|
+
# @return [String]
|
78
|
+
def to_json(*_args)
|
79
|
+
@_field_set&.to_json
|
80
|
+
end
|
81
|
+
|
82
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
83
|
+
# hash and check each fields type against the current object's property
|
84
|
+
# definitions.
|
85
|
+
#
|
86
|
+
# @param obj [Object]
|
87
|
+
# @return [Void]
|
88
|
+
def self.validate_raw(obj:)
|
89
|
+
NewDemoApiClient::Scale.validate_raw(obj: obj.scale)
|
90
|
+
obj.raw_data.is_a?(Array) != false || raise("Passed value for field obj.raw_data is not the expected type, validation failed.")
|
91
|
+
obj.discarded_raw_data.is_a?(Array) != false || raise("Passed value for field obj.discarded_raw_data is not the expected type, validation failed.")
|
92
|
+
obj.areas.is_a?(Array) != false || raise("Passed value for field obj.areas is not the expected type, validation failed.")
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
class UnitEconomicsInfoResponse
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :user_type
|
10
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
11
|
+
attr_reader :additional_properties
|
12
|
+
# @return [Object]
|
13
|
+
attr_reader :_field_set
|
14
|
+
protected :_field_set
|
15
|
+
|
16
|
+
OMIT = Object.new
|
17
|
+
|
18
|
+
# @param user_type [String]
|
19
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
+
# @return [NewDemoApiClient::UnitEconomicsInfoResponse]
|
21
|
+
def initialize(user_type:, additional_properties: nil)
|
22
|
+
@user_type = user_type
|
23
|
+
@additional_properties = additional_properties
|
24
|
+
@_field_set = { "user_type": user_type }
|
25
|
+
end
|
26
|
+
|
27
|
+
# Deserialize a JSON object to an instance of UnitEconomicsInfoResponse
|
28
|
+
#
|
29
|
+
# @param json_object [String]
|
30
|
+
# @return [NewDemoApiClient::UnitEconomicsInfoResponse]
|
31
|
+
def self.from_json(json_object:)
|
32
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
33
|
+
parsed_json = JSON.parse(json_object)
|
34
|
+
user_type = parsed_json["user_type"]
|
35
|
+
new(user_type: user_type, additional_properties: struct)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Serialize an instance of UnitEconomicsInfoResponse to a JSON object
|
39
|
+
#
|
40
|
+
# @return [String]
|
41
|
+
def to_json(*_args)
|
42
|
+
@_field_set&.to_json
|
43
|
+
end
|
44
|
+
|
45
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
46
|
+
# hash and check each fields type against the current object's property
|
47
|
+
# definitions.
|
48
|
+
#
|
49
|
+
# @param obj [Object]
|
50
|
+
# @return [Void]
|
51
|
+
def self.validate_raw(obj:)
|
52
|
+
obj.user_type.is_a?(String) != false || raise("Passed value for field obj.user_type is not the expected type, validation failed.")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,168 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
# Represents the basic growth accounting metrics for the user count.
|
8
|
+
class UserAccountingResponse
|
9
|
+
# @return [String] The date of the entry.
|
10
|
+
attr_reader :date
|
11
|
+
# @return [Integer] The number of active users in the period.
|
12
|
+
attr_reader :active_users
|
13
|
+
# @return [Integer] The number of retained users from the last period in the current period.
|
14
|
+
attr_reader :retained
|
15
|
+
# @return [Integer] The number of new users in the period.
|
16
|
+
attr_reader :new
|
17
|
+
# @return [Integer] The number of resurrected users in the period.
|
18
|
+
attr_reader :resurrected
|
19
|
+
# @return [Integer] The number of churned users in the period.
|
20
|
+
attr_reader :churned
|
21
|
+
# @return [Float] 3-month user count growth rate, for monthly frequency.
|
22
|
+
attr_reader :cmgr3
|
23
|
+
# @return [Float] 6-month user count growth rate, for monthly frequency.
|
24
|
+
attr_reader :cmgr6
|
25
|
+
# @return [Float] 12-month user count growth rate, for monthly frequency.
|
26
|
+
attr_reader :cmgr12
|
27
|
+
# @return [Float] 1-quarter user count growth rate, for quarterly frequency.
|
28
|
+
attr_reader :cqgr1
|
29
|
+
# @return [Float] 2-quarter user count growth rate, for quarterly frequency.
|
30
|
+
attr_reader :cqgr2
|
31
|
+
# @return [Float] 4-quarter user count growth rate, for quarterly frequency.
|
32
|
+
attr_reader :cqgr4
|
33
|
+
# @return [Float] The logo retention rate, defined as retained / active over last period.
|
34
|
+
attr_reader :logo_retention
|
35
|
+
# @return [Float] The quick ratio, defined as (resurrected + new) / churned.
|
36
|
+
attr_reader :quick_ratio
|
37
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
38
|
+
attr_reader :additional_properties
|
39
|
+
# @return [Object]
|
40
|
+
attr_reader :_field_set
|
41
|
+
protected :_field_set
|
42
|
+
|
43
|
+
OMIT = Object.new
|
44
|
+
|
45
|
+
# @param date [String] The date of the entry.
|
46
|
+
# @param active_users [Integer] The number of active users in the period.
|
47
|
+
# @param retained [Integer] The number of retained users from the last period in the current period.
|
48
|
+
# @param new [Integer] The number of new users in the period.
|
49
|
+
# @param resurrected [Integer] The number of resurrected users in the period.
|
50
|
+
# @param churned [Integer] The number of churned users in the period.
|
51
|
+
# @param cmgr3 [Float] 3-month user count growth rate, for monthly frequency.
|
52
|
+
# @param cmgr6 [Float] 6-month user count growth rate, for monthly frequency.
|
53
|
+
# @param cmgr12 [Float] 12-month user count growth rate, for monthly frequency.
|
54
|
+
# @param cqgr1 [Float] 1-quarter user count growth rate, for quarterly frequency.
|
55
|
+
# @param cqgr2 [Float] 2-quarter user count growth rate, for quarterly frequency.
|
56
|
+
# @param cqgr4 [Float] 4-quarter user count growth rate, for quarterly frequency.
|
57
|
+
# @param logo_retention [Float] The logo retention rate, defined as retained / active over last period.
|
58
|
+
# @param quick_ratio [Float] The quick ratio, defined as (resurrected + new) / churned.
|
59
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
60
|
+
# @return [NewDemoApiClient::UserAccountingResponse]
|
61
|
+
def initialize(date:, active_users:, retained: OMIT, new: OMIT, resurrected: OMIT, churned: OMIT, cmgr3: OMIT,
|
62
|
+
cmgr6: OMIT, cmgr12: OMIT, cqgr1: OMIT, cqgr2: OMIT, cqgr4: OMIT, logo_retention: OMIT, quick_ratio: OMIT, additional_properties: nil)
|
63
|
+
@date = date
|
64
|
+
@active_users = active_users
|
65
|
+
@retained = retained if retained != OMIT
|
66
|
+
@new = new if new != OMIT
|
67
|
+
@resurrected = resurrected if resurrected != OMIT
|
68
|
+
@churned = churned if churned != OMIT
|
69
|
+
@cmgr3 = cmgr3 if cmgr3 != OMIT
|
70
|
+
@cmgr6 = cmgr6 if cmgr6 != OMIT
|
71
|
+
@cmgr12 = cmgr12 if cmgr12 != OMIT
|
72
|
+
@cqgr1 = cqgr1 if cqgr1 != OMIT
|
73
|
+
@cqgr2 = cqgr2 if cqgr2 != OMIT
|
74
|
+
@cqgr4 = cqgr4 if cqgr4 != OMIT
|
75
|
+
@logo_retention = logo_retention if logo_retention != OMIT
|
76
|
+
@quick_ratio = quick_ratio if quick_ratio != OMIT
|
77
|
+
@additional_properties = additional_properties
|
78
|
+
@_field_set = {
|
79
|
+
"date": date,
|
80
|
+
"active_users": active_users,
|
81
|
+
"retained": retained,
|
82
|
+
"new": new,
|
83
|
+
"resurrected": resurrected,
|
84
|
+
"churned": churned,
|
85
|
+
"cmgr3": cmgr3,
|
86
|
+
"cmgr6": cmgr6,
|
87
|
+
"cmgr12": cmgr12,
|
88
|
+
"cqgr1": cqgr1,
|
89
|
+
"cqgr2": cqgr2,
|
90
|
+
"cqgr4": cqgr4,
|
91
|
+
"logo_retention": logo_retention,
|
92
|
+
"quick_ratio": quick_ratio
|
93
|
+
}.reject do |_k, v|
|
94
|
+
v == OMIT
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# Deserialize a JSON object to an instance of UserAccountingResponse
|
99
|
+
#
|
100
|
+
# @param json_object [String]
|
101
|
+
# @return [NewDemoApiClient::UserAccountingResponse]
|
102
|
+
def self.from_json(json_object:)
|
103
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
104
|
+
parsed_json = JSON.parse(json_object)
|
105
|
+
date = parsed_json["date"]
|
106
|
+
active_users = parsed_json["active_users"]
|
107
|
+
retained = parsed_json["retained"]
|
108
|
+
new = parsed_json["new"]
|
109
|
+
resurrected = parsed_json["resurrected"]
|
110
|
+
churned = parsed_json["churned"]
|
111
|
+
cmgr3 = parsed_json["cmgr3"]
|
112
|
+
cmgr6 = parsed_json["cmgr6"]
|
113
|
+
cmgr12 = parsed_json["cmgr12"]
|
114
|
+
cqgr1 = parsed_json["cqgr1"]
|
115
|
+
cqgr2 = parsed_json["cqgr2"]
|
116
|
+
cqgr4 = parsed_json["cqgr4"]
|
117
|
+
logo_retention = parsed_json["logo_retention"]
|
118
|
+
quick_ratio = parsed_json["quick_ratio"]
|
119
|
+
new(
|
120
|
+
date: date,
|
121
|
+
active_users: active_users,
|
122
|
+
retained: retained,
|
123
|
+
new: new,
|
124
|
+
resurrected: resurrected,
|
125
|
+
churned: churned,
|
126
|
+
cmgr3: cmgr3,
|
127
|
+
cmgr6: cmgr6,
|
128
|
+
cmgr12: cmgr12,
|
129
|
+
cqgr1: cqgr1,
|
130
|
+
cqgr2: cqgr2,
|
131
|
+
cqgr4: cqgr4,
|
132
|
+
logo_retention: logo_retention,
|
133
|
+
quick_ratio: quick_ratio,
|
134
|
+
additional_properties: struct
|
135
|
+
)
|
136
|
+
end
|
137
|
+
|
138
|
+
# Serialize an instance of UserAccountingResponse to a JSON object
|
139
|
+
#
|
140
|
+
# @return [String]
|
141
|
+
def to_json(*_args)
|
142
|
+
@_field_set&.to_json
|
143
|
+
end
|
144
|
+
|
145
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
146
|
+
# hash and check each fields type against the current object's property
|
147
|
+
# definitions.
|
148
|
+
#
|
149
|
+
# @param obj [Object]
|
150
|
+
# @return [Void]
|
151
|
+
def self.validate_raw(obj:)
|
152
|
+
obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.")
|
153
|
+
obj.active_users.is_a?(Integer) != false || raise("Passed value for field obj.active_users is not the expected type, validation failed.")
|
154
|
+
obj.retained&.is_a?(Integer) != false || raise("Passed value for field obj.retained is not the expected type, validation failed.")
|
155
|
+
obj.new&.is_a?(Integer) != false || raise("Passed value for field obj.new is not the expected type, validation failed.")
|
156
|
+
obj.resurrected&.is_a?(Integer) != false || raise("Passed value for field obj.resurrected is not the expected type, validation failed.")
|
157
|
+
obj.churned&.is_a?(Integer) != false || raise("Passed value for field obj.churned is not the expected type, validation failed.")
|
158
|
+
obj.cmgr3&.is_a?(Float) != false || raise("Passed value for field obj.cmgr3 is not the expected type, validation failed.")
|
159
|
+
obj.cmgr6&.is_a?(Float) != false || raise("Passed value for field obj.cmgr6 is not the expected type, validation failed.")
|
160
|
+
obj.cmgr12&.is_a?(Float) != false || raise("Passed value for field obj.cmgr12 is not the expected type, validation failed.")
|
161
|
+
obj.cqgr1&.is_a?(Float) != false || raise("Passed value for field obj.cqgr1 is not the expected type, validation failed.")
|
162
|
+
obj.cqgr2&.is_a?(Float) != false || raise("Passed value for field obj.cqgr2 is not the expected type, validation failed.")
|
163
|
+
obj.cqgr4&.is_a?(Float) != false || raise("Passed value for field obj.cqgr4 is not the expected type, validation failed.")
|
164
|
+
obj.logo_retention&.is_a?(Float) != false || raise("Passed value for field obj.logo_retention is not the expected type, validation failed.")
|
165
|
+
obj.quick_ratio&.is_a?(Float) != false || raise("Passed value for field obj.quick_ratio is not the expected type, validation failed.")
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|