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,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "user_with_permissions_response"
|
4
|
+
require_relative "group_response"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module NewDemoApiClient
|
9
|
+
class UserRoleResponse
|
10
|
+
# @return [NewDemoApiClient::UserWithPermissionsResponse]
|
11
|
+
attr_reader :user
|
12
|
+
# @return [NewDemoApiClient::GroupResponse]
|
13
|
+
attr_reader :group
|
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 user [NewDemoApiClient::UserWithPermissionsResponse]
|
23
|
+
# @param group [NewDemoApiClient::GroupResponse]
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [NewDemoApiClient::UserRoleResponse]
|
26
|
+
def initialize(user:, group:, additional_properties: nil)
|
27
|
+
@user = user
|
28
|
+
@group = group
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "user": user, "group": group }
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of UserRoleResponse
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [NewDemoApiClient::UserRoleResponse]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
if parsed_json["user"].nil?
|
41
|
+
user = nil
|
42
|
+
else
|
43
|
+
user = parsed_json["user"].to_json
|
44
|
+
user = NewDemoApiClient::UserWithPermissionsResponse.from_json(json_object: user)
|
45
|
+
end
|
46
|
+
if parsed_json["group"].nil?
|
47
|
+
group = nil
|
48
|
+
else
|
49
|
+
group = parsed_json["group"].to_json
|
50
|
+
group = NewDemoApiClient::GroupResponse.from_json(json_object: group)
|
51
|
+
end
|
52
|
+
new(
|
53
|
+
user: user,
|
54
|
+
group: group,
|
55
|
+
additional_properties: struct
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Serialize an instance of UserRoleResponse to a JSON object
|
60
|
+
#
|
61
|
+
# @return [String]
|
62
|
+
def to_json(*_args)
|
63
|
+
@_field_set&.to_json
|
64
|
+
end
|
65
|
+
|
66
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
67
|
+
# hash and check each fields type against the current object's property
|
68
|
+
# definitions.
|
69
|
+
#
|
70
|
+
# @param obj [Object]
|
71
|
+
# @return [Void]
|
72
|
+
def self.validate_raw(obj:)
|
73
|
+
NewDemoApiClient::UserWithPermissionsResponse.validate_raw(obj: obj.user)
|
74
|
+
NewDemoApiClient::GroupResponse.validate_raw(obj: obj.group)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require_relative "group_response"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module NewDemoApiClient
|
9
|
+
class UserWithGroupsResponse
|
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 [Boolean]
|
25
|
+
attr_reader :super_user
|
26
|
+
# @return [String]
|
27
|
+
attr_reader :api_key_final_characters
|
28
|
+
# @return [Array<NewDemoApiClient::GroupResponse>]
|
29
|
+
attr_reader :groups
|
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 name [String]
|
39
|
+
# @param email [String] The email address of the user
|
40
|
+
# @param thumbnail [String] The thumbnail URL of the user
|
41
|
+
# @param id [Integer]
|
42
|
+
# @param created_at [DateTime]
|
43
|
+
# @param updated_at [DateTime]
|
44
|
+
# @param is_archived [Boolean]
|
45
|
+
# @param super_user [Boolean]
|
46
|
+
# @param api_key_final_characters [String]
|
47
|
+
# @param groups [Array<NewDemoApiClient::GroupResponse>]
|
48
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
49
|
+
# @return [NewDemoApiClient::UserWithGroupsResponse]
|
50
|
+
def initialize(name:, email:, id:, thumbnail: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT,
|
51
|
+
super_user: OMIT, api_key_final_characters: OMIT, groups: OMIT, additional_properties: nil)
|
52
|
+
@name = name
|
53
|
+
@email = email
|
54
|
+
@thumbnail = thumbnail if thumbnail != OMIT
|
55
|
+
@id = id
|
56
|
+
@created_at = created_at if created_at != OMIT
|
57
|
+
@updated_at = updated_at if updated_at != OMIT
|
58
|
+
@is_archived = is_archived if is_archived != OMIT
|
59
|
+
@super_user = super_user if super_user != OMIT
|
60
|
+
@api_key_final_characters = api_key_final_characters if api_key_final_characters != OMIT
|
61
|
+
@groups = groups if groups != OMIT
|
62
|
+
@additional_properties = additional_properties
|
63
|
+
@_field_set = {
|
64
|
+
"name": name,
|
65
|
+
"email": email,
|
66
|
+
"thumbnail": thumbnail,
|
67
|
+
"id": id,
|
68
|
+
"created_at": created_at,
|
69
|
+
"updated_at": updated_at,
|
70
|
+
"is_archived": is_archived,
|
71
|
+
"super_user": super_user,
|
72
|
+
"api_key_final_characters": api_key_final_characters,
|
73
|
+
"groups": groups
|
74
|
+
}.reject do |_k, v|
|
75
|
+
v == OMIT
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Deserialize a JSON object to an instance of UserWithGroupsResponse
|
80
|
+
#
|
81
|
+
# @param json_object [String]
|
82
|
+
# @return [NewDemoApiClient::UserWithGroupsResponse]
|
83
|
+
def self.from_json(json_object:)
|
84
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
85
|
+
parsed_json = JSON.parse(json_object)
|
86
|
+
name = parsed_json["name"]
|
87
|
+
email = parsed_json["email"]
|
88
|
+
thumbnail = parsed_json["thumbnail"]
|
89
|
+
id = parsed_json["id"]
|
90
|
+
created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
|
91
|
+
updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
|
92
|
+
is_archived = parsed_json["is_archived"]
|
93
|
+
super_user = parsed_json["super_user"]
|
94
|
+
api_key_final_characters = parsed_json["api_key_final_characters"]
|
95
|
+
groups = parsed_json["groups"]&.map do |item|
|
96
|
+
item = item.to_json
|
97
|
+
NewDemoApiClient::GroupResponse.from_json(json_object: item)
|
98
|
+
end
|
99
|
+
new(
|
100
|
+
name: name,
|
101
|
+
email: email,
|
102
|
+
thumbnail: thumbnail,
|
103
|
+
id: id,
|
104
|
+
created_at: created_at,
|
105
|
+
updated_at: updated_at,
|
106
|
+
is_archived: is_archived,
|
107
|
+
super_user: super_user,
|
108
|
+
api_key_final_characters: api_key_final_characters,
|
109
|
+
groups: groups,
|
110
|
+
additional_properties: struct
|
111
|
+
)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Serialize an instance of UserWithGroupsResponse to a JSON object
|
115
|
+
#
|
116
|
+
# @return [String]
|
117
|
+
def to_json(*_args)
|
118
|
+
@_field_set&.to_json
|
119
|
+
end
|
120
|
+
|
121
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
122
|
+
# hash and check each fields type against the current object's property
|
123
|
+
# definitions.
|
124
|
+
#
|
125
|
+
# @param obj [Object]
|
126
|
+
# @return [Void]
|
127
|
+
def self.validate_raw(obj:)
|
128
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
129
|
+
obj.email.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
|
130
|
+
obj.thumbnail&.is_a?(String) != false || raise("Passed value for field obj.thumbnail is not the expected type, validation failed.")
|
131
|
+
obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
132
|
+
obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
133
|
+
obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
134
|
+
obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
|
135
|
+
obj.super_user&.is_a?(Boolean) != false || raise("Passed value for field obj.super_user is not the expected type, validation failed.")
|
136
|
+
obj.api_key_final_characters&.is_a?(String) != false || raise("Passed value for field obj.api_key_final_characters is not the expected type, validation failed.")
|
137
|
+
obj.groups&.is_a?(Array) != false || raise("Passed value for field obj.groups is not the expected type, validation failed.")
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require_relative "group_response"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module NewDemoApiClient
|
9
|
+
class UserWithPermissionsResponse
|
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 [Boolean]
|
25
|
+
attr_reader :super_user
|
26
|
+
# @return [String]
|
27
|
+
attr_reader :api_key_final_characters
|
28
|
+
# @return [Array<NewDemoApiClient::GroupResponse>]
|
29
|
+
attr_reader :groups
|
30
|
+
# @return [Hash{String => Array}]
|
31
|
+
attr_reader :permissions_by_group
|
32
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
33
|
+
attr_reader :additional_properties
|
34
|
+
# @return [Object]
|
35
|
+
attr_reader :_field_set
|
36
|
+
protected :_field_set
|
37
|
+
|
38
|
+
OMIT = Object.new
|
39
|
+
|
40
|
+
# @param name [String]
|
41
|
+
# @param email [String] The email address of the user
|
42
|
+
# @param thumbnail [String] The thumbnail URL of the user
|
43
|
+
# @param id [Integer]
|
44
|
+
# @param created_at [DateTime]
|
45
|
+
# @param updated_at [DateTime]
|
46
|
+
# @param is_archived [Boolean]
|
47
|
+
# @param super_user [Boolean]
|
48
|
+
# @param api_key_final_characters [String]
|
49
|
+
# @param groups [Array<NewDemoApiClient::GroupResponse>]
|
50
|
+
# @param permissions_by_group [Hash{String => Array}]
|
51
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
52
|
+
# @return [NewDemoApiClient::UserWithPermissionsResponse]
|
53
|
+
def initialize(name:, email:, id:, thumbnail: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT,
|
54
|
+
super_user: OMIT, api_key_final_characters: OMIT, groups: OMIT, permissions_by_group: OMIT, additional_properties: nil)
|
55
|
+
@name = name
|
56
|
+
@email = email
|
57
|
+
@thumbnail = thumbnail if thumbnail != OMIT
|
58
|
+
@id = id
|
59
|
+
@created_at = created_at if created_at != OMIT
|
60
|
+
@updated_at = updated_at if updated_at != OMIT
|
61
|
+
@is_archived = is_archived if is_archived != OMIT
|
62
|
+
@super_user = super_user if super_user != OMIT
|
63
|
+
@api_key_final_characters = api_key_final_characters if api_key_final_characters != OMIT
|
64
|
+
@groups = groups if groups != OMIT
|
65
|
+
@permissions_by_group = permissions_by_group if permissions_by_group != OMIT
|
66
|
+
@additional_properties = additional_properties
|
67
|
+
@_field_set = {
|
68
|
+
"name": name,
|
69
|
+
"email": email,
|
70
|
+
"thumbnail": thumbnail,
|
71
|
+
"id": id,
|
72
|
+
"created_at": created_at,
|
73
|
+
"updated_at": updated_at,
|
74
|
+
"is_archived": is_archived,
|
75
|
+
"super_user": super_user,
|
76
|
+
"api_key_final_characters": api_key_final_characters,
|
77
|
+
"groups": groups,
|
78
|
+
"permissions_by_group": permissions_by_group
|
79
|
+
}.reject do |_k, v|
|
80
|
+
v == OMIT
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Deserialize a JSON object to an instance of UserWithPermissionsResponse
|
85
|
+
#
|
86
|
+
# @param json_object [String]
|
87
|
+
# @return [NewDemoApiClient::UserWithPermissionsResponse]
|
88
|
+
def self.from_json(json_object:)
|
89
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
90
|
+
parsed_json = JSON.parse(json_object)
|
91
|
+
name = parsed_json["name"]
|
92
|
+
email = parsed_json["email"]
|
93
|
+
thumbnail = parsed_json["thumbnail"]
|
94
|
+
id = parsed_json["id"]
|
95
|
+
created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
|
96
|
+
updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
|
97
|
+
is_archived = parsed_json["is_archived"]
|
98
|
+
super_user = parsed_json["super_user"]
|
99
|
+
api_key_final_characters = parsed_json["api_key_final_characters"]
|
100
|
+
groups = parsed_json["groups"]&.map do |item|
|
101
|
+
item = item.to_json
|
102
|
+
NewDemoApiClient::GroupResponse.from_json(json_object: item)
|
103
|
+
end
|
104
|
+
permissions_by_group = parsed_json["permissions_by_group"]&.transform_values do |value|
|
105
|
+
value&.map do |item|
|
106
|
+
item = item.to_json
|
107
|
+
NewDemoApiClient::PermissionModel.from_json(json_object: item)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
new(
|
111
|
+
name: name,
|
112
|
+
email: email,
|
113
|
+
thumbnail: thumbnail,
|
114
|
+
id: id,
|
115
|
+
created_at: created_at,
|
116
|
+
updated_at: updated_at,
|
117
|
+
is_archived: is_archived,
|
118
|
+
super_user: super_user,
|
119
|
+
api_key_final_characters: api_key_final_characters,
|
120
|
+
groups: groups,
|
121
|
+
permissions_by_group: permissions_by_group,
|
122
|
+
additional_properties: struct
|
123
|
+
)
|
124
|
+
end
|
125
|
+
|
126
|
+
# Serialize an instance of UserWithPermissionsResponse to a JSON object
|
127
|
+
#
|
128
|
+
# @return [String]
|
129
|
+
def to_json(*_args)
|
130
|
+
@_field_set&.to_json
|
131
|
+
end
|
132
|
+
|
133
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
134
|
+
# hash and check each fields type against the current object's property
|
135
|
+
# definitions.
|
136
|
+
#
|
137
|
+
# @param obj [Object]
|
138
|
+
# @return [Void]
|
139
|
+
def self.validate_raw(obj:)
|
140
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
141
|
+
obj.email.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
|
142
|
+
obj.thumbnail&.is_a?(String) != false || raise("Passed value for field obj.thumbnail is not the expected type, validation failed.")
|
143
|
+
obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
144
|
+
obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
145
|
+
obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
146
|
+
obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
|
147
|
+
obj.super_user&.is_a?(Boolean) != false || raise("Passed value for field obj.super_user is not the expected type, validation failed.")
|
148
|
+
obj.api_key_final_characters&.is_a?(String) != false || raise("Passed value for field obj.api_key_final_characters is not the expected type, validation failed.")
|
149
|
+
obj.groups&.is_a?(Array) != false || raise("Passed value for field obj.groups is not the expected type, validation failed.")
|
150
|
+
obj.permissions_by_group&.is_a?(Hash) != false || raise("Passed value for field obj.permissions_by_group is not the expected type, validation failed.")
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "validation_error_loc_item"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module NewDemoApiClient
|
8
|
+
class ValidationError
|
9
|
+
# @return [Array<NewDemoApiClient::ValidationErrorLocItem>]
|
10
|
+
attr_reader :loc
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :msg
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :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 loc [Array<NewDemoApiClient::ValidationErrorLocItem>]
|
24
|
+
# @param msg [String]
|
25
|
+
# @param type [String]
|
26
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
27
|
+
# @return [NewDemoApiClient::ValidationError]
|
28
|
+
def initialize(loc:, msg:, type:, additional_properties: nil)
|
29
|
+
@loc = loc
|
30
|
+
@msg = msg
|
31
|
+
@type = type
|
32
|
+
@additional_properties = additional_properties
|
33
|
+
@_field_set = { "loc": loc, "msg": msg, "type": type }
|
34
|
+
end
|
35
|
+
|
36
|
+
# Deserialize a JSON object to an instance of ValidationError
|
37
|
+
#
|
38
|
+
# @param json_object [String]
|
39
|
+
# @return [NewDemoApiClient::ValidationError]
|
40
|
+
def self.from_json(json_object:)
|
41
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
|
+
parsed_json = JSON.parse(json_object)
|
43
|
+
loc = parsed_json["loc"]&.map do |item|
|
44
|
+
item = item.to_json
|
45
|
+
NewDemoApiClient::ValidationErrorLocItem.from_json(json_object: item)
|
46
|
+
end
|
47
|
+
msg = parsed_json["msg"]
|
48
|
+
type = parsed_json["type"]
|
49
|
+
new(
|
50
|
+
loc: loc,
|
51
|
+
msg: msg,
|
52
|
+
type: type,
|
53
|
+
additional_properties: struct
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Serialize an instance of ValidationError to a JSON object
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
def to_json(*_args)
|
61
|
+
@_field_set&.to_json
|
62
|
+
end
|
63
|
+
|
64
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
65
|
+
# hash and check each fields type against the current object's property
|
66
|
+
# definitions.
|
67
|
+
#
|
68
|
+
# @param obj [Object]
|
69
|
+
# @return [Void]
|
70
|
+
def self.validate_raw(obj:)
|
71
|
+
obj.loc.is_a?(Array) != false || raise("Passed value for field obj.loc is not the expected type, validation failed.")
|
72
|
+
obj.msg.is_a?(String) != false || raise("Passed value for field obj.msg is not the expected type, validation failed.")
|
73
|
+
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module NewDemoApiClient
|
6
|
+
class ValidationErrorLocItem
|
7
|
+
# Deserialize a JSON object to an instance of ValidationErrorLocItem
|
8
|
+
#
|
9
|
+
# @param json_object [String]
|
10
|
+
# @return [NewDemoApiClient::ValidationErrorLocItem]
|
11
|
+
def self.from_json(json_object:)
|
12
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
13
|
+
begin
|
14
|
+
struct.is_a?(String) != false || raise("Passed value for field struct is not the expected type, validation failed.")
|
15
|
+
return struct unless struct.nil?
|
16
|
+
|
17
|
+
return nil
|
18
|
+
rescue StandardError
|
19
|
+
# noop
|
20
|
+
end
|
21
|
+
begin
|
22
|
+
struct.is_a?(Integer) != false || raise("Passed value for field struct is not the expected type, validation failed.")
|
23
|
+
return struct unless struct.nil?
|
24
|
+
|
25
|
+
return nil
|
26
|
+
rescue StandardError
|
27
|
+
# noop
|
28
|
+
end
|
29
|
+
struct
|
30
|
+
end
|
31
|
+
|
32
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
33
|
+
# hash and check each fields type against the current object's property
|
34
|
+
# definitions.
|
35
|
+
#
|
36
|
+
# @param obj [Object]
|
37
|
+
# @return [Void]
|
38
|
+
def self.validate_raw(obj:)
|
39
|
+
begin
|
40
|
+
return obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
41
|
+
rescue StandardError
|
42
|
+
# noop
|
43
|
+
end
|
44
|
+
begin
|
45
|
+
return obj.is_a?(Integer) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
46
|
+
rescue StandardError
|
47
|
+
# noop
|
48
|
+
end
|
49
|
+
raise("Passed value matched no type within the union, validation failed.")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
class WeatherComponents
|
8
|
+
# @return [String] The stage of the weather gauge
|
9
|
+
attr_reader :stage
|
10
|
+
# @return [String] The date of the data point
|
11
|
+
attr_reader :date
|
12
|
+
# @return [Float] The values of the individual components of the weather gauge
|
13
|
+
attr_reader :weather_gauge
|
14
|
+
# @return [Float] The measured actual annualized fundraising amount for the stage in a rolling
|
15
|
+
# window, subset only to companies that have known amounts raised in the prior
|
16
|
+
# stage. The value is null for future dates beyond the last valid date of the
|
17
|
+
# indicator
|
18
|
+
attr_reader :actual_annualized
|
19
|
+
# @return [Float] The estimated present and past potential annualized fundraising amount for the
|
20
|
+
# stage in a rolling window, which measures the amount of fundraising one would
|
21
|
+
# expect under normal conditions, based on investment in the prior stage and
|
22
|
+
# accounting for exits. The value is null for future dates beyond the last valid
|
23
|
+
# date of the indicator
|
24
|
+
attr_reader :potential_annualized
|
25
|
+
# @return [Float] The estimated future potential annualized fundraising amount for the stage in a
|
26
|
+
# rolling window, which measures the amount of fundraising one would expect under
|
27
|
+
# normal conditions, based on investment in the prior stage and accounting for
|
28
|
+
# exits. The value is null for past dates and forecasted for future dates
|
29
|
+
attr_reader :potential_annualized_forecast
|
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 stage [String] The stage of the weather gauge
|
39
|
+
# @param date [String] The date of the data point
|
40
|
+
# @param weather_gauge [Float] The values of the individual components of the weather gauge
|
41
|
+
# @param actual_annualized [Float] The measured actual annualized fundraising amount for the stage in a rolling
|
42
|
+
# window, subset only to companies that have known amounts raised in the prior
|
43
|
+
# stage. The value is null for future dates beyond the last valid date of the
|
44
|
+
# indicator
|
45
|
+
# @param potential_annualized [Float] The estimated present and past potential annualized fundraising amount for the
|
46
|
+
# stage in a rolling window, which measures the amount of fundraising one would
|
47
|
+
# expect under normal conditions, based on investment in the prior stage and
|
48
|
+
# accounting for exits. The value is null for future dates beyond the last valid
|
49
|
+
# date of the indicator
|
50
|
+
# @param potential_annualized_forecast [Float] The estimated future potential annualized fundraising amount for the stage in a
|
51
|
+
# rolling window, which measures the amount of fundraising one would expect under
|
52
|
+
# normal conditions, based on investment in the prior stage and accounting for
|
53
|
+
# exits. The value is null for past dates and forecasted for future dates
|
54
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
55
|
+
# @return [NewDemoApiClient::WeatherComponents]
|
56
|
+
def initialize(stage:, date:, weather_gauge: OMIT, actual_annualized: OMIT, potential_annualized: OMIT,
|
57
|
+
potential_annualized_forecast: OMIT, additional_properties: nil)
|
58
|
+
@stage = stage
|
59
|
+
@date = date
|
60
|
+
@weather_gauge = weather_gauge if weather_gauge != OMIT
|
61
|
+
@actual_annualized = actual_annualized if actual_annualized != OMIT
|
62
|
+
@potential_annualized = potential_annualized if potential_annualized != OMIT
|
63
|
+
@potential_annualized_forecast = potential_annualized_forecast if potential_annualized_forecast != OMIT
|
64
|
+
@additional_properties = additional_properties
|
65
|
+
@_field_set = {
|
66
|
+
"stage": stage,
|
67
|
+
"date": date,
|
68
|
+
"weather_gauge": weather_gauge,
|
69
|
+
"actual_annualized": actual_annualized,
|
70
|
+
"potential_annualized": potential_annualized,
|
71
|
+
"potential_annualized_forecast": potential_annualized_forecast
|
72
|
+
}.reject do |_k, v|
|
73
|
+
v == OMIT
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Deserialize a JSON object to an instance of WeatherComponents
|
78
|
+
#
|
79
|
+
# @param json_object [String]
|
80
|
+
# @return [NewDemoApiClient::WeatherComponents]
|
81
|
+
def self.from_json(json_object:)
|
82
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
83
|
+
parsed_json = JSON.parse(json_object)
|
84
|
+
stage = parsed_json["stage"]
|
85
|
+
date = parsed_json["date"]
|
86
|
+
weather_gauge = parsed_json["weather_gauge"]
|
87
|
+
actual_annualized = parsed_json["actual_annualized"]
|
88
|
+
potential_annualized = parsed_json["potential_annualized"]
|
89
|
+
potential_annualized_forecast = parsed_json["potential_annualized_forecast"]
|
90
|
+
new(
|
91
|
+
stage: stage,
|
92
|
+
date: date,
|
93
|
+
weather_gauge: weather_gauge,
|
94
|
+
actual_annualized: actual_annualized,
|
95
|
+
potential_annualized: potential_annualized,
|
96
|
+
potential_annualized_forecast: potential_annualized_forecast,
|
97
|
+
additional_properties: struct
|
98
|
+
)
|
99
|
+
end
|
100
|
+
|
101
|
+
# Serialize an instance of WeatherComponents to a JSON object
|
102
|
+
#
|
103
|
+
# @return [String]
|
104
|
+
def to_json(*_args)
|
105
|
+
@_field_set&.to_json
|
106
|
+
end
|
107
|
+
|
108
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
109
|
+
# hash and check each fields type against the current object's property
|
110
|
+
# definitions.
|
111
|
+
#
|
112
|
+
# @param obj [Object]
|
113
|
+
# @return [Void]
|
114
|
+
def self.validate_raw(obj:)
|
115
|
+
obj.stage.is_a?(String) != false || raise("Passed value for field obj.stage is not the expected type, validation failed.")
|
116
|
+
obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.")
|
117
|
+
obj.weather_gauge&.is_a?(Float) != false || raise("Passed value for field obj.weather_gauge is not the expected type, validation failed.")
|
118
|
+
obj.actual_annualized&.is_a?(Float) != false || raise("Passed value for field obj.actual_annualized is not the expected type, validation failed.")
|
119
|
+
obj.potential_annualized&.is_a?(Float) != false || raise("Passed value for field obj.potential_annualized is not the expected type, validation failed.")
|
120
|
+
obj.potential_annualized_forecast&.is_a?(Float) != false || raise("Passed value for field obj.potential_annualized_forecast is not the expected type, validation failed.")
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|