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.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/lib/core/file_utilities.rb +26 -0
  3. data/lib/environment.rb +7 -0
  4. data/lib/gemconfig.rb +14 -0
  5. data/lib/requests.rb +166 -0
  6. data/lib/test_sdk/benchmark/client.rb +1031 -0
  7. data/lib/test_sdk/company/client.rb +474 -0
  8. data/lib/test_sdk/deal/client.rb +584 -0
  9. data/lib/test_sdk/file/client.rb +692 -0
  10. data/lib/test_sdk/financials/client.rb +97 -0
  11. data/lib/test_sdk/group/client.rb +737 -0
  12. data/lib/test_sdk/macro/client.rb +422 -0
  13. data/lib/test_sdk/metadata/client.rb +95 -0
  14. data/lib/test_sdk/product/client.rb +419 -0
  15. data/lib/test_sdk/talent/client.rb +266 -0
  16. data/lib/test_sdk/types/account_manager_response.rb +74 -0
  17. data/lib/test_sdk/types/all_data_metadata_response.rb +68 -0
  18. data/lib/test_sdk/types/area.rb +74 -0
  19. data/lib/test_sdk/types/authenticate_api_key_response.rb +55 -0
  20. data/lib/test_sdk/types/available_categories_response.rb +5 -0
  21. data/lib/test_sdk/types/available_models_response.rb +69 -0
  22. data/lib/test_sdk/types/band_response.rb +83 -0
  23. data/lib/test_sdk/types/benchmark_quantile.rb +465 -0
  24. data/lib/test_sdk/types/categories_metadata_response.rb +72 -0
  25. data/lib/test_sdk/types/category_growth_rates.rb +143 -0
  26. data/lib/test_sdk/types/category_metadata.rb +79 -0
  27. data/lib/test_sdk/types/category_metadata_default_user_type.rb +8 -0
  28. data/lib/test_sdk/types/cohorts_response.rb +132 -0
  29. data/lib/test_sdk/types/column_metadata.rb +110 -0
  30. data/lib/test_sdk/types/column_mini_metadata.rb +83 -0
  31. data/lib/test_sdk/types/columns_metadata_response.rb +72 -0
  32. data/lib/test_sdk/types/company_response.rb +120 -0
  33. data/lib/test_sdk/types/concentration_endpoint_cdf_detail.rb +96 -0
  34. data/lib/test_sdk/types/concentration_endpoint_top_users_detail.rb +72 -0
  35. data/lib/test_sdk/types/concentration_response.rb +103 -0
  36. data/lib/test_sdk/types/concentration_timeseries_detail.rb +159 -0
  37. data/lib/test_sdk/types/contribution_response.rb +135 -0
  38. data/lib/test_sdk/types/create_api_key_response.rb +55 -0
  39. data/lib/test_sdk/types/create_file_for_signed_url_response.rb +127 -0
  40. data/lib/test_sdk/types/create_file_response.rb +113 -0
  41. data/lib/test_sdk/types/deal_combined_metrics_response.rb +477 -0
  42. data/lib/test_sdk/types/deal_data_availablity_response.rb +109 -0
  43. data/lib/test_sdk/types/deal_with_files_response.rb +194 -0
  44. data/lib/test_sdk/types/endpoint_seniority_count.rb +66 -0
  45. data/lib/test_sdk/types/executive_profile.rb +91 -0
  46. data/lib/test_sdk/types/executive_profile_position.rb +97 -0
  47. data/lib/test_sdk/types/file_response.rb +113 -0
  48. data/lib/test_sdk/types/file_type.rb +14 -0
  49. data/lib/test_sdk/types/financial_metrics.rb +113 -0
  50. data/lib/test_sdk/types/financials_response.rb +102 -0
  51. data/lib/test_sdk/types/frequency.rb +9 -0
  52. data/lib/test_sdk/types/function_level_growth_accounting.rb +111 -0
  53. data/lib/test_sdk/types/gcs_signed_url_response.rb +81 -0
  54. data/lib/test_sdk/types/group_response.rb +158 -0
  55. data/lib/test_sdk/types/group_user.rb +124 -0
  56. data/lib/test_sdk/types/group_with_users_response.rb +170 -0
  57. data/lib/test_sdk/types/growth_accounting_response.rb +226 -0
  58. data/lib/test_sdk/types/healthz_response.rb +55 -0
  59. data/lib/test_sdk/types/http_validation_error.rb +61 -0
  60. data/lib/test_sdk/types/income_statement_entry.rb +81 -0
  61. data/lib/test_sdk/types/model_metadata.rb +76 -0
  62. data/lib/test_sdk/types/models_metadata_response.rb +76 -0
  63. data/lib/test_sdk/types/paginated_response_company_response.rb +83 -0
  64. data/lib/test_sdk/types/paginated_response_deal_with_files_response.rb +84 -0
  65. data/lib/test_sdk/types/paginated_response_file_response.rb +83 -0
  66. data/lib/test_sdk/types/paginated_response_group_user.rb +83 -0
  67. data/lib/test_sdk/types/permission_model.rb +65 -0
  68. data/lib/test_sdk/types/priority.rb +10 -0
  69. data/lib/test_sdk/types/product_info_response.rb +65 -0
  70. data/lib/test_sdk/types/role_response.rb +95 -0
  71. data/lib/test_sdk/types/scale.rb +72 -0
  72. data/lib/test_sdk/types/scale_model.rb +80 -0
  73. data/lib/test_sdk/types/scale_models_response.rb +5 -0
  74. data/lib/test_sdk/types/scaling.rb +10 -0
  75. data/lib/test_sdk/types/status.rb +12 -0
  76. data/lib/test_sdk/types/tradeoff_model.rb +95 -0
  77. data/lib/test_sdk/types/tradeoff_models_response.rb +5 -0
  78. data/lib/test_sdk/types/unit.rb +12 -0
  79. data/lib/test_sdk/types/unit_economics_info_response.rb +55 -0
  80. data/lib/test_sdk/types/user_accounting_response.rb +168 -0
  81. data/lib/test_sdk/types/user_role_response.rb +77 -0
  82. data/lib/test_sdk/types/user_type.rb +12 -0
  83. data/lib/test_sdk/types/user_with_groups_response.rb +140 -0
  84. data/lib/test_sdk/types/user_with_permissions_response.rb +153 -0
  85. data/lib/test_sdk/types/validation_error.rb +76 -0
  86. data/lib/test_sdk/types/validation_error_loc_item.rb +52 -0
  87. data/lib/test_sdk/types/weather_components.rb +123 -0
  88. data/lib/test_sdk/types/weather_gauge.rb +76 -0
  89. data/lib/test_sdk/types/weather_market_context.rb +109 -0
  90. data/lib/test_sdk/types/weather_metadata.rb +113 -0
  91. data/lib/test_sdk/unit_economics/client.rb +124 -0
  92. data/lib/test_sdk/user/client.rb +363 -0
  93. data/lib/test_sdk.rb +190 -0
  94. data/lib/types_export.rb +77 -0
  95. metadata +251 -0
@@ -0,0 +1,143 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module NewDemoApiClient
7
+ class CategoryGrowthRates
8
+ # @return [String] The date of the entry.
9
+ attr_reader :date
10
+ # @return [String] The category of the entry.
11
+ attr_reader :category
12
+ # @return [Float] 3-month category growth rate, for monthly frequency.
13
+ attr_reader :cmgr3
14
+ # @return [Float] 6-month category growth rate, for monthly frequency.
15
+ attr_reader :cmgr6
16
+ # @return [Float] 12-month category growth rate, for monthly frequency.
17
+ attr_reader :cmgr12
18
+ # @return [Float] 1-quarter category growth rate, for quarterly frequency.
19
+ attr_reader :cqgr1
20
+ # @return [Float] 2-quarter category growth rate, for quarterly frequency.
21
+ attr_reader :cqgr2
22
+ # @return [Float] 4-quarter category growth rate, for quarterly frequency.
23
+ attr_reader :cqgr4
24
+ # @return [Float] 1-year category growth rate, for annual frequency.
25
+ attr_reader :cagr1
26
+ # @return [Float] 2-year category growth rate, for annual frequency.
27
+ attr_reader :cagr2
28
+ # @return [Float] 4-year category growth rate, for annual frequency.
29
+ attr_reader :cagr4
30
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
31
+ attr_reader :additional_properties
32
+ # @return [Object]
33
+ attr_reader :_field_set
34
+ protected :_field_set
35
+
36
+ OMIT = Object.new
37
+
38
+ # @param date [String] The date of the entry.
39
+ # @param category [String] The category of the entry.
40
+ # @param cmgr3 [Float] 3-month category growth rate, for monthly frequency.
41
+ # @param cmgr6 [Float] 6-month category growth rate, for monthly frequency.
42
+ # @param cmgr12 [Float] 12-month category growth rate, for monthly frequency.
43
+ # @param cqgr1 [Float] 1-quarter category growth rate, for quarterly frequency.
44
+ # @param cqgr2 [Float] 2-quarter category growth rate, for quarterly frequency.
45
+ # @param cqgr4 [Float] 4-quarter category growth rate, for quarterly frequency.
46
+ # @param cagr1 [Float] 1-year category growth rate, for annual frequency.
47
+ # @param cagr2 [Float] 2-year category growth rate, for annual frequency.
48
+ # @param cagr4 [Float] 4-year category growth rate, for annual frequency.
49
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
50
+ # @return [NewDemoApiClient::CategoryGrowthRates]
51
+ def initialize(date:, category:, cmgr3: OMIT, cmgr6: OMIT, cmgr12: OMIT, cqgr1: OMIT, cqgr2: OMIT, cqgr4: OMIT,
52
+ cagr1: OMIT, cagr2: OMIT, cagr4: OMIT, additional_properties: nil)
53
+ @date = date
54
+ @category = category
55
+ @cmgr3 = cmgr3 if cmgr3 != OMIT
56
+ @cmgr6 = cmgr6 if cmgr6 != OMIT
57
+ @cmgr12 = cmgr12 if cmgr12 != OMIT
58
+ @cqgr1 = cqgr1 if cqgr1 != OMIT
59
+ @cqgr2 = cqgr2 if cqgr2 != OMIT
60
+ @cqgr4 = cqgr4 if cqgr4 != OMIT
61
+ @cagr1 = cagr1 if cagr1 != OMIT
62
+ @cagr2 = cagr2 if cagr2 != OMIT
63
+ @cagr4 = cagr4 if cagr4 != OMIT
64
+ @additional_properties = additional_properties
65
+ @_field_set = {
66
+ "date": date,
67
+ "category": category,
68
+ "cmgr3": cmgr3,
69
+ "cmgr6": cmgr6,
70
+ "cmgr12": cmgr12,
71
+ "cqgr1": cqgr1,
72
+ "cqgr2": cqgr2,
73
+ "cqgr4": cqgr4,
74
+ "cagr1": cagr1,
75
+ "cagr2": cagr2,
76
+ "cagr4": cagr4
77
+ }.reject do |_k, v|
78
+ v == OMIT
79
+ end
80
+ end
81
+
82
+ # Deserialize a JSON object to an instance of CategoryGrowthRates
83
+ #
84
+ # @param json_object [String]
85
+ # @return [NewDemoApiClient::CategoryGrowthRates]
86
+ def self.from_json(json_object:)
87
+ struct = JSON.parse(json_object, object_class: OpenStruct)
88
+ parsed_json = JSON.parse(json_object)
89
+ date = parsed_json["date"]
90
+ category = parsed_json["category"]
91
+ cmgr3 = parsed_json["cmgr3"]
92
+ cmgr6 = parsed_json["cmgr6"]
93
+ cmgr12 = parsed_json["cmgr12"]
94
+ cqgr1 = parsed_json["cqgr1"]
95
+ cqgr2 = parsed_json["cqgr2"]
96
+ cqgr4 = parsed_json["cqgr4"]
97
+ cagr1 = parsed_json["cagr1"]
98
+ cagr2 = parsed_json["cagr2"]
99
+ cagr4 = parsed_json["cagr4"]
100
+ new(
101
+ date: date,
102
+ category: category,
103
+ cmgr3: cmgr3,
104
+ cmgr6: cmgr6,
105
+ cmgr12: cmgr12,
106
+ cqgr1: cqgr1,
107
+ cqgr2: cqgr2,
108
+ cqgr4: cqgr4,
109
+ cagr1: cagr1,
110
+ cagr2: cagr2,
111
+ cagr4: cagr4,
112
+ additional_properties: struct
113
+ )
114
+ end
115
+
116
+ # Serialize an instance of CategoryGrowthRates to a JSON object
117
+ #
118
+ # @return [String]
119
+ def to_json(*_args)
120
+ @_field_set&.to_json
121
+ end
122
+
123
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
124
+ # hash and check each fields type against the current object's property
125
+ # definitions.
126
+ #
127
+ # @param obj [Object]
128
+ # @return [Void]
129
+ def self.validate_raw(obj:)
130
+ obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.")
131
+ obj.category.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
132
+ obj.cmgr3&.is_a?(Float) != false || raise("Passed value for field obj.cmgr3 is not the expected type, validation failed.")
133
+ obj.cmgr6&.is_a?(Float) != false || raise("Passed value for field obj.cmgr6 is not the expected type, validation failed.")
134
+ obj.cmgr12&.is_a?(Float) != false || raise("Passed value for field obj.cmgr12 is not the expected type, validation failed.")
135
+ obj.cqgr1&.is_a?(Float) != false || raise("Passed value for field obj.cqgr1 is not the expected type, validation failed.")
136
+ obj.cqgr2&.is_a?(Float) != false || raise("Passed value for field obj.cqgr2 is not the expected type, validation failed.")
137
+ obj.cqgr4&.is_a?(Float) != false || raise("Passed value for field obj.cqgr4 is not the expected type, validation failed.")
138
+ obj.cagr1&.is_a?(Float) != false || raise("Passed value for field obj.cagr1 is not the expected type, validation failed.")
139
+ obj.cagr2&.is_a?(Float) != false || raise("Passed value for field obj.cagr2 is not the expected type, validation failed.")
140
+ obj.cagr4&.is_a?(Float) != false || raise("Passed value for field obj.cagr4 is not the expected type, validation failed.")
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "category_metadata_default_user_type"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module NewDemoApiClient
8
+ class CategoryMetadata
9
+ # @return [String] The name of the category.
10
+ attr_reader :name
11
+ # @return [String] The friendly displayable name of the category.
12
+ attr_reader :friendly_name
13
+ # @return [NewDemoApiClient::CategoryMetadataDefaultUserType] The default user type for the category.
14
+ attr_reader :default_user_type
15
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
16
+ attr_reader :additional_properties
17
+ # @return [Object]
18
+ attr_reader :_field_set
19
+ protected :_field_set
20
+
21
+ OMIT = Object.new
22
+
23
+ # @param name [String] The name of the category.
24
+ # @param friendly_name [String] The friendly displayable name of the category.
25
+ # @param default_user_type [NewDemoApiClient::CategoryMetadataDefaultUserType] The default user type for the category.
26
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
27
+ # @return [NewDemoApiClient::CategoryMetadata]
28
+ def initialize(name:, friendly_name:, default_user_type: OMIT, additional_properties: nil)
29
+ @name = name
30
+ @friendly_name = friendly_name
31
+ @default_user_type = default_user_type if default_user_type != OMIT
32
+ @additional_properties = additional_properties
33
+ @_field_set = {
34
+ "name": name,
35
+ "friendly_name": friendly_name,
36
+ "default_user_type": default_user_type
37
+ }.reject do |_k, v|
38
+ v == OMIT
39
+ end
40
+ end
41
+
42
+ # Deserialize a JSON object to an instance of CategoryMetadata
43
+ #
44
+ # @param json_object [String]
45
+ # @return [NewDemoApiClient::CategoryMetadata]
46
+ def self.from_json(json_object:)
47
+ struct = JSON.parse(json_object, object_class: OpenStruct)
48
+ parsed_json = JSON.parse(json_object)
49
+ name = parsed_json["name"]
50
+ friendly_name = parsed_json["friendly_name"]
51
+ default_user_type = parsed_json["default_user_type"]
52
+ new(
53
+ name: name,
54
+ friendly_name: friendly_name,
55
+ default_user_type: default_user_type,
56
+ additional_properties: struct
57
+ )
58
+ end
59
+
60
+ # Serialize an instance of CategoryMetadata to a JSON object
61
+ #
62
+ # @return [String]
63
+ def to_json(*_args)
64
+ @_field_set&.to_json
65
+ end
66
+
67
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
68
+ # hash and check each fields type against the current object's property
69
+ # definitions.
70
+ #
71
+ # @param obj [Object]
72
+ # @return [Void]
73
+ def self.validate_raw(obj:)
74
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
75
+ obj.friendly_name.is_a?(String) != false || raise("Passed value for field obj.friendly_name is not the expected type, validation failed.")
76
+ obj.default_user_type&.is_a?(NewDemoApiClient::CategoryMetadataDefaultUserType) != false || raise("Passed value for field obj.default_user_type is not the expected type, validation failed.")
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NewDemoApiClient
4
+ class CategoryMetadataDefaultUserType
5
+ BUSINESS = "business"
6
+ CONSUMER = "consumer"
7
+ end
8
+ end
@@ -0,0 +1,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module NewDemoApiClient
7
+ # The basic cohort metrics for the user count and amount.
8
+ # The "amount" is a generic term for the metric being measured, such as revenue or
9
+ # gtv.
10
+ class CohortsResponse
11
+ # @return [String] The date of the cohort.
12
+ attr_reader :cohort
13
+ # @return [Integer] The period of the cohort. 0 is the first period.
14
+ attr_reader :period
15
+ # @return [Integer] The number of users in the cohort.
16
+ attr_reader :cohort_size
17
+ # @return [Float] The size denominated in the metric amount of the cohort.
18
+ attr_reader :cohort_size_amount
19
+ # @return [Integer] The number of active users in the period.
20
+ attr_reader :active_users
21
+ # @return [Float] The logo retention rate, defined as active / cohort size.
22
+ attr_reader :logo_retention
23
+ # @return [Float] The active amount, such as revenue or gtv, in the period for the cohort.
24
+ attr_reader :amount
25
+ # @return [Float] The amount retention rate, defined as amount / cohort size amount.
26
+ attr_reader :amount_retention
27
+ # @return [Float] The cumulative lifetime value in terms of the metric amount up until the period,
28
+ # on average per user in the cohort.
29
+ attr_reader :ltv
30
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
31
+ attr_reader :additional_properties
32
+ # @return [Object]
33
+ attr_reader :_field_set
34
+ protected :_field_set
35
+
36
+ OMIT = Object.new
37
+
38
+ # @param cohort [String] The date of the cohort.
39
+ # @param period [Integer] The period of the cohort. 0 is the first period.
40
+ # @param cohort_size [Integer] The number of users in the cohort.
41
+ # @param cohort_size_amount [Float] The size denominated in the metric amount of the cohort.
42
+ # @param active_users [Integer] The number of active users in the period.
43
+ # @param logo_retention [Float] The logo retention rate, defined as active / cohort size.
44
+ # @param amount [Float] The active amount, such as revenue or gtv, in the period for the cohort.
45
+ # @param amount_retention [Float] The amount retention rate, defined as amount / cohort size amount.
46
+ # @param ltv [Float] The cumulative lifetime value in terms of the metric amount up until the period,
47
+ # on average per user in the cohort.
48
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
49
+ # @return [NewDemoApiClient::CohortsResponse]
50
+ def initialize(cohort:, period:, cohort_size:, cohort_size_amount:, active_users:, logo_retention: OMIT,
51
+ amount: OMIT, amount_retention: OMIT, ltv: OMIT, additional_properties: nil)
52
+ @cohort = cohort
53
+ @period = period
54
+ @cohort_size = cohort_size
55
+ @cohort_size_amount = cohort_size_amount
56
+ @active_users = active_users
57
+ @logo_retention = logo_retention if logo_retention != OMIT
58
+ @amount = amount if amount != OMIT
59
+ @amount_retention = amount_retention if amount_retention != OMIT
60
+ @ltv = ltv if ltv != OMIT
61
+ @additional_properties = additional_properties
62
+ @_field_set = {
63
+ "cohort": cohort,
64
+ "period": period,
65
+ "cohort_size": cohort_size,
66
+ "cohort_size_amount": cohort_size_amount,
67
+ "active_users": active_users,
68
+ "logo_retention": logo_retention,
69
+ "amount": amount,
70
+ "amount_retention": amount_retention,
71
+ "ltv": ltv
72
+ }.reject do |_k, v|
73
+ v == OMIT
74
+ end
75
+ end
76
+
77
+ # Deserialize a JSON object to an instance of CohortsResponse
78
+ #
79
+ # @param json_object [String]
80
+ # @return [NewDemoApiClient::CohortsResponse]
81
+ def self.from_json(json_object:)
82
+ struct = JSON.parse(json_object, object_class: OpenStruct)
83
+ parsed_json = JSON.parse(json_object)
84
+ cohort = parsed_json["cohort"]
85
+ period = parsed_json["period"]
86
+ cohort_size = parsed_json["cohort_size"]
87
+ cohort_size_amount = parsed_json["cohort_size_amount"]
88
+ active_users = parsed_json["active_users"]
89
+ logo_retention = parsed_json["logo_retention"]
90
+ amount = parsed_json["amount"]
91
+ amount_retention = parsed_json["amount_retention"]
92
+ ltv = parsed_json["ltv"]
93
+ new(
94
+ cohort: cohort,
95
+ period: period,
96
+ cohort_size: cohort_size,
97
+ cohort_size_amount: cohort_size_amount,
98
+ active_users: active_users,
99
+ logo_retention: logo_retention,
100
+ amount: amount,
101
+ amount_retention: amount_retention,
102
+ ltv: ltv,
103
+ additional_properties: struct
104
+ )
105
+ end
106
+
107
+ # Serialize an instance of CohortsResponse to a JSON object
108
+ #
109
+ # @return [String]
110
+ def to_json(*_args)
111
+ @_field_set&.to_json
112
+ end
113
+
114
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
115
+ # hash and check each fields type against the current object's property
116
+ # definitions.
117
+ #
118
+ # @param obj [Object]
119
+ # @return [Void]
120
+ def self.validate_raw(obj:)
121
+ obj.cohort.is_a?(String) != false || raise("Passed value for field obj.cohort is not the expected type, validation failed.")
122
+ obj.period.is_a?(Integer) != false || raise("Passed value for field obj.period is not the expected type, validation failed.")
123
+ obj.cohort_size.is_a?(Integer) != false || raise("Passed value for field obj.cohort_size is not the expected type, validation failed.")
124
+ obj.cohort_size_amount.is_a?(Float) != false || raise("Passed value for field obj.cohort_size_amount is not the expected type, validation failed.")
125
+ obj.active_users.is_a?(Integer) != false || raise("Passed value for field obj.active_users is not the expected type, validation failed.")
126
+ obj.logo_retention&.is_a?(Float) != false || raise("Passed value for field obj.logo_retention is not the expected type, validation failed.")
127
+ obj.amount&.is_a?(Float) != false || raise("Passed value for field obj.amount is not the expected type, validation failed.")
128
+ obj.amount_retention&.is_a?(Float) != false || raise("Passed value for field obj.amount_retention is not the expected type, validation failed.")
129
+ obj.ltv&.is_a?(Float) != false || raise("Passed value for field obj.ltv is not the expected type, validation failed.")
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "unit"
4
+ require_relative "scaling"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module NewDemoApiClient
9
+ class ColumnMetadata
10
+ # @return [String] The name of the column.
11
+ attr_reader :name
12
+ # @return [String] The friendly displayable name of the column.
13
+ attr_reader :friendly_name
14
+ # @return [NewDemoApiClient::Unit] The unit of the category.
15
+ attr_reader :unit
16
+ # @return [NewDemoApiClient::Scaling] The scaling type of the column. Geometric indicates exponential changes are
17
+ # expected, while arithmetic indicates linear changes.
18
+ attr_reader :scaling
19
+ # @return [Boolean] Whether the column is expected to be higher or lower for better performance.
20
+ # False means higher is better, True means lower is better.
21
+ attr_reader :reverse
22
+ # @return [Float] The **suggested** cutoff value for the column. This is a guideline for when the
23
+ # absolute value of the column is considered saturated.
24
+ attr_reader :cutoff
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 name [String] The name of the column.
34
+ # @param friendly_name [String] The friendly displayable name of the column.
35
+ # @param unit [NewDemoApiClient::Unit] The unit of the category.
36
+ # @param scaling [NewDemoApiClient::Scaling] The scaling type of the column. Geometric indicates exponential changes are
37
+ # expected, while arithmetic indicates linear changes.
38
+ # @param reverse [Boolean] Whether the column is expected to be higher or lower for better performance.
39
+ # False means higher is better, True means lower is better.
40
+ # @param cutoff [Float] The **suggested** cutoff value for the column. This is a guideline for when the
41
+ # absolute value of the column is considered saturated.
42
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
43
+ # @return [NewDemoApiClient::ColumnMetadata]
44
+ def initialize(name:, friendly_name:, unit:, scaling:, reverse:, cutoff: OMIT, additional_properties: nil)
45
+ @name = name
46
+ @friendly_name = friendly_name
47
+ @unit = unit
48
+ @scaling = scaling
49
+ @reverse = reverse
50
+ @cutoff = cutoff if cutoff != OMIT
51
+ @additional_properties = additional_properties
52
+ @_field_set = {
53
+ "name": name,
54
+ "friendly_name": friendly_name,
55
+ "unit": unit,
56
+ "scaling": scaling,
57
+ "reverse": reverse,
58
+ "cutoff": cutoff
59
+ }.reject do |_k, v|
60
+ v == OMIT
61
+ end
62
+ end
63
+
64
+ # Deserialize a JSON object to an instance of ColumnMetadata
65
+ #
66
+ # @param json_object [String]
67
+ # @return [NewDemoApiClient::ColumnMetadata]
68
+ def self.from_json(json_object:)
69
+ struct = JSON.parse(json_object, object_class: OpenStruct)
70
+ parsed_json = JSON.parse(json_object)
71
+ name = parsed_json["name"]
72
+ friendly_name = parsed_json["friendly_name"]
73
+ unit = parsed_json["unit"]
74
+ scaling = parsed_json["scaling"]
75
+ reverse = parsed_json["reverse"]
76
+ cutoff = parsed_json["cutoff"]
77
+ new(
78
+ name: name,
79
+ friendly_name: friendly_name,
80
+ unit: unit,
81
+ scaling: scaling,
82
+ reverse: reverse,
83
+ cutoff: cutoff,
84
+ additional_properties: struct
85
+ )
86
+ end
87
+
88
+ # Serialize an instance of ColumnMetadata 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.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
103
+ obj.friendly_name.is_a?(String) != false || raise("Passed value for field obj.friendly_name is not the expected type, validation failed.")
104
+ obj.unit.is_a?(NewDemoApiClient::Unit) != false || raise("Passed value for field obj.unit is not the expected type, validation failed.")
105
+ obj.scaling.is_a?(NewDemoApiClient::Scaling) != false || raise("Passed value for field obj.scaling is not the expected type, validation failed.")
106
+ obj.reverse.is_a?(Boolean) != false || raise("Passed value for field obj.reverse is not the expected type, validation failed.")
107
+ obj.cutoff&.is_a?(Float) != false || raise("Passed value for field obj.cutoff is not the expected type, validation failed.")
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "unit"
4
+ require_relative "scaling"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module NewDemoApiClient
9
+ class ColumnMiniMetadata
10
+ # @return [String] The name of the column.
11
+ attr_reader :name
12
+ # @return [String] The friendly displayable name of the column.
13
+ attr_reader :friendly_name
14
+ # @return [NewDemoApiClient::Unit] The unit of the category.
15
+ attr_reader :unit
16
+ # @return [NewDemoApiClient::Scaling] The scaling type of the column. Geometric indicates exponential changes are
17
+ # expected, while arithmetic indicates linear changes.
18
+ attr_reader :scaling
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 name [String] The name of the column.
28
+ # @param friendly_name [String] The friendly displayable name of the column.
29
+ # @param unit [NewDemoApiClient::Unit] The unit of the category.
30
+ # @param scaling [NewDemoApiClient::Scaling] The scaling type of the column. Geometric indicates exponential changes are
31
+ # expected, while arithmetic indicates linear changes.
32
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
33
+ # @return [NewDemoApiClient::ColumnMiniMetadata]
34
+ def initialize(name:, friendly_name:, unit:, scaling:, additional_properties: nil)
35
+ @name = name
36
+ @friendly_name = friendly_name
37
+ @unit = unit
38
+ @scaling = scaling
39
+ @additional_properties = additional_properties
40
+ @_field_set = { "name": name, "friendly_name": friendly_name, "unit": unit, "scaling": scaling }
41
+ end
42
+
43
+ # Deserialize a JSON object to an instance of ColumnMiniMetadata
44
+ #
45
+ # @param json_object [String]
46
+ # @return [NewDemoApiClient::ColumnMiniMetadata]
47
+ def self.from_json(json_object:)
48
+ struct = JSON.parse(json_object, object_class: OpenStruct)
49
+ parsed_json = JSON.parse(json_object)
50
+ name = parsed_json["name"]
51
+ friendly_name = parsed_json["friendly_name"]
52
+ unit = parsed_json["unit"]
53
+ scaling = parsed_json["scaling"]
54
+ new(
55
+ name: name,
56
+ friendly_name: friendly_name,
57
+ unit: unit,
58
+ scaling: scaling,
59
+ additional_properties: struct
60
+ )
61
+ end
62
+
63
+ # Serialize an instance of ColumnMiniMetadata to a JSON object
64
+ #
65
+ # @return [String]
66
+ def to_json(*_args)
67
+ @_field_set&.to_json
68
+ end
69
+
70
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
71
+ # hash and check each fields type against the current object's property
72
+ # definitions.
73
+ #
74
+ # @param obj [Object]
75
+ # @return [Void]
76
+ def self.validate_raw(obj:)
77
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
78
+ obj.friendly_name.is_a?(String) != false || raise("Passed value for field obj.friendly_name is not the expected type, validation failed.")
79
+ obj.unit.is_a?(NewDemoApiClient::Unit) != false || raise("Passed value for field obj.unit is not the expected type, validation failed.")
80
+ obj.scaling.is_a?(NewDemoApiClient::Scaling) != false || raise("Passed value for field obj.scaling is not the expected type, validation failed.")
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "column_metadata"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module NewDemoApiClient
8
+ class ColumnsMetadataResponse
9
+ # @return [Array<NewDemoApiClient::ColumnMetadata>] A list of column metadata.
10
+ attr_reader :columns
11
+ # @return [Hash{String => NewDemoApiClient::ColumnMetadata}] A mapping column names to their metadata for lookup convenience.
12
+ attr_reader :name_map
13
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
14
+ attr_reader :additional_properties
15
+ # @return [Object]
16
+ attr_reader :_field_set
17
+ protected :_field_set
18
+
19
+ OMIT = Object.new
20
+
21
+ # @param columns [Array<NewDemoApiClient::ColumnMetadata>] A list of column metadata.
22
+ # @param name_map [Hash{String => NewDemoApiClient::ColumnMetadata}] A mapping column names to their metadata for lookup convenience.
23
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
24
+ # @return [NewDemoApiClient::ColumnsMetadataResponse]
25
+ def initialize(columns:, name_map:, additional_properties: nil)
26
+ @columns = columns
27
+ @name_map = name_map
28
+ @additional_properties = additional_properties
29
+ @_field_set = { "columns": columns, "name_map": name_map }
30
+ end
31
+
32
+ # Deserialize a JSON object to an instance of ColumnsMetadataResponse
33
+ #
34
+ # @param json_object [String]
35
+ # @return [NewDemoApiClient::ColumnsMetadataResponse]
36
+ def self.from_json(json_object:)
37
+ struct = JSON.parse(json_object, object_class: OpenStruct)
38
+ parsed_json = JSON.parse(json_object)
39
+ columns = parsed_json["columns"]&.map do |item|
40
+ item = item.to_json
41
+ NewDemoApiClient::ColumnMetadata.from_json(json_object: item)
42
+ end
43
+ name_map = parsed_json["name_map"]&.transform_values do |value|
44
+ value = value.to_json
45
+ NewDemoApiClient::ColumnMetadata.from_json(json_object: value)
46
+ end
47
+ new(
48
+ columns: columns,
49
+ name_map: name_map,
50
+ additional_properties: struct
51
+ )
52
+ end
53
+
54
+ # Serialize an instance of ColumnsMetadataResponse to a JSON object
55
+ #
56
+ # @return [String]
57
+ def to_json(*_args)
58
+ @_field_set&.to_json
59
+ end
60
+
61
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
62
+ # hash and check each fields type against the current object's property
63
+ # definitions.
64
+ #
65
+ # @param obj [Object]
66
+ # @return [Void]
67
+ def self.validate_raw(obj:)
68
+ obj.columns.is_a?(Array) != false || raise("Passed value for field obj.columns is not the expected type, validation failed.")
69
+ obj.name_map.is_a?(Hash) != false || raise("Passed value for field obj.name_map is not the expected type, validation failed.")
70
+ end
71
+ end
72
+ end