Class: NewDemoApiClient::DealDataAvailablityResponse
- Inherits:
-
Object
- Object
- NewDemoApiClient::DealDataAvailablityResponse
- Defined in:
- lib/test_sdk/types/deal_data_availablity_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#benchmark_categories ⇒ Array<String>
readonly
List of categories applied to the company associated with this deal.
-
#benchmarks_user_types ⇒ Array<String>
readonly
List of user types with benchmarks available for this deal.
-
#financials_exist ⇒ Boolean
readonly
Financials data has been processed for this deal.
-
#product_metrics ⇒ Array<NewDemoApiClient::ProductInfoResponse>
readonly
List of which product metrics are available for this deal.
-
#talent_exists ⇒ Boolean
readonly
Talent data has been processed for this deal.
-
#unit_economics_metrics ⇒ Array<NewDemoApiClient::UnitEconomicsInfoResponse>
readonly
List of which user types with unit economics metrics are available for this deal.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::DealDataAvailablityResponse
Deserialize a JSON object to an instance of DealDataAvailablityResponse.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(financials_exist:, talent_exists:, product_metrics:, unit_economics_metrics:, benchmarks_user_types:, benchmark_categories:, additional_properties: nil) ⇒ NewDemoApiClient::DealDataAvailablityResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of DealDataAvailablityResponse to a JSON object.
Constructor Details
#initialize(financials_exist:, talent_exists:, product_metrics:, unit_economics_metrics:, benchmarks_user_types:, benchmark_categories:, additional_properties: nil) ⇒ NewDemoApiClient::DealDataAvailablityResponse
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 38 def initialize(financials_exist:, talent_exists:, product_metrics:, unit_economics_metrics:, benchmarks_user_types:, benchmark_categories:, additional_properties: nil) @financials_exist = financials_exist @talent_exists = talent_exists @product_metrics = product_metrics @unit_economics_metrics = unit_economics_metrics @benchmarks_user_types = benchmarks_user_types @benchmark_categories = benchmark_categories @additional_properties = additional_properties @_field_set = { "financials_exist": financials_exist, "talent_exists": talent_exists, "product_metrics": product_metrics, "unit_economics_metrics": unit_economics_metrics, "benchmarks_user_types": benchmarks_user_types, "benchmark_categories": benchmark_categories } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
23 24 25 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 23 def additional_properties @additional_properties end |
#benchmark_categories ⇒ Array<String> (readonly)
Returns List of categories applied to the company associated with this deal.
21 22 23 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 21 def benchmark_categories @benchmark_categories end |
#benchmarks_user_types ⇒ Array<String> (readonly)
Returns List of user types with benchmarks available for this deal.
19 20 21 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 19 def benchmarks_user_types @benchmarks_user_types end |
#financials_exist ⇒ Boolean (readonly)
Returns Financials data has been processed for this deal.
11 12 13 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 11 def financials_exist @financials_exist end |
#product_metrics ⇒ Array<NewDemoApiClient::ProductInfoResponse> (readonly)
Returns List of which product metrics are available for this deal.
15 16 17 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 15 def product_metrics @product_metrics end |
#talent_exists ⇒ Boolean (readonly)
Returns Talent data has been processed for this deal.
13 14 15 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 13 def talent_exists @talent_exists end |
#unit_economics_metrics ⇒ Array<NewDemoApiClient::UnitEconomicsInfoResponse> (readonly)
Returns List of which user types with unit economics metrics are available for this deal.
17 18 19 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 17 def unit_economics_metrics @unit_economics_metrics end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::DealDataAvailablityResponse
Deserialize a JSON object to an instance of DealDataAvailablityResponse
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 61 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) financials_exist = parsed_json["financials_exist"] talent_exists = parsed_json["talent_exists"] product_metrics = parsed_json["product_metrics"]&.map do |item| item = item.to_json NewDemoApiClient::ProductInfoResponse.from_json(json_object: item) end unit_economics_metrics = parsed_json["unit_economics_metrics"]&.map do |item| item = item.to_json NewDemoApiClient::UnitEconomicsInfoResponse.from_json(json_object: item) end benchmarks_user_types = parsed_json["benchmarks_user_types"] benchmark_categories = parsed_json["benchmark_categories"] new( financials_exist: financials_exist, talent_exists: talent_exists, product_metrics: product_metrics, unit_economics_metrics: unit_economics_metrics, benchmarks_user_types: benchmarks_user_types, benchmark_categories: benchmark_categories, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
100 101 102 103 104 105 106 107 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 100 def self.validate_raw(obj:) obj.financials_exist.is_a?(Boolean) != false || raise("Passed value for field obj.financials_exist is not the expected type, validation failed.") obj.talent_exists.is_a?(Boolean) != false || raise("Passed value for field obj.talent_exists is not the expected type, validation failed.") obj.product_metrics.is_a?(Array) != false || raise("Passed value for field obj.product_metrics is not the expected type, validation failed.") obj.unit_economics_metrics.is_a?(Array) != false || raise("Passed value for field obj.unit_economics_metrics is not the expected type, validation failed.") obj.benchmarks_user_types.is_a?(Array) != false || raise("Passed value for field obj.benchmarks_user_types is not the expected type, validation failed.") obj.benchmark_categories.is_a?(Array) != false || raise("Passed value for field obj.benchmark_categories is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of DealDataAvailablityResponse to a JSON object
90 91 92 |
# File 'lib/test_sdk/types/deal_data_availablity_response.rb', line 90 def to_json(*_args) @_field_set&.to_json end |