Class: Vellum::WorkspaceSecretRead
- Inherits:
-
Object
- Object
- Vellum::WorkspaceSecretRead
- Defined in:
- lib/vellum_ai/types/workspace_secret_read.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
- #label ⇒ String readonly
- #modified ⇒ DateTime readonly
- #name ⇒ String readonly
- #secret_type ⇒ Vellum::SecretTypeEnum readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, modified:, name:, label:, secret_type:, additional_properties: nil) ⇒ Vellum::WorkspaceSecretRead constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, modified:, name:, label:, secret_type:, additional_properties: nil) ⇒ Vellum::WorkspaceSecretRead
34 35 36 37 38 39 40 41 42 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 34 def initialize(id:, modified:, name:, label:, secret_type:, additional_properties: nil) @id = id @modified = modified @name = name @label = label @secret_type = secret_type @additional_properties = additional_properties @_field_set = { "id": id, "modified": modified, "name": name, "label": label, "secret_type": secret_type } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 20 def additional_properties @additional_properties end |
#id ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 10 def id @id end |
#label ⇒ String (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 16 def label @label end |
#modified ⇒ DateTime (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 12 def modified @modified end |
#name ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 14 def name @name end |
#secret_type ⇒ Vellum::SecretTypeEnum (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 18 def secret_type @secret_type end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkspaceSecretRead
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 47 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] modified = unless parsed_json["modified"].nil? DateTime.parse(parsed_json["modified"]) else nil end name = parsed_json["name"] label = parsed_json["label"] secret_type = parsed_json["secret_type"] new( id: id, modified: modified, name: name, label: label, secret_type: secret_type, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
80 81 82 83 84 85 86 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 80 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.modified.is_a?(DateTime) != false || raise("Passed value for field obj.modified 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.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") obj.secret_type.is_a?(Vellum::SecretTypeEnum) != false || raise("Passed value for field obj.secret_type is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
71 72 73 |
# File 'lib/vellum_ai/types/workspace_secret_read.rb', line 71 def to_json @_field_set&.to_json end |