Class: NewDemoApiClient::AllDataMetadataResponse
- Inherits:
-
Object
- Object
- NewDemoApiClient::AllDataMetadataResponse
- Defined in:
- lib/test_sdk/types/all_data_metadata_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #data_point_count ⇒ Integer readonly
- #data_point_count_last30days ⇒ Integer readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::AllDataMetadataResponse
Deserialize a JSON object to an instance of AllDataMetadataResponse.
-
.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(data_point_count:, data_point_count_last30days:, additional_properties: nil) ⇒ NewDemoApiClient::AllDataMetadataResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AllDataMetadataResponse to a JSON object.
Constructor Details
#initialize(data_point_count:, data_point_count_last30days:, additional_properties: nil) ⇒ NewDemoApiClient::AllDataMetadataResponse
24 25 26 27 28 29 30 31 32 |
# File 'lib/test_sdk/types/all_data_metadata_response.rb', line 24 def initialize(data_point_count:, data_point_count_last30days:, additional_properties: nil) @data_point_count = data_point_count @data_point_count_last30days = data_point_count_last30days @additional_properties = additional_properties @_field_set = { "data_point_count": data_point_count, "data_point_count_last_30_days": data_point_count_last30days } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
13 14 15 |
# File 'lib/test_sdk/types/all_data_metadata_response.rb', line 13 def additional_properties @additional_properties end |
#data_point_count ⇒ Integer (readonly)
9 10 11 |
# File 'lib/test_sdk/types/all_data_metadata_response.rb', line 9 def data_point_count @data_point_count end |
#data_point_count_last30days ⇒ Integer (readonly)
11 12 13 |
# File 'lib/test_sdk/types/all_data_metadata_response.rb', line 11 def data_point_count_last30days @data_point_count_last30days end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::AllDataMetadataResponse
Deserialize a JSON object to an instance of AllDataMetadataResponse
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/test_sdk/types/all_data_metadata_response.rb', line 38 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) data_point_count = parsed_json["data_point_count"] data_point_count_last30days = parsed_json["data_point_count_last_30_days"] new( data_point_count: data_point_count, data_point_count_last30days: data_point_count_last30days, 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.
63 64 65 66 |
# File 'lib/test_sdk/types/all_data_metadata_response.rb', line 63 def self.validate_raw(obj:) obj.data_point_count.is_a?(Integer) != false || raise("Passed value for field obj.data_point_count is not the expected type, validation failed.") obj.data_point_count_last30days.is_a?(Integer) != false || raise("Passed value for field obj.data_point_count_last30days is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AllDataMetadataResponse to a JSON object
53 54 55 |
# File 'lib/test_sdk/types/all_data_metadata_response.rb', line 53 def to_json(*_args) @_field_set&.to_json end |