Class: Pinnacle::RcsFunctionalities
- Inherits:
-
Object
- Object
- Pinnacle::RcsFunctionalities
- Defined in:
- lib/rcs/types/rcs_functionalities.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#carousel_rich_card ⇒ Boolean
readonly
Indicates if carousel rich cards are supported.
-
#create_calendar_event_action ⇒ Boolean
readonly
Indicates if buttons to create a calendar event are supported.
-
#dial_action ⇒ Boolean
readonly
Indicates if dial buttons are supported.
-
#is_enabled ⇒ Boolean
readonly
Indicates if RCS is enabled.
-
#open_url_action ⇒ Boolean
readonly
Indicates if open URL buttons are supported.
-
#share_location_action ⇒ Boolean
readonly
Indicates if share location buttons are supported.
-
#standalone_rich_card ⇒ Boolean
readonly
Indicates if standalone rich cards are supported.
-
#view_location_action ⇒ Boolean
readonly
Indicates if view location buttons are supported.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Pinnacle::RcsFunctionalities
Deserialize a JSON object to an instance of RcsFunctionalities.
-
.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(is_enabled:, standalone_rich_card:, carousel_rich_card:, create_calendar_event_action:, dial_action:, open_url_action:, share_location_action:, view_location_action:, additional_properties: nil) ⇒ Pinnacle::RcsFunctionalities constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of RcsFunctionalities to a JSON object.
Constructor Details
#initialize(is_enabled:, standalone_rich_card:, carousel_rich_card:, create_calendar_event_action:, dial_action:, open_url_action:, share_location_action:, view_location_action:, additional_properties: nil) ⇒ Pinnacle::RcsFunctionalities
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 42 def initialize(is_enabled:, standalone_rich_card:, carousel_rich_card:, create_calendar_event_action:, dial_action:, open_url_action:, share_location_action:, view_location_action:, additional_properties: nil) @is_enabled = is_enabled @standalone_rich_card = standalone_rich_card @carousel_rich_card = carousel_rich_card @create_calendar_event_action = create_calendar_event_action @dial_action = dial_action @open_url_action = open_url_action @share_location_action = share_location_action @view_location_action = view_location_action @additional_properties = additional_properties @_field_set = { "is_enabled": is_enabled, "standalone_rich_card": standalone_rich_card, "carousel_rich_card": carousel_rich_card, "create_calendar_event_action": create_calendar_event_action, "dial_action": dial_action, "open_url_action": open_url_action, "share_location_action": share_location_action, "view_location_action": view_location_action } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
25 26 27 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 25 def additional_properties @additional_properties end |
#carousel_rich_card ⇒ Boolean (readonly)
Returns Indicates if carousel rich cards are supported.
13 14 15 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 13 def carousel_rich_card @carousel_rich_card end |
#create_calendar_event_action ⇒ Boolean (readonly)
Returns Indicates if buttons to create a calendar event are supported.
15 16 17 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 15 def create_calendar_event_action @create_calendar_event_action end |
#dial_action ⇒ Boolean (readonly)
Returns Indicates if dial buttons are supported.
17 18 19 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 17 def dial_action @dial_action end |
#is_enabled ⇒ Boolean (readonly)
Returns Indicates if RCS is enabled.
9 10 11 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 9 def is_enabled @is_enabled end |
#open_url_action ⇒ Boolean (readonly)
Returns Indicates if open URL buttons are supported.
19 20 21 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 19 def open_url_action @open_url_action end |
#share_location_action ⇒ Boolean (readonly)
Returns Indicates if share location buttons are supported.
21 22 23 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 21 def share_location_action @share_location_action end |
#standalone_rich_card ⇒ Boolean (readonly)
Returns Indicates if standalone rich cards are supported.
11 12 13 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 11 def standalone_rich_card @standalone_rich_card end |
#view_location_action ⇒ Boolean (readonly)
Returns Indicates if view location buttons are supported.
23 24 25 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 23 def view_location_action @view_location_action end |
Class Method Details
.from_json(json_object:) ⇒ Pinnacle::RcsFunctionalities
Deserialize a JSON object to an instance of RcsFunctionalities
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 69 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) is_enabled = parsed_json["is_enabled"] standalone_rich_card = parsed_json["standalone_rich_card"] carousel_rich_card = parsed_json["carousel_rich_card"] create_calendar_event_action = parsed_json["create_calendar_event_action"] dial_action = parsed_json["dial_action"] open_url_action = parsed_json["open_url_action"] share_location_action = parsed_json["share_location_action"] view_location_action = parsed_json["view_location_action"] new( is_enabled: is_enabled, standalone_rich_card: standalone_rich_card, carousel_rich_card: carousel_rich_card, create_calendar_event_action: create_calendar_event_action, dial_action: dial_action, open_url_action: open_url_action, share_location_action: share_location_action, view_location_action: view_location_action, 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.
106 107 108 109 110 111 112 113 114 115 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 106 def self.validate_raw(obj:) obj.is_enabled.is_a?(Boolean) != false || raise("Passed value for field obj.is_enabled is not the expected type, validation failed.") obj.standalone_rich_card.is_a?(Boolean) != false || raise("Passed value for field obj.standalone_rich_card is not the expected type, validation failed.") obj.carousel_rich_card.is_a?(Boolean) != false || raise("Passed value for field obj.carousel_rich_card is not the expected type, validation failed.") obj.create_calendar_event_action.is_a?(Boolean) != false || raise("Passed value for field obj.create_calendar_event_action is not the expected type, validation failed.") obj.dial_action.is_a?(Boolean) != false || raise("Passed value for field obj.dial_action is not the expected type, validation failed.") obj.open_url_action.is_a?(Boolean) != false || raise("Passed value for field obj.open_url_action is not the expected type, validation failed.") obj.share_location_action.is_a?(Boolean) != false || raise("Passed value for field obj.share_location_action is not the expected type, validation failed.") obj.view_location_action.is_a?(Boolean) != false || raise("Passed value for field obj.view_location_action is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of RcsFunctionalities to a JSON object
96 97 98 |
# File 'lib/rcs/types/rcs_functionalities.rb', line 96 def to_json(*_args) @_field_set&.to_json end |