Class: Paid::OrderLineCreate
- Inherits:
-
Object
- Object
- Paid::OrderLineCreate
- Defined in:
- lib/paid_ruby/types/order_line_create.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #agent_external_id ⇒ String readonly
- #agent_id ⇒ String readonly
- #description ⇒ String readonly
- #name ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(agent_id: OMIT, agent_external_id: OMIT, name: OMIT, description: OMIT, additional_properties: nil) ⇒ Paid::OrderLineCreate constructor
- #to_json ⇒ String
Constructor Details
#initialize(agent_id: OMIT, agent_external_id: OMIT, name: OMIT, description: OMIT, additional_properties: nil) ⇒ Paid::OrderLineCreate
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/paid_ruby/types/order_line_create.rb', line 29 def initialize(agent_id: OMIT, agent_external_id: OMIT, name: OMIT, description: OMIT, additional_properties: nil) @agent_id = agent_id if agent_id != OMIT @agent_external_id = agent_external_id if agent_external_id != OMIT @name = name if name != OMIT @description = description if description != OMIT @additional_properties = additional_properties @_field_set = { "agentId": agent_id, "agentExternalId": agent_external_id, "name": name, "description": description }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/paid_ruby/types/order_line_create.rb', line 16 def additional_properties @additional_properties end |
#agent_external_id ⇒ String (readonly)
10 11 12 |
# File 'lib/paid_ruby/types/order_line_create.rb', line 10 def agent_external_id @agent_external_id end |
#agent_id ⇒ String (readonly)
8 9 10 |
# File 'lib/paid_ruby/types/order_line_create.rb', line 8 def agent_id @agent_id end |
#description ⇒ String (readonly)
14 15 16 |
# File 'lib/paid_ruby/types/order_line_create.rb', line 14 def description @description end |
#name ⇒ String (readonly)
12 13 14 |
# File 'lib/paid_ruby/types/order_line_create.rb', line 12 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Paid::OrderLineCreate
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/paid_ruby/types/order_line_create.rb', line 43 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) agent_id = parsed_json["agentId"] agent_external_id = parsed_json["agentExternalId"] name = parsed_json["name"] description = parsed_json["description"] new( agent_id: agent_id, agent_external_id: agent_external_id, name: name, description: description, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
70 71 72 73 74 75 |
# File 'lib/paid_ruby/types/order_line_create.rb', line 70 def self.validate_raw(obj:) obj.agent_id&.is_a?(String) != false || raise("Passed value for field obj.agent_id is not the expected type, validation failed.") obj.agent_external_id&.is_a?(String) != false || raise("Passed value for field obj.agent_external_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.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
61 62 63 |
# File 'lib/paid_ruby/types/order_line_create.rb', line 61 def to_json @_field_set&.to_json end |