Class: Vellum::ReleaseTagRelease
- Inherits:
-
Object
- Object
- Vellum::ReleaseTagRelease
- Defined in:
- lib/vellum_ai/types/release_tag_release.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #id ⇒ String readonly
- #timestamp ⇒ DateTime readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, timestamp:, additional_properties: nil) ⇒ Vellum::ReleaseTagRelease constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, timestamp:, additional_properties: nil) ⇒ Vellum::ReleaseTagRelease
24 25 26 27 28 29 |
# File 'lib/vellum_ai/types/release_tag_release.rb', line 24 def initialize(id:, timestamp:, additional_properties: nil) @id = id @timestamp = @additional_properties = additional_properties @_field_set = { "id": id, "timestamp": } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
13 14 15 |
# File 'lib/vellum_ai/types/release_tag_release.rb', line 13 def additional_properties @additional_properties end |
#id ⇒ String (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/release_tag_release.rb', line 9 def id @id end |
#timestamp ⇒ DateTime (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/release_tag_release.rb', line 11 def @timestamp end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::ReleaseTagRelease
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/vellum_ai/types/release_tag_release.rb', line 34 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] = unless parsed_json["timestamp"].nil? DateTime.parse(parsed_json["timestamp"]) else nil end new( id: id, timestamp: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
61 62 63 64 |
# File 'lib/vellum_ai/types/release_tag_release.rb', line 61 def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj..is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
52 53 54 |
# File 'lib/vellum_ai/types/release_tag_release.rb', line 52 def to_json @_field_set&.to_json end |