Class: Pinnacle::UpdateCompanyResponse
- Inherits:
-
Object
- Object
- Pinnacle::UpdateCompanyResponse
- Defined in:
- lib/rcs/types/update_company_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #brand ⇒ Pinnacle::UpdateCompanyResponseBrand readonly
- #success ⇒ Boolean readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Pinnacle::UpdateCompanyResponse
Deserialize a JSON object to an instance of UpdateCompanyResponse.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(success: OMIT, brand: OMIT, additional_properties: nil) ⇒ Pinnacle::UpdateCompanyResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UpdateCompanyResponse to a JSON object.
Constructor Details
#initialize(success: OMIT, brand: OMIT, additional_properties: nil) ⇒ Pinnacle::UpdateCompanyResponse
25 26 27 28 29 30 31 32 |
# File 'lib/rcs/types/update_company_response.rb', line 25 def initialize(success: OMIT, brand: OMIT, additional_properties: nil) @success = success if success != OMIT @brand = brand if brand != OMIT @additional_properties = additional_properties @_field_set = { "success": success, "brand": brand }.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/rcs/types/update_company_response.rb', line 14 def additional_properties @additional_properties end |
#brand ⇒ Pinnacle::UpdateCompanyResponseBrand (readonly)
12 13 14 |
# File 'lib/rcs/types/update_company_response.rb', line 12 def brand @brand end |
#success ⇒ Boolean (readonly)
10 11 12 |
# File 'lib/rcs/types/update_company_response.rb', line 10 def success @success end |
Class Method Details
.from_json(json_object:) ⇒ Pinnacle::UpdateCompanyResponse
Deserialize a JSON object to an instance of UpdateCompanyResponse
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/rcs/types/update_company_response.rb', line 38 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) success = parsed_json["success"] if parsed_json["brand"].nil? brand = nil else brand = parsed_json["brand"].to_json brand = Pinnacle::UpdateCompanyResponseBrand.from_json(json_object: brand) end new( success: success, brand: brand, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
68 69 70 71 |
# File 'lib/rcs/types/update_company_response.rb', line 68 def self.validate_raw(obj:) obj.success&.is_a?(Boolean) != false || raise("Passed value for field obj.success is not the expected type, validation failed.") obj.brand.nil? || Pinnacle::UpdateCompanyResponseBrand.validate_raw(obj: obj.brand) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of UpdateCompanyResponse to a JSON object
58 59 60 |
# File 'lib/rcs/types/update_company_response.rb', line 58 def to_json(*_args) @_field_set&.to_json end |