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,135 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
# Represents the cohortized contribution for the Unit Economics for the specified
|
8
|
+
# user type.
|
9
|
+
# This approach assumes all acquisition spend was toward the specified user type.
|
10
|
+
# This is the core input to deriving certain unit-economic aggregate metrics.
|
11
|
+
class ContributionResponse
|
12
|
+
# @return [String] The date of the cohort.
|
13
|
+
attr_reader :cohort
|
14
|
+
# @return [Integer] The period of the cohort. 0 is the first period.
|
15
|
+
attr_reader :period
|
16
|
+
# @return [Integer] The number of users in the cohort.
|
17
|
+
attr_reader :cohort_size
|
18
|
+
# @return [Float] The customer acquisition cost (CAC) for the cohort.
|
19
|
+
attr_reader :cac
|
20
|
+
# @return [Float] The revenue lifetime value (LTV) for the cohort.
|
21
|
+
attr_reader :ltv
|
22
|
+
# @return [Float] The LTV to CAC ratio for the cohort for the period.
|
23
|
+
attr_reader :ltv_cac
|
24
|
+
# @return [Float] The gross-margin lifetime value, which is the cumululative gross profit, for the
|
25
|
+
# cohort for the period.
|
26
|
+
attr_reader :gmltv
|
27
|
+
# @return [Float] The gmLTV to CAC ratio for the cohort for the period. This related to the
|
28
|
+
# contribution margin.
|
29
|
+
attr_reader :gmltv_cac
|
30
|
+
# @return [Float] The contribution (gmLTV - CAC) for the cohort for the period.
|
31
|
+
attr_reader :contribution
|
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 cohort [String] The date of the cohort.
|
41
|
+
# @param period [Integer] The period of the cohort. 0 is the first period.
|
42
|
+
# @param cohort_size [Integer] The number of users in the cohort.
|
43
|
+
# @param cac [Float] The customer acquisition cost (CAC) for the cohort.
|
44
|
+
# @param ltv [Float] The revenue lifetime value (LTV) for the cohort.
|
45
|
+
# @param ltv_cac [Float] The LTV to CAC ratio for the cohort for the period.
|
46
|
+
# @param gmltv [Float] The gross-margin lifetime value, which is the cumululative gross profit, for the
|
47
|
+
# cohort for the period.
|
48
|
+
# @param gmltv_cac [Float] The gmLTV to CAC ratio for the cohort for the period. This related to the
|
49
|
+
# contribution margin.
|
50
|
+
# @param contribution [Float] The contribution (gmLTV - CAC) for the cohort for the period.
|
51
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
52
|
+
# @return [NewDemoApiClient::ContributionResponse]
|
53
|
+
def initialize(cohort:, period:, cohort_size:, cac: OMIT, ltv: OMIT, ltv_cac: OMIT, gmltv: OMIT, gmltv_cac: OMIT,
|
54
|
+
contribution: OMIT, additional_properties: nil)
|
55
|
+
@cohort = cohort
|
56
|
+
@period = period
|
57
|
+
@cohort_size = cohort_size
|
58
|
+
@cac = cac if cac != OMIT
|
59
|
+
@ltv = ltv if ltv != OMIT
|
60
|
+
@ltv_cac = ltv_cac if ltv_cac != OMIT
|
61
|
+
@gmltv = gmltv if gmltv != OMIT
|
62
|
+
@gmltv_cac = gmltv_cac if gmltv_cac != OMIT
|
63
|
+
@contribution = contribution if contribution != OMIT
|
64
|
+
@additional_properties = additional_properties
|
65
|
+
@_field_set = {
|
66
|
+
"cohort": cohort,
|
67
|
+
"period": period,
|
68
|
+
"cohort_size": cohort_size,
|
69
|
+
"cac": cac,
|
70
|
+
"ltv": ltv,
|
71
|
+
"ltv_cac": ltv_cac,
|
72
|
+
"gmltv": gmltv,
|
73
|
+
"gmltv_cac": gmltv_cac,
|
74
|
+
"contribution": contribution
|
75
|
+
}.reject do |_k, v|
|
76
|
+
v == OMIT
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Deserialize a JSON object to an instance of ContributionResponse
|
81
|
+
#
|
82
|
+
# @param json_object [String]
|
83
|
+
# @return [NewDemoApiClient::ContributionResponse]
|
84
|
+
def self.from_json(json_object:)
|
85
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
86
|
+
parsed_json = JSON.parse(json_object)
|
87
|
+
cohort = parsed_json["cohort"]
|
88
|
+
period = parsed_json["period"]
|
89
|
+
cohort_size = parsed_json["cohort_size"]
|
90
|
+
cac = parsed_json["cac"]
|
91
|
+
ltv = parsed_json["ltv"]
|
92
|
+
ltv_cac = parsed_json["ltv_cac"]
|
93
|
+
gmltv = parsed_json["gmltv"]
|
94
|
+
gmltv_cac = parsed_json["gmltv_cac"]
|
95
|
+
contribution = parsed_json["contribution"]
|
96
|
+
new(
|
97
|
+
cohort: cohort,
|
98
|
+
period: period,
|
99
|
+
cohort_size: cohort_size,
|
100
|
+
cac: cac,
|
101
|
+
ltv: ltv,
|
102
|
+
ltv_cac: ltv_cac,
|
103
|
+
gmltv: gmltv,
|
104
|
+
gmltv_cac: gmltv_cac,
|
105
|
+
contribution: contribution,
|
106
|
+
additional_properties: struct
|
107
|
+
)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Serialize an instance of ContributionResponse to a JSON object
|
111
|
+
#
|
112
|
+
# @return [String]
|
113
|
+
def to_json(*_args)
|
114
|
+
@_field_set&.to_json
|
115
|
+
end
|
116
|
+
|
117
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
118
|
+
# hash and check each fields type against the current object's property
|
119
|
+
# definitions.
|
120
|
+
#
|
121
|
+
# @param obj [Object]
|
122
|
+
# @return [Void]
|
123
|
+
def self.validate_raw(obj:)
|
124
|
+
obj.cohort.is_a?(String) != false || raise("Passed value for field obj.cohort is not the expected type, validation failed.")
|
125
|
+
obj.period.is_a?(Integer) != false || raise("Passed value for field obj.period is not the expected type, validation failed.")
|
126
|
+
obj.cohort_size.is_a?(Integer) != false || raise("Passed value for field obj.cohort_size is not the expected type, validation failed.")
|
127
|
+
obj.cac&.is_a?(Float) != false || raise("Passed value for field obj.cac is not the expected type, validation failed.")
|
128
|
+
obj.ltv&.is_a?(Float) != false || raise("Passed value for field obj.ltv is not the expected type, validation failed.")
|
129
|
+
obj.ltv_cac&.is_a?(Float) != false || raise("Passed value for field obj.ltv_cac is not the expected type, validation failed.")
|
130
|
+
obj.gmltv&.is_a?(Float) != false || raise("Passed value for field obj.gmltv is not the expected type, validation failed.")
|
131
|
+
obj.gmltv_cac&.is_a?(Float) != false || raise("Passed value for field obj.gmltv_cac is not the expected type, validation failed.")
|
132
|
+
obj.contribution&.is_a?(Float) != false || raise("Passed value for field obj.contribution is not the expected type, validation failed.")
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module NewDemoApiClient
|
7
|
+
class CreateAPIKeyResponse
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :api_key
|
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 api_key [String]
|
19
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
+
# @return [NewDemoApiClient::CreateAPIKeyResponse]
|
21
|
+
def initialize(api_key:, additional_properties: nil)
|
22
|
+
@api_key = api_key
|
23
|
+
@additional_properties = additional_properties
|
24
|
+
@_field_set = { "api_key": api_key }
|
25
|
+
end
|
26
|
+
|
27
|
+
# Deserialize a JSON object to an instance of CreateAPIKeyResponse
|
28
|
+
#
|
29
|
+
# @param json_object [String]
|
30
|
+
# @return [NewDemoApiClient::CreateAPIKeyResponse]
|
31
|
+
def self.from_json(json_object:)
|
32
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
33
|
+
parsed_json = JSON.parse(json_object)
|
34
|
+
api_key = parsed_json["api_key"]
|
35
|
+
new(api_key: api_key, additional_properties: struct)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Serialize an instance of CreateAPIKeyResponse 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.api_key.is_a?(String) != false || raise("Passed value for field obj.api_key is not the expected type, validation failed.")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "file_type"
|
4
|
+
require "date"
|
5
|
+
require_relative "gcs_signed_url_response"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module NewDemoApiClient
|
10
|
+
class CreateFileForSignedURLResponse
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :name
|
13
|
+
# @return [NewDemoApiClient::FileType] The type of the file
|
14
|
+
attr_reader :type
|
15
|
+
# @return [Integer]
|
16
|
+
attr_reader :id
|
17
|
+
# @return [DateTime]
|
18
|
+
attr_reader :created_at
|
19
|
+
# @return [DateTime]
|
20
|
+
attr_reader :updated_at
|
21
|
+
# @return [Boolean]
|
22
|
+
attr_reader :is_archived
|
23
|
+
# @return [Integer]
|
24
|
+
attr_reader :deal_id
|
25
|
+
# @return [NewDemoApiClient::GcsSignedURLResponse]
|
26
|
+
attr_reader :signed_url
|
27
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
28
|
+
attr_reader :additional_properties
|
29
|
+
# @return [Object]
|
30
|
+
attr_reader :_field_set
|
31
|
+
protected :_field_set
|
32
|
+
|
33
|
+
OMIT = Object.new
|
34
|
+
|
35
|
+
# @param name [String]
|
36
|
+
# @param type [NewDemoApiClient::FileType] The type of the file
|
37
|
+
# @param id [Integer]
|
38
|
+
# @param created_at [DateTime]
|
39
|
+
# @param updated_at [DateTime]
|
40
|
+
# @param is_archived [Boolean]
|
41
|
+
# @param deal_id [Integer]
|
42
|
+
# @param signed_url [NewDemoApiClient::GcsSignedURLResponse]
|
43
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
44
|
+
# @return [NewDemoApiClient::CreateFileForSignedURLResponse]
|
45
|
+
def initialize(name:, id:, signed_url:, type: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT,
|
46
|
+
deal_id: OMIT, additional_properties: nil)
|
47
|
+
@name = name
|
48
|
+
@type = type if type != 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
|
+
@deal_id = deal_id if deal_id != OMIT
|
54
|
+
@signed_url = signed_url
|
55
|
+
@additional_properties = additional_properties
|
56
|
+
@_field_set = {
|
57
|
+
"name": name,
|
58
|
+
"type": type,
|
59
|
+
"id": id,
|
60
|
+
"created_at": created_at,
|
61
|
+
"updated_at": updated_at,
|
62
|
+
"is_archived": is_archived,
|
63
|
+
"deal_id": deal_id,
|
64
|
+
"signed_url": signed_url
|
65
|
+
}.reject do |_k, v|
|
66
|
+
v == OMIT
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Deserialize a JSON object to an instance of CreateFileForSignedURLResponse
|
71
|
+
#
|
72
|
+
# @param json_object [String]
|
73
|
+
# @return [NewDemoApiClient::CreateFileForSignedURLResponse]
|
74
|
+
def self.from_json(json_object:)
|
75
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
76
|
+
parsed_json = JSON.parse(json_object)
|
77
|
+
name = parsed_json["name"]
|
78
|
+
type = parsed_json["type"]
|
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
|
+
deal_id = parsed_json["deal_id"]
|
84
|
+
if parsed_json["signed_url"].nil?
|
85
|
+
signed_url = nil
|
86
|
+
else
|
87
|
+
signed_url = parsed_json["signed_url"].to_json
|
88
|
+
signed_url = NewDemoApiClient::GcsSignedURLResponse.from_json(json_object: signed_url)
|
89
|
+
end
|
90
|
+
new(
|
91
|
+
name: name,
|
92
|
+
type: type,
|
93
|
+
id: id,
|
94
|
+
created_at: created_at,
|
95
|
+
updated_at: updated_at,
|
96
|
+
is_archived: is_archived,
|
97
|
+
deal_id: deal_id,
|
98
|
+
signed_url: signed_url,
|
99
|
+
additional_properties: struct
|
100
|
+
)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Serialize an instance of CreateFileForSignedURLResponse to a JSON object
|
104
|
+
#
|
105
|
+
# @return [String]
|
106
|
+
def to_json(*_args)
|
107
|
+
@_field_set&.to_json
|
108
|
+
end
|
109
|
+
|
110
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
111
|
+
# hash and check each fields type against the current object's property
|
112
|
+
# definitions.
|
113
|
+
#
|
114
|
+
# @param obj [Object]
|
115
|
+
# @return [Void]
|
116
|
+
def self.validate_raw(obj:)
|
117
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
118
|
+
obj.type&.is_a?(NewDemoApiClient::FileType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
119
|
+
obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
120
|
+
obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
121
|
+
obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
122
|
+
obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
|
123
|
+
obj.deal_id&.is_a?(Integer) != false || raise("Passed value for field obj.deal_id is not the expected type, validation failed.")
|
124
|
+
NewDemoApiClient::GcsSignedURLResponse.validate_raw(obj: obj.signed_url)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "file_type"
|
4
|
+
require "date"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module NewDemoApiClient
|
9
|
+
class CreateFileResponse
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :name
|
12
|
+
# @return [NewDemoApiClient::FileType] The type of the file
|
13
|
+
attr_reader :type
|
14
|
+
# @return [Integer]
|
15
|
+
attr_reader :id
|
16
|
+
# @return [DateTime]
|
17
|
+
attr_reader :created_at
|
18
|
+
# @return [DateTime]
|
19
|
+
attr_reader :updated_at
|
20
|
+
# @return [Boolean]
|
21
|
+
attr_reader :is_archived
|
22
|
+
# @return [Integer]
|
23
|
+
attr_reader :deal_id
|
24
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
attr_reader :additional_properties
|
26
|
+
# @return [Object]
|
27
|
+
attr_reader :_field_set
|
28
|
+
protected :_field_set
|
29
|
+
|
30
|
+
OMIT = Object.new
|
31
|
+
|
32
|
+
# @param name [String]
|
33
|
+
# @param type [NewDemoApiClient::FileType] The type of the file
|
34
|
+
# @param id [Integer]
|
35
|
+
# @param created_at [DateTime]
|
36
|
+
# @param updated_at [DateTime]
|
37
|
+
# @param is_archived [Boolean]
|
38
|
+
# @param deal_id [Integer]
|
39
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
40
|
+
# @return [NewDemoApiClient::CreateFileResponse]
|
41
|
+
def initialize(name:, id:, type: OMIT, created_at: OMIT, updated_at: OMIT, is_archived: OMIT, deal_id: OMIT,
|
42
|
+
additional_properties: nil)
|
43
|
+
@name = name
|
44
|
+
@type = type if type != OMIT
|
45
|
+
@id = id
|
46
|
+
@created_at = created_at if created_at != OMIT
|
47
|
+
@updated_at = updated_at if updated_at != OMIT
|
48
|
+
@is_archived = is_archived if is_archived != OMIT
|
49
|
+
@deal_id = deal_id if deal_id != OMIT
|
50
|
+
@additional_properties = additional_properties
|
51
|
+
@_field_set = {
|
52
|
+
"name": name,
|
53
|
+
"type": type,
|
54
|
+
"id": id,
|
55
|
+
"created_at": created_at,
|
56
|
+
"updated_at": updated_at,
|
57
|
+
"is_archived": is_archived,
|
58
|
+
"deal_id": deal_id
|
59
|
+
}.reject do |_k, v|
|
60
|
+
v == OMIT
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Deserialize a JSON object to an instance of CreateFileResponse
|
65
|
+
#
|
66
|
+
# @param json_object [String]
|
67
|
+
# @return [NewDemoApiClient::CreateFileResponse]
|
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
|
+
type = parsed_json["type"]
|
73
|
+
id = parsed_json["id"]
|
74
|
+
created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
|
75
|
+
updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
|
76
|
+
is_archived = parsed_json["is_archived"]
|
77
|
+
deal_id = parsed_json["deal_id"]
|
78
|
+
new(
|
79
|
+
name: name,
|
80
|
+
type: type,
|
81
|
+
id: id,
|
82
|
+
created_at: created_at,
|
83
|
+
updated_at: updated_at,
|
84
|
+
is_archived: is_archived,
|
85
|
+
deal_id: deal_id,
|
86
|
+
additional_properties: struct
|
87
|
+
)
|
88
|
+
end
|
89
|
+
|
90
|
+
# Serialize an instance of CreateFileResponse to a JSON object
|
91
|
+
#
|
92
|
+
# @return [String]
|
93
|
+
def to_json(*_args)
|
94
|
+
@_field_set&.to_json
|
95
|
+
end
|
96
|
+
|
97
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
98
|
+
# hash and check each fields type against the current object's property
|
99
|
+
# definitions.
|
100
|
+
#
|
101
|
+
# @param obj [Object]
|
102
|
+
# @return [Void]
|
103
|
+
def self.validate_raw(obj:)
|
104
|
+
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
105
|
+
obj.type&.is_a?(NewDemoApiClient::FileType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
106
|
+
obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
107
|
+
obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
108
|
+
obj.updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
109
|
+
obj.is_archived&.is_a?(Boolean) != false || raise("Passed value for field obj.is_archived is not the expected type, validation failed.")
|
110
|
+
obj.deal_id&.is_a?(Integer) != false || raise("Passed value for field obj.deal_id is not the expected type, validation failed.")
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|