Class: Vellum::SlimIntegrationRead
- Inherits:
-
Object
- Object
- Vellum::SlimIntegrationRead
- Defined in:
- lib/vellum_ai/types/slim_integration_read.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #icon_url ⇒ String readonly
- #id ⇒ String readonly
- #label ⇒ String readonly
- #name ⇒ Vellum::IntegrationName readonly
- #provider ⇒ Vellum::INTEGRATION_PROVIDER readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, label: OMIT, icon_url:, name:, provider:, additional_properties: nil) ⇒ Vellum::SlimIntegrationRead constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, label: OMIT, icon_url:, name:, provider:, additional_properties: nil) ⇒ Vellum::SlimIntegrationRead
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/vellum_ai/types/slim_integration_read.rb', line 34 def initialize(id:, label: OMIT, icon_url:, name:, provider:, additional_properties: nil) @id = id @label = label if label != OMIT @icon_url = icon_url @name = name @provider = provider @additional_properties = additional_properties @_field_set = { "id": id, "label": label, "icon_url": icon_url, "name": name, "provider": provider }.reject do | _k, v | v == OMIT end 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/slim_integration_read.rb', line 20 def additional_properties @additional_properties end |
#icon_url ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/slim_integration_read.rb', line 14 def icon_url @icon_url end |
#id ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/slim_integration_read.rb', line 10 def id @id end |
#label ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/slim_integration_read.rb', line 12 def label @label end |
#name ⇒ Vellum::IntegrationName (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/slim_integration_read.rb', line 16 def name @name end |
#provider ⇒ Vellum::INTEGRATION_PROVIDER (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/slim_integration_read.rb', line 18 def provider @provider end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::SlimIntegrationRead
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/vellum_ai/types/slim_integration_read.rb', line 49 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] label = parsed_json["label"] icon_url = parsed_json["icon_url"] name = parsed_json["name"] provider = parsed_json["provider"] new( id: id, label: label, icon_url: icon_url, name: name, provider: provider, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
78 79 80 81 82 83 84 |
# File 'lib/vellum_ai/types/slim_integration_read.rb', line 78 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.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") obj.icon_url.is_a?(String) != false || raise("Passed value for field obj.icon_url is not the expected type, validation failed.") obj.name.is_a?(Vellum::IntegrationName) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
69 70 71 |
# File 'lib/vellum_ai/types/slim_integration_read.rb', line 69 def to_json @_field_set&.to_json end |