Class: Vellum::DeploymentProviderPayloadResponse
- Inherits:
-
Object
- Object
- Vellum::DeploymentProviderPayloadResponse
- Defined in:
- lib/vellum_ai/types/deployment_provider_payload_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #meta ⇒ Vellum::CompilePromptMeta readonly
- #payload ⇒ Vellum::DeploymentProviderPayloadResponsePayload readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(payload:, meta: OMIT, additional_properties: nil) ⇒ Vellum::DeploymentProviderPayloadResponse constructor
- #to_json ⇒ String
Constructor Details
#initialize(payload:, meta: OMIT, additional_properties: nil) ⇒ Vellum::DeploymentProviderPayloadResponse
25 26 27 28 29 30 31 32 |
# File 'lib/vellum_ai/types/deployment_provider_payload_response.rb', line 25 def initialize(payload:, meta: OMIT, additional_properties: nil) @payload = payload = if != OMIT @additional_properties = additional_properties @_field_set = { "payload": payload, "meta": }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/vellum_ai/types/deployment_provider_payload_response.rb', line 14 def additional_properties @additional_properties end |
#meta ⇒ Vellum::CompilePromptMeta (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/deployment_provider_payload_response.rb', line 12 def end |
#payload ⇒ Vellum::DeploymentProviderPayloadResponsePayload (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/deployment_provider_payload_response.rb', line 10 def payload @payload end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::DeploymentProviderPayloadResponse
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/vellum_ai/types/deployment_provider_payload_response.rb', line 37 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["payload"].nil? payload = parsed_json["payload"].to_json payload = Vellum::DeploymentProviderPayloadResponsePayload.from_json(json_object: payload) else payload = nil end unless parsed_json["meta"].nil? = parsed_json["meta"].to_json = Vellum::CompilePromptMeta.from_json(json_object: ) else = nil end new( payload: payload, meta: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
70 71 72 73 |
# File 'lib/vellum_ai/types/deployment_provider_payload_response.rb', line 70 def self.validate_raw(obj:) Vellum::DeploymentProviderPayloadResponsePayload.validate_raw(obj: obj.payload) obj..nil? || Vellum::CompilePromptMeta.validate_raw(obj: obj.) end |
Instance Method Details
#to_json ⇒ String
61 62 63 |
# File 'lib/vellum_ai/types/deployment_provider_payload_response.rb', line 61 def to_json @_field_set&.to_json end |