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
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(brand:, additional_properties: nil) ⇒ Pinnacle::UpdateCompanyResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UpdateCompanyResponse to a JSON object.
Constructor Details
#initialize(brand:, additional_properties: nil) ⇒ Pinnacle::UpdateCompanyResponse
22 23 24 25 26 |
# File 'lib/rcs/types/update_company_response.rb', line 22 def initialize(brand:, additional_properties: nil) @brand = brand @additional_properties = additional_properties @_field_set = { "brand": brand } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
12 13 14 |
# File 'lib/rcs/types/update_company_response.rb', line 12 def additional_properties @additional_properties end |
#brand ⇒ Pinnacle::UpdateCompanyResponseBrand (readonly)
10 11 12 |
# File 'lib/rcs/types/update_company_response.rb', line 10 def brand @brand end |
Class Method Details
.from_json(json_object:) ⇒ Pinnacle::UpdateCompanyResponse
Deserialize a JSON object to an instance of UpdateCompanyResponse
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rcs/types/update_company_response.rb', line 32 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["brand"].nil? brand = nil else brand = parsed_json["brand"].to_json brand = Pinnacle::UpdateCompanyResponseBrand.from_json(json_object: brand) end new(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.
57 58 59 |
# File 'lib/rcs/types/update_company_response.rb', line 57 def self.validate_raw(obj:) Pinnacle::UpdateCompanyResponseBrand.validate_raw(obj: obj.brand) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of UpdateCompanyResponse to a JSON object
47 48 49 |
# File 'lib/rcs/types/update_company_response.rb', line 47 def to_json(*_args) @_field_set&.to_json end |