Class: Vellum::ContainerImageRead
- Inherits:
-
Object
- Object
- Vellum::ContainerImageRead
- Defined in:
- lib/vellum_ai/types/container_image_read.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #build_config ⇒ Vellum::ContainerImageBuildConfig readonly
- #build_status ⇒ Vellum::BuildStatusEnum readonly
- #created ⇒ DateTime readonly
- #id ⇒ String readonly
- #modified ⇒ DateTime readonly
- #name ⇒ String readonly
- #repository ⇒ String readonly
- #sha ⇒ String readonly
- #tags ⇒ Array<Vellum::ContainerImageContainerImageTag> readonly
- #visibility ⇒ Vellum::EntityVisibility readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, name:, visibility:, created:, modified:, repository:, sha:, tags:, build_status: OMIT, build_config: OMIT, additional_properties: nil) ⇒ Vellum::ContainerImageRead constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, name:, visibility:, created:, modified:, repository:, sha:, tags:, build_status: OMIT, build_config: OMIT, additional_properties: nil) ⇒ Vellum::ContainerImageRead
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 53 def initialize(id:, name:, visibility:, created:, modified:, repository:, sha:, tags:, build_status: OMIT, build_config: OMIT, additional_properties: nil) @id = id @name = name @visibility = visibility @created = created @modified = modified @repository = repository @sha = sha @tags = @build_status = build_status if build_status != OMIT @build_config = build_config if build_config != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "name": name, "visibility": visibility, "created": created, "modified": modified, "repository": repository, "sha": sha, "tags": , "build_status": build_status, "build_config": build_config }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
34 35 36 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 34 def additional_properties @additional_properties end |
#build_config ⇒ Vellum::ContainerImageBuildConfig (readonly)
32 33 34 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 32 def build_config @build_config end |
#build_status ⇒ Vellum::BuildStatusEnum (readonly)
30 31 32 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 30 def build_status @build_status end |
#created ⇒ DateTime (readonly)
20 21 22 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 20 def created @created end |
#id ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 14 def id @id end |
#modified ⇒ DateTime (readonly)
22 23 24 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 22 def modified @modified end |
#name ⇒ String (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 16 def name @name end |
#repository ⇒ String (readonly)
24 25 26 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 24 def repository @repository end |
#sha ⇒ String (readonly)
26 27 28 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 26 def sha @sha end |
#tags ⇒ Array<Vellum::ContainerImageContainerImageTag> (readonly)
28 29 30 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 28 def @tags end |
#visibility ⇒ Vellum::EntityVisibility (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 18 def visibility @visibility end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::ContainerImageRead
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 73 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] name = parsed_json["name"] visibility = parsed_json["visibility"] created = unless parsed_json["created"].nil? DateTime.parse(parsed_json["created"]) else nil end modified = unless parsed_json["modified"].nil? DateTime.parse(parsed_json["modified"]) else nil end repository = parsed_json["repository"] sha = parsed_json["sha"] = parsed_json["tags"]&.map do | item | item = item.to_json Vellum::ContainerImageContainerImageTag.from_json(json_object: item) end build_status = parsed_json["build_status"] unless parsed_json["build_config"].nil? build_config = parsed_json["build_config"].to_json build_config = Vellum::ContainerImageBuildConfig.from_json(json_object: build_config) else build_config = nil end new( id: id, name: name, visibility: visibility, created: created, modified: modified, repository: repository, sha: sha, tags: , build_status: build_status, build_config: build_config, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 128 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.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.visibility.is_a?(Vellum::EntityVisibility) != false || raise("Passed value for field obj.visibility is not the expected type, validation failed.") obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.") obj.modified.is_a?(DateTime) != false || raise("Passed value for field obj.modified is not the expected type, validation failed.") obj.repository.is_a?(String) != false || raise("Passed value for field obj.repository is not the expected type, validation failed.") obj.sha.is_a?(String) != false || raise("Passed value for field obj.sha is not the expected type, validation failed.") obj..is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.") obj.build_status&.is_a?(Vellum::BuildStatusEnum) != false || raise("Passed value for field obj.build_status is not the expected type, validation failed.") obj.build_config.nil? || Vellum::ContainerImageBuildConfig.validate_raw(obj: obj.build_config) end |
Instance Method Details
#to_json ⇒ String
119 120 121 |
# File 'lib/vellum_ai/types/container_image_read.rb', line 119 def to_json @_field_set&.to_json end |