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,124 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require_relative "role_response"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module NewDemoApiClient
9
+ class GroupUser
10
+ # @return [String]
11
+ attr_reader :name
12
+ # @return [String] The email address of the user
13
+ attr_reader :email
14
+ # @return [String] The thumbnail URL of the user
15
+ attr_reader :thumbnail
16
+ # @return [Integer]
17
+ attr_reader :id
18
+ # @return [DateTime]
19
+ attr_reader :created_at
20
+ # @return [DateTime]
21
+ attr_reader :updated_at
22
+ # @return [Boolean]
23
+ attr_reader :is_archived
24
+ # @return [Array<NewDemoApiClient::RoleResponse>]
25
+ attr_reader :roles
26
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
27
+ attr_reader :additional_properties
28
+ # @return [Object]
29
+ attr_reader :_field_set
30
+ protected :_field_set
31
+
32
+ OMIT = Object.new
33
+
34
+ # @param name [String]
35
+ # @param email [String] The email address of the user
36
+ # @param thumbnail [String] The thumbnail URL of the user
37
+ # @param id [Integer]
38
+ # @param created_at [DateTime]
39
+ # @param updated_at [DateTime]
40
+ # @param is_archived [Boolean]
41
+ # @param roles [Array<NewDemoApiClient::RoleResponse>]
42
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
43
+ # @return [NewDemoApiClient::GroupUser]
44
+ def initialize(name:, email:, id:, roles:, thumbnail: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT,
45
+ additional_properties: nil)
46
+ @name = name
47
+ @email = email
48
+ @thumbnail = thumbnail if thumbnail != OMIT
49
+ @id = id
50
+ @created_at = created_at if created_at != OMIT
51
+ @updated_at = updated_at if updated_at != OMIT
52
+ @is_archived = is_archived if is_archived != OMIT
53
+ @roles = roles
54
+ @additional_properties = additional_properties
55
+ @_field_set = {
56
+ "name": name,
57
+ "email": email,
58
+ "thumbnail": thumbnail,
59
+ "id": id,
60
+ "created_at": created_at,
61
+ "updated_at": updated_at,
62
+ "is_archived": is_archived,
63
+ "roles": roles
64
+ }.reject do |_k, v|
65
+ v == OMIT
66
+ end
67
+ end
68
+
69
+ # Deserialize a JSON object to an instance of GroupUser
70
+ #
71
+ # @param json_object [String]
72
+ # @return [NewDemoApiClient::GroupUser]
73
+ def self.from_json(json_object:)
74
+ struct = JSON.parse(json_object, object_class: OpenStruct)
75
+ parsed_json = JSON.parse(json_object)
76
+ name = parsed_json["name"]
77
+ email = parsed_json["email"]
78
+ thumbnail = parsed_json["thumbnail"]
79
+ id = parsed_json["id"]
80
+ created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
81
+ updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
82
+ is_archived = parsed_json["is_archived"]
83
+ roles = parsed_json["roles"]&.map do |item|
84
+ item = item.to_json
85
+ NewDemoApiClient::RoleResponse.from_json(json_object: item)
86
+ end
87
+ new(
88
+ name: name,
89
+ email: email,
90
+ thumbnail: thumbnail,
91
+ id: id,
92
+ created_at: created_at,
93
+ updated_at: updated_at,
94
+ is_archived: is_archived,
95
+ roles: roles,
96
+ additional_properties: struct
97
+ )
98
+ end
99
+
100
+ # Serialize an instance of GroupUser to a JSON object
101
+ #
102
+ # @return [String]
103
+ def to_json(*_args)
104
+ @_field_set&.to_json
105
+ end
106
+
107
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
108
+ # hash and check each fields type against the current object's property
109
+ # definitions.
110
+ #
111
+ # @param obj [Object]
112
+ # @return [Void]
113
+ def self.validate_raw(obj:)
114
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
115
+ obj.email.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
116
+ obj.thumbnail&.is_a?(String) != false || raise("Passed value for field obj.thumbnail is not the expected type, validation failed.")
117
+ obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
118
+ obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
119
+ obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
120
+ obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
121
+ obj.roles.is_a?(Array) != false || raise("Passed value for field obj.roles is not the expected type, validation failed.")
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,170 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require_relative "account_manager_response"
5
+ require_relative "group_user"
6
+ require "ostruct"
7
+ require "json"
8
+
9
+ module NewDemoApiClient
10
+ class GroupWithUsersResponse
11
+ # @return [String]
12
+ attr_reader :name
13
+ # @return [String] The domain of the group
14
+ attr_reader :domain
15
+ # @return [String] The thumbnail URL of the group
16
+ attr_reader :thumbnail_url
17
+ # @return [String] The email address for analysis to be sent to
18
+ attr_reader :analysis_email
19
+ # @return [Boolean] Whether the group has access to the data API
20
+ attr_reader :data_api_access
21
+ # @return [Integer]
22
+ attr_reader :id
23
+ # @return [DateTime]
24
+ attr_reader :created_at
25
+ # @return [DateTime]
26
+ attr_reader :updated_at
27
+ # @return [Boolean]
28
+ attr_reader :is_archived
29
+ # @return [NewDemoApiClient::AccountManagerResponse]
30
+ attr_reader :account_manager
31
+ # @return [Integer]
32
+ attr_reader :user_count
33
+ # @return [Integer]
34
+ attr_reader :deal_count
35
+ # @return [Array<NewDemoApiClient::GroupUser>]
36
+ attr_reader :users
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 name [String]
46
+ # @param domain [String] The domain of the group
47
+ # @param thumbnail_url [String] The thumbnail URL of the group
48
+ # @param analysis_email [String] The email address for analysis to be sent to
49
+ # @param data_api_access [Boolean] Whether the group has access to the data API
50
+ # @param id [Integer]
51
+ # @param created_at [DateTime]
52
+ # @param updated_at [DateTime]
53
+ # @param is_archived [Boolean]
54
+ # @param account_manager [NewDemoApiClient::AccountManagerResponse]
55
+ # @param user_count [Integer]
56
+ # @param deal_count [Integer]
57
+ # @param users [Array<NewDemoApiClient::GroupUser>]
58
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
59
+ # @return [NewDemoApiClient::GroupWithUsersResponse]
60
+ def initialize(name:, domain:, id:, thumbnail_url: OMIT, analysis_email: OMIT, data_api_access: OMIT,
61
+ created_at: OMIT, updated_at: OMIT, is_archived: OMIT, account_manager: OMIT, user_count: OMIT, deal_count: OMIT, users: OMIT, additional_properties: nil)
62
+ @name = name
63
+ @domain = domain
64
+ @thumbnail_url = thumbnail_url if thumbnail_url != OMIT
65
+ @analysis_email = analysis_email if analysis_email != OMIT
66
+ @data_api_access = data_api_access if data_api_access != OMIT
67
+ @id = id
68
+ @created_at = created_at if created_at != OMIT
69
+ @updated_at = updated_at if updated_at != OMIT
70
+ @is_archived = is_archived if is_archived != OMIT
71
+ @account_manager = account_manager if account_manager != OMIT
72
+ @user_count = user_count if user_count != OMIT
73
+ @deal_count = deal_count if deal_count != OMIT
74
+ @users = users if users != OMIT
75
+ @additional_properties = additional_properties
76
+ @_field_set = {
77
+ "name": name,
78
+ "domain": domain,
79
+ "thumbnail_url": thumbnail_url,
80
+ "analysis_email": analysis_email,
81
+ "data_api_access": data_api_access,
82
+ "id": id,
83
+ "created_at": created_at,
84
+ "updated_at": updated_at,
85
+ "is_archived": is_archived,
86
+ "account_manager": account_manager,
87
+ "user_count": user_count,
88
+ "deal_count": deal_count,
89
+ "users": users
90
+ }.reject do |_k, v|
91
+ v == OMIT
92
+ end
93
+ end
94
+
95
+ # Deserialize a JSON object to an instance of GroupWithUsersResponse
96
+ #
97
+ # @param json_object [String]
98
+ # @return [NewDemoApiClient::GroupWithUsersResponse]
99
+ def self.from_json(json_object:)
100
+ struct = JSON.parse(json_object, object_class: OpenStruct)
101
+ parsed_json = JSON.parse(json_object)
102
+ name = parsed_json["name"]
103
+ domain = parsed_json["domain"]
104
+ thumbnail_url = parsed_json["thumbnail_url"]
105
+ analysis_email = parsed_json["analysis_email"]
106
+ data_api_access = parsed_json["data_api_access"]
107
+ id = parsed_json["id"]
108
+ created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
109
+ updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
110
+ is_archived = parsed_json["is_archived"]
111
+ if parsed_json["account_manager"].nil?
112
+ account_manager = nil
113
+ else
114
+ account_manager = parsed_json["account_manager"].to_json
115
+ account_manager = NewDemoApiClient::AccountManagerResponse.from_json(json_object: account_manager)
116
+ end
117
+ user_count = parsed_json["user_count"]
118
+ deal_count = parsed_json["deal_count"]
119
+ users = parsed_json["users"]&.map do |item|
120
+ item = item.to_json
121
+ NewDemoApiClient::GroupUser.from_json(json_object: item)
122
+ end
123
+ new(
124
+ name: name,
125
+ domain: domain,
126
+ thumbnail_url: thumbnail_url,
127
+ analysis_email: analysis_email,
128
+ data_api_access: data_api_access,
129
+ id: id,
130
+ created_at: created_at,
131
+ updated_at: updated_at,
132
+ is_archived: is_archived,
133
+ account_manager: account_manager,
134
+ user_count: user_count,
135
+ deal_count: deal_count,
136
+ users: users,
137
+ additional_properties: struct
138
+ )
139
+ end
140
+
141
+ # Serialize an instance of GroupWithUsersResponse to a JSON object
142
+ #
143
+ # @return [String]
144
+ def to_json(*_args)
145
+ @_field_set&.to_json
146
+ end
147
+
148
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
149
+ # hash and check each fields type against the current object's property
150
+ # definitions.
151
+ #
152
+ # @param obj [Object]
153
+ # @return [Void]
154
+ def self.validate_raw(obj:)
155
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
156
+ obj.domain.is_a?(String) != false || raise("Passed value for field obj.domain is not the expected type, validation failed.")
157
+ obj.thumbnail_url&.is_a?(String) != false || raise("Passed value for field obj.thumbnail_url is not the expected type, validation failed.")
158
+ obj.analysis_email&.is_a?(String) != false || raise("Passed value for field obj.analysis_email is not the expected type, validation failed.")
159
+ obj.data_api_access&.is_a?(Boolean) != false || raise("Passed value for field obj.data_api_access is not the expected type, validation failed.")
160
+ obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
161
+ obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
162
+ obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
163
+ obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
164
+ obj.account_manager.nil? || NewDemoApiClient::AccountManagerResponse.validate_raw(obj: obj.account_manager)
165
+ obj.user_count&.is_a?(Integer) != false || raise("Passed value for field obj.user_count is not the expected type, validation failed.")
166
+ obj.deal_count&.is_a?(Integer) != false || raise("Passed value for field obj.deal_count is not the expected type, validation failed.")
167
+ obj.users&.is_a?(Array) != false || raise("Passed value for field obj.users is not the expected type, validation failed.")
168
+ end
169
+ end
170
+ end
@@ -0,0 +1,226 @@
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 amount.
8
+ # The "amount" is a generic term for the metric being measured, such as revenue or
9
+ # gtv.
10
+ class GrowthAccountingResponse
11
+ # @return [String] The date of the entry.
12
+ attr_reader :date
13
+ # @return [Float] The amount, such as revenue or gtv, in the period.
14
+ attr_reader :amount
15
+ # @return [Float] The retained amount from the last period in the current period.
16
+ attr_reader :retained
17
+ # @return [Float] The number of new users in the period.
18
+ attr_reader :new
19
+ # @return [Float] The number of resurrected users in the period.
20
+ attr_reader :resurrected
21
+ # @return [Float] The amount of expansion in the period.
22
+ attr_reader :expansion
23
+ # @return [Float] The amount of contraction in the period.
24
+ attr_reader :contraction
25
+ # @return [Float] The number of churned users in the period.
26
+ attr_reader :churned
27
+ # @return [Float] 3-month amount growth rate, for monthly frequency.
28
+ attr_reader :cmgr3
29
+ # @return [Float] 6-month amount growth rate, for monthly frequency.
30
+ attr_reader :cmgr6
31
+ # @return [Float] 12-month amount growth rate, for monthly frequency.
32
+ attr_reader :cmgr12
33
+ # @return [Float] 1-quarter amount growth rate, for quarterly frequency.
34
+ attr_reader :cqgr1
35
+ # @return [Float] 2-quarter amount growth rate, for quarterly frequency.
36
+ attr_reader :cqgr2
37
+ # @return [Float] 4-quarter amount growth rate, for quarterly frequency.
38
+ attr_reader :cqgr4
39
+ # @return [Float] The quick ratio, defined as (new + resurrected + expansion) / (churned +
40
+ # contraction).
41
+ attr_reader :quick_ratio
42
+ # @return [Float] The gross retention rate, defined as retained / last period amount.
43
+ attr_reader :gross_retention
44
+ # @return [Float] The net churn rate, defined as -(resurrected + expansion - churned -
45
+ # contraction) / last period amount. This is also known as 1 - net dollar
46
+ # retention. Negative values indicate net-expansion.
47
+ attr_reader :net_churn
48
+ # @return [Float] The lifetime quick ratio, integrated over all time.
49
+ attr_reader :lifetime_quick_ratio
50
+ # @return [Float] The lifetime gross retention rate, integrated over all time.
51
+ attr_reader :lifetime_gross_retention
52
+ # @return [Float] The lifetime net churn rate, integrated over all time. This is also known as 1 -
53
+ # lifetime net dollar retention. Negative values indicate net-expansion.
54
+ attr_reader :lifetime_net_churn
55
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
56
+ attr_reader :additional_properties
57
+ # @return [Object]
58
+ attr_reader :_field_set
59
+ protected :_field_set
60
+
61
+ OMIT = Object.new
62
+
63
+ # @param date [String] The date of the entry.
64
+ # @param amount [Float] The amount, such as revenue or gtv, in the period.
65
+ # @param retained [Float] The retained amount from the last period in the current period.
66
+ # @param new [Float] The number of new users in the period.
67
+ # @param resurrected [Float] The number of resurrected users in the period.
68
+ # @param expansion [Float] The amount of expansion in the period.
69
+ # @param contraction [Float] The amount of contraction in the period.
70
+ # @param churned [Float] The number of churned users in the period.
71
+ # @param cmgr3 [Float] 3-month amount growth rate, for monthly frequency.
72
+ # @param cmgr6 [Float] 6-month amount growth rate, for monthly frequency.
73
+ # @param cmgr12 [Float] 12-month amount growth rate, for monthly frequency.
74
+ # @param cqgr1 [Float] 1-quarter amount growth rate, for quarterly frequency.
75
+ # @param cqgr2 [Float] 2-quarter amount growth rate, for quarterly frequency.
76
+ # @param cqgr4 [Float] 4-quarter amount growth rate, for quarterly frequency.
77
+ # @param quick_ratio [Float] The quick ratio, defined as (new + resurrected + expansion) / (churned +
78
+ # contraction).
79
+ # @param gross_retention [Float] The gross retention rate, defined as retained / last period amount.
80
+ # @param net_churn [Float] The net churn rate, defined as -(resurrected + expansion - churned -
81
+ # contraction) / last period amount. This is also known as 1 - net dollar
82
+ # retention. Negative values indicate net-expansion.
83
+ # @param lifetime_quick_ratio [Float] The lifetime quick ratio, integrated over all time.
84
+ # @param lifetime_gross_retention [Float] The lifetime gross retention rate, integrated over all time.
85
+ # @param lifetime_net_churn [Float] The lifetime net churn rate, integrated over all time. This is also known as 1 -
86
+ # lifetime net dollar retention. Negative values indicate net-expansion.
87
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
88
+ # @return [NewDemoApiClient::GrowthAccountingResponse]
89
+ def initialize(date:, amount:, retained: OMIT, new: OMIT, resurrected: OMIT, expansion: OMIT, contraction: OMIT,
90
+ churned: OMIT, cmgr3: OMIT, cmgr6: OMIT, cmgr12: OMIT, cqgr1: OMIT, cqgr2: OMIT, cqgr4: OMIT, quick_ratio: OMIT, gross_retention: OMIT, net_churn: OMIT, lifetime_quick_ratio: OMIT, lifetime_gross_retention: OMIT, lifetime_net_churn: OMIT, additional_properties: nil)
91
+ @date = date
92
+ @amount = amount
93
+ @retained = retained if retained != OMIT
94
+ @new = new if new != OMIT
95
+ @resurrected = resurrected if resurrected != OMIT
96
+ @expansion = expansion if expansion != OMIT
97
+ @contraction = contraction if contraction != OMIT
98
+ @churned = churned if churned != OMIT
99
+ @cmgr3 = cmgr3 if cmgr3 != OMIT
100
+ @cmgr6 = cmgr6 if cmgr6 != OMIT
101
+ @cmgr12 = cmgr12 if cmgr12 != OMIT
102
+ @cqgr1 = cqgr1 if cqgr1 != OMIT
103
+ @cqgr2 = cqgr2 if cqgr2 != OMIT
104
+ @cqgr4 = cqgr4 if cqgr4 != OMIT
105
+ @quick_ratio = quick_ratio if quick_ratio != OMIT
106
+ @gross_retention = gross_retention if gross_retention != OMIT
107
+ @net_churn = net_churn if net_churn != OMIT
108
+ @lifetime_quick_ratio = lifetime_quick_ratio if lifetime_quick_ratio != OMIT
109
+ @lifetime_gross_retention = lifetime_gross_retention if lifetime_gross_retention != OMIT
110
+ @lifetime_net_churn = lifetime_net_churn if lifetime_net_churn != OMIT
111
+ @additional_properties = additional_properties
112
+ @_field_set = {
113
+ "date": date,
114
+ "amount": amount,
115
+ "retained": retained,
116
+ "new": new,
117
+ "resurrected": resurrected,
118
+ "expansion": expansion,
119
+ "contraction": contraction,
120
+ "churned": churned,
121
+ "cmgr3": cmgr3,
122
+ "cmgr6": cmgr6,
123
+ "cmgr12": cmgr12,
124
+ "cqgr1": cqgr1,
125
+ "cqgr2": cqgr2,
126
+ "cqgr4": cqgr4,
127
+ "quick_ratio": quick_ratio,
128
+ "gross_retention": gross_retention,
129
+ "net_churn": net_churn,
130
+ "lifetime_quick_ratio": lifetime_quick_ratio,
131
+ "lifetime_gross_retention": lifetime_gross_retention,
132
+ "lifetime_net_churn": lifetime_net_churn
133
+ }.reject do |_k, v|
134
+ v == OMIT
135
+ end
136
+ end
137
+
138
+ # Deserialize a JSON object to an instance of GrowthAccountingResponse
139
+ #
140
+ # @param json_object [String]
141
+ # @return [NewDemoApiClient::GrowthAccountingResponse]
142
+ def self.from_json(json_object:)
143
+ struct = JSON.parse(json_object, object_class: OpenStruct)
144
+ parsed_json = JSON.parse(json_object)
145
+ date = parsed_json["date"]
146
+ amount = parsed_json["amount"]
147
+ retained = parsed_json["retained"]
148
+ new = parsed_json["new"]
149
+ resurrected = parsed_json["resurrected"]
150
+ expansion = parsed_json["expansion"]
151
+ contraction = parsed_json["contraction"]
152
+ churned = parsed_json["churned"]
153
+ cmgr3 = parsed_json["cmgr3"]
154
+ cmgr6 = parsed_json["cmgr6"]
155
+ cmgr12 = parsed_json["cmgr12"]
156
+ cqgr1 = parsed_json["cqgr1"]
157
+ cqgr2 = parsed_json["cqgr2"]
158
+ cqgr4 = parsed_json["cqgr4"]
159
+ quick_ratio = parsed_json["quick_ratio"]
160
+ gross_retention = parsed_json["gross_retention"]
161
+ net_churn = parsed_json["net_churn"]
162
+ lifetime_quick_ratio = parsed_json["lifetime_quick_ratio"]
163
+ lifetime_gross_retention = parsed_json["lifetime_gross_retention"]
164
+ lifetime_net_churn = parsed_json["lifetime_net_churn"]
165
+ new(
166
+ date: date,
167
+ amount: amount,
168
+ retained: retained,
169
+ new: new,
170
+ resurrected: resurrected,
171
+ expansion: expansion,
172
+ contraction: contraction,
173
+ churned: churned,
174
+ cmgr3: cmgr3,
175
+ cmgr6: cmgr6,
176
+ cmgr12: cmgr12,
177
+ cqgr1: cqgr1,
178
+ cqgr2: cqgr2,
179
+ cqgr4: cqgr4,
180
+ quick_ratio: quick_ratio,
181
+ gross_retention: gross_retention,
182
+ net_churn: net_churn,
183
+ lifetime_quick_ratio: lifetime_quick_ratio,
184
+ lifetime_gross_retention: lifetime_gross_retention,
185
+ lifetime_net_churn: lifetime_net_churn,
186
+ additional_properties: struct
187
+ )
188
+ end
189
+
190
+ # Serialize an instance of GrowthAccountingResponse to a JSON object
191
+ #
192
+ # @return [String]
193
+ def to_json(*_args)
194
+ @_field_set&.to_json
195
+ end
196
+
197
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
198
+ # hash and check each fields type against the current object's property
199
+ # definitions.
200
+ #
201
+ # @param obj [Object]
202
+ # @return [Void]
203
+ def self.validate_raw(obj:)
204
+ obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.")
205
+ obj.amount.is_a?(Float) != false || raise("Passed value for field obj.amount is not the expected type, validation failed.")
206
+ obj.retained&.is_a?(Float) != false || raise("Passed value for field obj.retained is not the expected type, validation failed.")
207
+ obj.new&.is_a?(Float) != false || raise("Passed value for field obj.new is not the expected type, validation failed.")
208
+ obj.resurrected&.is_a?(Float) != false || raise("Passed value for field obj.resurrected is not the expected type, validation failed.")
209
+ obj.expansion&.is_a?(Float) != false || raise("Passed value for field obj.expansion is not the expected type, validation failed.")
210
+ obj.contraction&.is_a?(Float) != false || raise("Passed value for field obj.contraction is not the expected type, validation failed.")
211
+ obj.churned&.is_a?(Float) != false || raise("Passed value for field obj.churned is not the expected type, validation failed.")
212
+ obj.cmgr3&.is_a?(Float) != false || raise("Passed value for field obj.cmgr3 is not the expected type, validation failed.")
213
+ obj.cmgr6&.is_a?(Float) != false || raise("Passed value for field obj.cmgr6 is not the expected type, validation failed.")
214
+ obj.cmgr12&.is_a?(Float) != false || raise("Passed value for field obj.cmgr12 is not the expected type, validation failed.")
215
+ obj.cqgr1&.is_a?(Float) != false || raise("Passed value for field obj.cqgr1 is not the expected type, validation failed.")
216
+ obj.cqgr2&.is_a?(Float) != false || raise("Passed value for field obj.cqgr2 is not the expected type, validation failed.")
217
+ obj.cqgr4&.is_a?(Float) != false || raise("Passed value for field obj.cqgr4 is not the expected type, validation failed.")
218
+ obj.quick_ratio&.is_a?(Float) != false || raise("Passed value for field obj.quick_ratio is not the expected type, validation failed.")
219
+ obj.gross_retention&.is_a?(Float) != false || raise("Passed value for field obj.gross_retention is not the expected type, validation failed.")
220
+ obj.net_churn&.is_a?(Float) != false || raise("Passed value for field obj.net_churn is not the expected type, validation failed.")
221
+ obj.lifetime_quick_ratio&.is_a?(Float) != false || raise("Passed value for field obj.lifetime_quick_ratio is not the expected type, validation failed.")
222
+ obj.lifetime_gross_retention&.is_a?(Float) != false || raise("Passed value for field obj.lifetime_gross_retention is not the expected type, validation failed.")
223
+ obj.lifetime_net_churn&.is_a?(Float) != false || raise("Passed value for field obj.lifetime_net_churn is not the expected type, validation failed.")
224
+ end
225
+ end
226
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module NewDemoApiClient
7
+ class HealthzResponse
8
+ # @return [String]
9
+ attr_reader :status
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 status [String]
19
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
20
+ # @return [NewDemoApiClient::HealthzResponse]
21
+ def initialize(status:, additional_properties: nil)
22
+ @status = status
23
+ @additional_properties = additional_properties
24
+ @_field_set = { "status": status }
25
+ end
26
+
27
+ # Deserialize a JSON object to an instance of HealthzResponse
28
+ #
29
+ # @param json_object [String]
30
+ # @return [NewDemoApiClient::HealthzResponse]
31
+ def self.from_json(json_object:)
32
+ struct = JSON.parse(json_object, object_class: OpenStruct)
33
+ parsed_json = JSON.parse(json_object)
34
+ status = parsed_json["status"]
35
+ new(status: status, additional_properties: struct)
36
+ end
37
+
38
+ # Serialize an instance of HealthzResponse 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.status.is_a?(String) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "validation_error"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module NewDemoApiClient
8
+ class HTTPValidationError
9
+ # @return [Array<NewDemoApiClient::ValidationError>]
10
+ attr_reader :detail
11
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
12
+ attr_reader :additional_properties
13
+ # @return [Object]
14
+ attr_reader :_field_set
15
+ protected :_field_set
16
+
17
+ OMIT = Object.new
18
+
19
+ # @param detail [Array<NewDemoApiClient::ValidationError>]
20
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
+ # @return [NewDemoApiClient::HTTPValidationError]
22
+ def initialize(detail: OMIT, additional_properties: nil)
23
+ @detail = detail if detail != OMIT
24
+ @additional_properties = additional_properties
25
+ @_field_set = { "detail": detail }.reject do |_k, v|
26
+ v == OMIT
27
+ end
28
+ end
29
+
30
+ # Deserialize a JSON object to an instance of HTTPValidationError
31
+ #
32
+ # @param json_object [String]
33
+ # @return [NewDemoApiClient::HTTPValidationError]
34
+ def self.from_json(json_object:)
35
+ struct = JSON.parse(json_object, object_class: OpenStruct)
36
+ parsed_json = JSON.parse(json_object)
37
+ detail = parsed_json["detail"]&.map do |item|
38
+ item = item.to_json
39
+ NewDemoApiClient::ValidationError.from_json(json_object: item)
40
+ end
41
+ new(detail: detail, additional_properties: struct)
42
+ end
43
+
44
+ # Serialize an instance of HTTPValidationError to a JSON object
45
+ #
46
+ # @return [String]
47
+ def to_json(*_args)
48
+ @_field_set&.to_json
49
+ end
50
+
51
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
52
+ # hash and check each fields type against the current object's property
53
+ # definitions.
54
+ #
55
+ # @param obj [Object]
56
+ # @return [Void]
57
+ def self.validate_raw(obj:)
58
+ obj.detail&.is_a?(Array) != false || raise("Passed value for field obj.detail is not the expected type, validation failed.")
59
+ end
60
+ end
61
+ end