Class: NewDemoApiClient::AllDataMetadataResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/test_sdk/types/all_data_metadata_response.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_point_count:, data_point_count_last30days:, additional_properties: nil) ⇒ NewDemoApiClient::AllDataMetadataResponse

Parameters:

  • data_point_count (Integer)
  • data_point_count_last30days (Integer)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_countInteger (readonly)

Returns:

  • (Integer)


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_last30daysInteger (readonly)

Returns:

  • (Integer)


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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


53
54
55
# File 'lib/test_sdk/types/all_data_metadata_response.rb', line 53

def to_json(*_args)
  @_field_set&.to_json
end