Class: Pinnacle::PointOfContact
- Inherits:
-
Object
- Object
- Pinnacle::PointOfContact
- Defined in:
- lib/rcs/types/point_of_contact.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#poc_email ⇒ String
readonly
Point of contact’s email address.
-
#poc_name ⇒ String
readonly
Point of contact’s name.
-
#poc_title ⇒ String
readonly
Point of contact’s title.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Pinnacle::PointOfContact
Deserialize a JSON object to an instance of PointOfContact.
-
.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(poc_name:, poc_title:, poc_email:, additional_properties: nil) ⇒ Pinnacle::PointOfContact constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of PointOfContact to a JSON object.
Constructor Details
#initialize(poc_name:, poc_title:, poc_email:, additional_properties: nil) ⇒ Pinnacle::PointOfContact
27 28 29 30 31 32 33 |
# File 'lib/rcs/types/point_of_contact.rb', line 27 def initialize(poc_name:, poc_title:, poc_email:, additional_properties: nil) @poc_name = poc_name @poc_title = poc_title @poc_email = poc_email @additional_properties = additional_properties @_field_set = { "pocName": poc_name, "pocTitle": poc_title, "pocEmail": poc_email } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/rcs/types/point_of_contact.rb', line 15 def additional_properties @additional_properties end |
#poc_email ⇒ String (readonly)
Returns Point of contact’s email address.
13 14 15 |
# File 'lib/rcs/types/point_of_contact.rb', line 13 def poc_email @poc_email end |
#poc_name ⇒ String (readonly)
Returns Point of contact’s name.
9 10 11 |
# File 'lib/rcs/types/point_of_contact.rb', line 9 def poc_name @poc_name end |
#poc_title ⇒ String (readonly)
Returns Point of contact’s title.
11 12 13 |
# File 'lib/rcs/types/point_of_contact.rb', line 11 def poc_title @poc_title end |
Class Method Details
.from_json(json_object:) ⇒ Pinnacle::PointOfContact
Deserialize a JSON object to an instance of PointOfContact
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/rcs/types/point_of_contact.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) poc_name = parsed_json["pocName"] poc_title = parsed_json["pocTitle"] poc_email = parsed_json["pocEmail"] new( poc_name: poc_name, poc_title: poc_title, poc_email: poc_email, 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.
66 67 68 69 70 |
# File 'lib/rcs/types/point_of_contact.rb', line 66 def self.validate_raw(obj:) obj.poc_name.is_a?(String) != false || raise("Passed value for field obj.poc_name is not the expected type, validation failed.") obj.poc_title.is_a?(String) != false || raise("Passed value for field obj.poc_title is not the expected type, validation failed.") obj.poc_email.is_a?(String) != false || raise("Passed value for field obj.poc_email is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of PointOfContact to a JSON object
56 57 58 |
# File 'lib/rcs/types/point_of_contact.rb', line 56 def to_json(*_args) @_field_set&.to_json end |