Class: Paid::AgentUpdate
- Inherits:
-
Object
- Object
- Paid::AgentUpdate
- Defined in:
- lib/paid_ruby/types/agent_update.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #active ⇒ Boolean readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #agent_attributes ⇒ Array<Paid::AgentAttribute> readonly
- #agent_code ⇒ String readonly
- #description ⇒ String readonly
- #external_id ⇒ String readonly
- #name ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(name: OMIT, description: OMIT, external_id: OMIT, active: OMIT, agent_code: OMIT, agent_attributes: OMIT, additional_properties: nil) ⇒ Paid::AgentUpdate constructor
- #to_json ⇒ String
Constructor Details
#initialize(name: OMIT, description: OMIT, external_id: OMIT, active: OMIT, agent_code: OMIT, agent_attributes: OMIT, additional_properties: nil) ⇒ Paid::AgentUpdate
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/paid_ruby/types/agent_update.rb', line 36 def initialize(name: OMIT, description: OMIT, external_id: OMIT, active: OMIT, agent_code: OMIT, agent_attributes: OMIT, additional_properties: nil) @name = name if name != OMIT @description = description if description != OMIT @external_id = external_id if external_id != OMIT @active = active if active != OMIT @agent_code = agent_code if agent_code != OMIT @agent_attributes = agent_attributes if agent_attributes != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "description": description, "externalId": external_id, "active": active, "agentCode": agent_code, "agentAttributes": agent_attributes }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#active ⇒ Boolean (readonly)
15 16 17 |
# File 'lib/paid_ruby/types/agent_update.rb', line 15 def active @active end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/paid_ruby/types/agent_update.rb', line 21 def additional_properties @additional_properties end |
#agent_attributes ⇒ Array<Paid::AgentAttribute> (readonly)
19 20 21 |
# File 'lib/paid_ruby/types/agent_update.rb', line 19 def agent_attributes @agent_attributes end |
#agent_code ⇒ String (readonly)
17 18 19 |
# File 'lib/paid_ruby/types/agent_update.rb', line 17 def agent_code @agent_code end |
#description ⇒ String (readonly)
11 12 13 |
# File 'lib/paid_ruby/types/agent_update.rb', line 11 def description @description end |
#external_id ⇒ String (readonly)
13 14 15 |
# File 'lib/paid_ruby/types/agent_update.rb', line 13 def external_id @external_id end |
#name ⇒ String (readonly)
9 10 11 |
# File 'lib/paid_ruby/types/agent_update.rb', line 9 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Paid::AgentUpdate
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/paid_ruby/types/agent_update.rb', line 52 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] description = parsed_json["description"] external_id = parsed_json["externalId"] active = parsed_json["active"] agent_code = parsed_json["agentCode"] agent_attributes = parsed_json["agentAttributes"]&.map do | item | item = item.to_json Paid::AgentAttribute.from_json(json_object: item) end new( name: name, description: description, external_id: external_id, active: active, agent_code: agent_code, agent_attributes: agent_attributes, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
86 87 88 89 90 91 92 93 |
# File 'lib/paid_ruby/types/agent_update.rb', line 86 def self.validate_raw(obj:) 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.") obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.") obj.active&.is_a?(Boolean) != false || raise("Passed value for field obj.active is not the expected type, validation failed.") obj.agent_code&.is_a?(String) != false || raise("Passed value for field obj.agent_code is not the expected type, validation failed.") obj.agent_attributes&.is_a?(Array) != false || raise("Passed value for field obj.agent_attributes is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
77 78 79 |
# File 'lib/paid_ruby/types/agent_update.rb', line 77 def to_json @_field_set&.to_json end |