rcs 2.0.0.pre.rc.4 → 2.0.0.pre.rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ module Types
8
+ class ErrorResponse
9
+ # @return [String] Description of the error that occurred.
10
+ attr_reader :error
11
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
12
+ attr_reader :additional_properties
13
+ # @return [Object]
14
+ attr_reader :_field_set
15
+ protected :_field_set
16
+
17
+ OMIT = Object.new
18
+
19
+ # @param error [String] Description of the error that occurred.
20
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
+ # @return [Pinnacle::Types::ErrorResponse]
22
+ def initialize(error: OMIT, additional_properties: nil)
23
+ @error = error if error != OMIT
24
+ @additional_properties = additional_properties
25
+ @_field_set = { "error": error }.reject do |_k, v|
26
+ v == OMIT
27
+ end
28
+ end
29
+
30
+ # Deserialize a JSON object to an instance of ErrorResponse
31
+ #
32
+ # @param json_object [String]
33
+ # @return [Pinnacle::Types::ErrorResponse]
34
+ def self.from_json(json_object:)
35
+ struct = JSON.parse(json_object, object_class: OpenStruct)
36
+ parsed_json = JSON.parse(json_object)
37
+ error = parsed_json["error"]
38
+ new(error: error, additional_properties: struct)
39
+ end
40
+
41
+ # Serialize an instance of ErrorResponse to a JSON object
42
+ #
43
+ # @return [String]
44
+ def to_json(*_args)
45
+ @_field_set&.to_json
46
+ end
47
+
48
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
49
+ # hash and check each fields type against the current object's property
50
+ # definitions.
51
+ #
52
+ # @param obj [Object]
53
+ # @return [Void]
54
+ def self.validate_raw(obj:)
55
+ obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
56
+ end
57
+ end
58
+ end
59
+ end
@@ -6,7 +6,7 @@ require "json"
6
6
 
7
7
  module Pinnacle
8
8
  module Types
9
- # Status of toll free numbers that are being attached to this campaign. <br>
9
+ # Status of local long code numbers that are being attached to this campaign. <br>
10
10
  # Note that phone numbers can only be attached to `VERIFIED` campaigns via the
11
11
  # [attach campaign endpoint](../phone-numbers/attach-campaign).
12
12
  class GetDlcCampaignStatusResponseUpdates
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "date"
4
3
  require "ostruct"
5
4
  require "json"
6
5
 
@@ -8,7 +7,7 @@ module Pinnacle
8
7
  module Types
9
8
  # Define when and how your message should be sent.
10
9
  class MessageSchedule
11
- # @return [DateTime] Date and time when you want recurring messages to stop in ISO 8601 format.
10
+ # @return [String] Date and time when you want recurring messages to stop in ISO 8601 format.
12
11
  attr_reader :end_date
13
12
  # @return [String] Provide an AWS cron expression to control the when messages are sent. <br>
14
13
  # [Learn more about cron
@@ -26,7 +25,7 @@ module Pinnacle
26
25
 
27
26
  OMIT = Object.new
28
27
 
29
- # @param end_date [DateTime] Date and time when you want recurring messages to stop in ISO 8601 format.
28
+ # @param end_date [String] Date and time when you want recurring messages to stop in ISO 8601 format.
30
29
  # @param recurrence [String] Provide an AWS cron expression to control the when messages are sent. <br>
31
30
  # [Learn more about cron
32
31
  # ocs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html).
@@ -57,7 +56,7 @@ module Pinnacle
57
56
  def self.from_json(json_object:)
58
57
  struct = JSON.parse(json_object, object_class: OpenStruct)
59
58
  parsed_json = JSON.parse(json_object)
60
- end_date = (DateTime.parse(parsed_json["endDate"]) unless parsed_json["endDate"].nil?)
59
+ end_date = parsed_json["endDate"]
61
60
  recurrence = parsed_json["recurrence"]
62
61
  send_at = parsed_json["sendAt"]
63
62
  timezone = parsed_json["timezone"]
@@ -84,7 +83,7 @@ module Pinnacle
84
83
  # @param obj [Object]
85
84
  # @return [Void]
86
85
  def self.validate_raw(obj:)
87
- obj.end_date&.is_a?(DateTime) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.")
86
+ obj.end_date&.is_a?(String) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.")
88
87
  obj.recurrence&.is_a?(String) != false || raise("Passed value for field obj.recurrence is not the expected type, validation failed.")
89
88
  obj.send_at.is_a?(String) != false || raise("Passed value for field obj.send_at is not the expected type, validation failed.")
90
89
  obj.timezone.is_a?(String) != false || raise("Passed value for field obj.timezone is not the expected type, validation failed.")
@@ -22,9 +22,9 @@ module Pinnacle
22
22
  attr_reader :phones
23
23
  # @return [Array<Pinnacle::Types::RcsCampaignSchemaAgentWebsitesItem>] List of urls.
24
24
  attr_reader :websites
25
- # @return [String] Link to the agent's hero.
25
+ # @return [String] Link to the agent's hero. Hero must be an image file with dimensions 1440x448px.
26
26
  attr_reader :hero_url
27
- # @return [String] Link to the agent's icon.
27
+ # @return [String] Link to the agent's icon. Icon must be an image file with dimensions 224x224px.
28
28
  attr_reader :icon_url
29
29
  # @return [OpenStruct] Additional properties unmapped to the current class definition
30
30
  attr_reader :additional_properties
@@ -40,8 +40,8 @@ module Pinnacle
40
40
  # @param emails [Array<Pinnacle::Types::RcsCampaignSchemaAgentEmailsItem>] List of emails.
41
41
  # @param phones [Array<Pinnacle::Types::RcsCampaignSchemaAgentPhonesItem>] List of phone numbers.
42
42
  # @param websites [Array<Pinnacle::Types::RcsCampaignSchemaAgentWebsitesItem>] List of urls.
43
- # @param hero_url [String] Link to the agent's hero.
44
- # @param icon_url [String] Link to the agent's icon.
43
+ # @param hero_url [String] Link to the agent's hero. Hero must be an image file with dimensions 1440x448px.
44
+ # @param icon_url [String] Link to the agent's icon. Icon must be an image file with dimensions 224x224px.
45
45
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
46
46
  # @return [Pinnacle::Types::RcsCampaignSchemaAgent]
47
47
  def initialize(name: OMIT, description: OMIT, color: OMIT, emails: OMIT, phones: OMIT, websites: OMIT,
@@ -16,9 +16,9 @@ module Pinnacle
16
16
  attr_reader :description
17
17
  # @return [Array<Pinnacle::Types::RcsCampaignSchemaExtraAgentEmailsItem>] List of emails.
18
18
  attr_reader :emails
19
- # @return [String] Link to the agent's hero.
19
+ # @return [String] Link to the agent's hero. Hero must be an image file with dimensions 1440x448px.
20
20
  attr_reader :hero_url
21
- # @return [String] Link to the agent's icon.
21
+ # @return [String] Link to the agent's icon. Icon must be an image file with dimensions 224x224px.
22
22
  attr_reader :icon_url
23
23
  # @return [String] Name of the agent.
24
24
  attr_reader :name
@@ -37,8 +37,8 @@ module Pinnacle
37
37
  # @param color [String] Color of the agent's buttons.
38
38
  # @param description [String] Description of the agent.
39
39
  # @param emails [Array<Pinnacle::Types::RcsCampaignSchemaExtraAgentEmailsItem>] List of emails.
40
- # @param hero_url [String] Link to the agent's hero.
41
- # @param icon_url [String] Link to the agent's icon.
40
+ # @param hero_url [String] Link to the agent's hero. Hero must be an image file with dimensions 1440x448px.
41
+ # @param icon_url [String] Link to the agent's icon. Icon must be an image file with dimensions 224x224px.
42
42
  # @param name [String] Name of the agent.
43
43
  # @param phones [Array<Pinnacle::Types::RcsCampaignSchemaExtraAgentPhonesItem>] List of phone numbers.
44
44
  # @param websites [Array<Pinnacle::Types::RcsCampaignSchemaExtraAgentWebsitesItem>] List of urls.
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pinnacle
4
+ module Types
5
+ RCS_CAPABILITIES_RESULT = Hash
6
+ end
7
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "rcs_capability_cards"
4
+ require_relative "rcs_capability_actions"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Pinnacle
9
+ module Types
10
+ # RCS capabilities for a phone number
11
+ class RcsCapability
12
+ # @return [Pinnacle::Types::RcsCapabilityCards]
13
+ attr_reader :cards
14
+ # @return [Pinnacle::Types::RcsCapabilityActions] Supported button action types inside the rich cards or quick replies. Each key
15
+ # is a button action type that defines a specific button type in the Pinnacle API.
16
+ attr_reader :actions
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param cards [Pinnacle::Types::RcsCapabilityCards]
26
+ # @param actions [Pinnacle::Types::RcsCapabilityActions] Supported button action types inside the rich cards or quick replies. Each key
27
+ # is a button action type that defines a specific button type in the Pinnacle API.
28
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
+ # @return [Pinnacle::Types::RcsCapability]
30
+ def initialize(cards:, actions:, additional_properties: nil)
31
+ @cards = cards
32
+ @actions = actions
33
+ @additional_properties = additional_properties
34
+ @_field_set = { "cards": cards, "actions": actions }
35
+ end
36
+
37
+ # Deserialize a JSON object to an instance of RcsCapability
38
+ #
39
+ # @param json_object [String]
40
+ # @return [Pinnacle::Types::RcsCapability]
41
+ def self.from_json(json_object:)
42
+ struct = JSON.parse(json_object, object_class: OpenStruct)
43
+ parsed_json = JSON.parse(json_object)
44
+ if parsed_json["cards"].nil?
45
+ cards = nil
46
+ else
47
+ cards = parsed_json["cards"].to_json
48
+ cards = Pinnacle::Types::RcsCapabilityCards.from_json(json_object: cards)
49
+ end
50
+ if parsed_json["actions"].nil?
51
+ actions = nil
52
+ else
53
+ actions = parsed_json["actions"].to_json
54
+ actions = Pinnacle::Types::RcsCapabilityActions.from_json(json_object: actions)
55
+ end
56
+ new(
57
+ cards: cards,
58
+ actions: actions,
59
+ additional_properties: struct
60
+ )
61
+ end
62
+
63
+ # Serialize an instance of RcsCapability to a JSON object
64
+ #
65
+ # @return [String]
66
+ def to_json(*_args)
67
+ @_field_set&.to_json
68
+ end
69
+
70
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
71
+ # hash and check each fields type against the current object's property
72
+ # definitions.
73
+ #
74
+ # @param obj [Object]
75
+ # @return [Void]
76
+ def self.validate_raw(obj:)
77
+ Pinnacle::Types::RcsCapabilityCards.validate_raw(obj: obj.cards)
78
+ Pinnacle::Types::RcsCapabilityActions.validate_raw(obj: obj.actions)
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ module Types
8
+ # Supported button action types inside the rich cards or quick replies. Each key
9
+ # is a button action type that defines a specific button type in the Pinnacle API.
10
+ class RcsCapabilityActions
11
+ # @return [Boolean] Buttons that open URLs are supported
12
+ attr_reader :open_url
13
+ # @return [Boolean] Buttons that make phone calls are supported
14
+ attr_reader :call
15
+ # @return [Boolean] Buttons that trigger actions are supported
16
+ attr_reader :trigger
17
+ # @return [Boolean] Buttons that request user location are supported
18
+ attr_reader :request_user_location
19
+ # @return [Boolean] Buttons are supported
20
+ attr_reader :schedule_event
21
+ # @return [Boolean] Buttons that send location are supported
22
+ attr_reader :send_location
23
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
24
+ attr_reader :additional_properties
25
+ # @return [Object]
26
+ attr_reader :_field_set
27
+ protected :_field_set
28
+
29
+ OMIT = Object.new
30
+
31
+ # @param open_url [Boolean] Buttons that open URLs are supported
32
+ # @param call [Boolean] Buttons that make phone calls are supported
33
+ # @param trigger [Boolean] Buttons that trigger actions are supported
34
+ # @param request_user_location [Boolean] Buttons that request user location are supported
35
+ # @param schedule_event [Boolean] Buttons are supported
36
+ # @param send_location [Boolean] Buttons that send location are supported
37
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
38
+ # @return [Pinnacle::Types::RcsCapabilityActions]
39
+ def initialize(open_url:, call:, trigger:, request_user_location:, schedule_event:, send_location:,
40
+ additional_properties: nil)
41
+ @open_url = open_url
42
+ @call = call
43
+ @trigger = trigger
44
+ @request_user_location = request_user_location
45
+ @schedule_event = schedule_event
46
+ @send_location = send_location
47
+ @additional_properties = additional_properties
48
+ @_field_set = {
49
+ "openUrl": open_url,
50
+ "call": call,
51
+ "trigger": trigger,
52
+ "requestUserLocation": request_user_location,
53
+ "scheduleEvent": schedule_event,
54
+ "sendLocation": send_location
55
+ }
56
+ end
57
+
58
+ # Deserialize a JSON object to an instance of RcsCapabilityActions
59
+ #
60
+ # @param json_object [String]
61
+ # @return [Pinnacle::Types::RcsCapabilityActions]
62
+ def self.from_json(json_object:)
63
+ struct = JSON.parse(json_object, object_class: OpenStruct)
64
+ parsed_json = JSON.parse(json_object)
65
+ open_url = parsed_json["openUrl"]
66
+ call = parsed_json["call"]
67
+ trigger = parsed_json["trigger"]
68
+ request_user_location = parsed_json["requestUserLocation"]
69
+ schedule_event = parsed_json["scheduleEvent"]
70
+ send_location = parsed_json["sendLocation"]
71
+ new(
72
+ open_url: open_url,
73
+ call: call,
74
+ trigger: trigger,
75
+ request_user_location: request_user_location,
76
+ schedule_event: schedule_event,
77
+ send_location: send_location,
78
+ additional_properties: struct
79
+ )
80
+ end
81
+
82
+ # Serialize an instance of RcsCapabilityActions to a JSON object
83
+ #
84
+ # @return [String]
85
+ def to_json(*_args)
86
+ @_field_set&.to_json
87
+ end
88
+
89
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
90
+ # hash and check each fields type against the current object's property
91
+ # definitions.
92
+ #
93
+ # @param obj [Object]
94
+ # @return [Void]
95
+ def self.validate_raw(obj:)
96
+ obj.open_url.is_a?(Boolean) != false || raise("Passed value for field obj.open_url is not the expected type, validation failed.")
97
+ obj.call.is_a?(Boolean) != false || raise("Passed value for field obj.call is not the expected type, validation failed.")
98
+ obj.trigger.is_a?(Boolean) != false || raise("Passed value for field obj.trigger is not the expected type, validation failed.")
99
+ obj.request_user_location.is_a?(Boolean) != false || raise("Passed value for field obj.request_user_location is not the expected type, validation failed.")
100
+ obj.schedule_event.is_a?(Boolean) != false || raise("Passed value for field obj.schedule_event is not the expected type, validation failed.")
101
+ obj.send_location.is_a?(Boolean) != false || raise("Passed value for field obj.send_location is not the expected type, validation failed.")
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ module Types
8
+ class RcsCapabilityCards
9
+ # @return [Boolean] Whether the phone number supports standalone rich cards (`cards.length == 1`)
10
+ attr_reader :standalone
11
+ # @return [Boolean] Whether the phone number supports carousel rich cards
12
+ attr_reader :carousel
13
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
14
+ attr_reader :additional_properties
15
+ # @return [Object]
16
+ attr_reader :_field_set
17
+ protected :_field_set
18
+
19
+ OMIT = Object.new
20
+
21
+ # @param standalone [Boolean] Whether the phone number supports standalone rich cards (`cards.length == 1`)
22
+ # @param carousel [Boolean] Whether the phone number supports carousel rich cards
23
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
24
+ # @return [Pinnacle::Types::RcsCapabilityCards]
25
+ def initialize(standalone:, carousel:, additional_properties: nil)
26
+ @standalone = standalone
27
+ @carousel = carousel
28
+ @additional_properties = additional_properties
29
+ @_field_set = { "standalone": standalone, "carousel": carousel }
30
+ end
31
+
32
+ # Deserialize a JSON object to an instance of RcsCapabilityCards
33
+ #
34
+ # @param json_object [String]
35
+ # @return [Pinnacle::Types::RcsCapabilityCards]
36
+ def self.from_json(json_object:)
37
+ struct = JSON.parse(json_object, object_class: OpenStruct)
38
+ parsed_json = JSON.parse(json_object)
39
+ standalone = parsed_json["standalone"]
40
+ carousel = parsed_json["carousel"]
41
+ new(
42
+ standalone: standalone,
43
+ carousel: carousel,
44
+ additional_properties: struct
45
+ )
46
+ end
47
+
48
+ # Serialize an instance of RcsCapabilityCards to a JSON object
49
+ #
50
+ # @return [String]
51
+ def to_json(*_args)
52
+ @_field_set&.to_json
53
+ end
54
+
55
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
56
+ # hash and check each fields type against the current object's property
57
+ # definitions.
58
+ #
59
+ # @param obj [Object]
60
+ # @return [Void]
61
+ def self.validate_raw(obj:)
62
+ obj.standalone.is_a?(Boolean) != false || raise("Passed value for field obj.standalone is not the expected type, validation failed.")
63
+ obj.carousel.is_a?(Boolean) != false || raise("Passed value for field obj.carousel is not the expected type, validation failed.")
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ module Types
8
+ # Response containing the generated RCS service id and/or url. You can always
9
+ # create a link with the service id that is returned.
10
+ # To create a link follow the format:
11
+ # sms://{PHONE_NUMBER}?service_id={SERVICE_ID}&body={URL_ENCODED_BODY}
12
+ class RcsLinkResult
13
+ # @return [String] The generated RCS link URL. If no phone number is provided, no url will be
14
+ # generated.
15
+ attr_reader :url
16
+ # @return [String] The service ID used for the link
17
+ attr_reader :service_id
18
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
19
+ attr_reader :additional_properties
20
+ # @return [Object]
21
+ attr_reader :_field_set
22
+ protected :_field_set
23
+
24
+ OMIT = Object.new
25
+
26
+ # @param url [String] The generated RCS link URL. If no phone number is provided, no url will be
27
+ # generated.
28
+ # @param service_id [String] The service ID used for the link
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [Pinnacle::Types::RcsLinkResult]
31
+ def initialize(service_id:, url: OMIT, additional_properties: nil)
32
+ @url = url if url != OMIT
33
+ @service_id = service_id
34
+ @additional_properties = additional_properties
35
+ @_field_set = { "url": url, "serviceId": service_id }.reject do |_k, v|
36
+ v == OMIT
37
+ end
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of RcsLinkResult
41
+ #
42
+ # @param json_object [String]
43
+ # @return [Pinnacle::Types::RcsLinkResult]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ parsed_json = JSON.parse(json_object)
47
+ url = parsed_json["url"]
48
+ service_id = parsed_json["serviceId"]
49
+ new(
50
+ url: url,
51
+ service_id: service_id,
52
+ additional_properties: struct
53
+ )
54
+ end
55
+
56
+ # Serialize an instance of RcsLinkResult to a JSON object
57
+ #
58
+ # @return [String]
59
+ def to_json(*_args)
60
+ @_field_set&.to_json
61
+ end
62
+
63
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
64
+ # hash and check each fields type against the current object's property
65
+ # definitions.
66
+ #
67
+ # @param obj [Object]
68
+ # @return [Void]
69
+ def self.validate_raw(obj:)
70
+ obj.url&.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
71
+ obj.service_id.is_a?(String) != false || raise("Passed value for field obj.service_id is not the expected type, validation failed.")
72
+ end
73
+ end
74
+ end
75
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rich_button"
3
4
  require "ostruct"
4
5
  require "json"
5
6
 
@@ -12,6 +13,8 @@ module Pinnacle
12
13
  class RcsValidateContentMedia
13
14
  # @return [String] Media file URLs to send.
14
15
  attr_reader :media
16
+ # @return [Array<Pinnacle::Types::RichButton>]
17
+ attr_reader :quick_replies
15
18
  # @return [OpenStruct] Additional properties unmapped to the current class definition
16
19
  attr_reader :additional_properties
17
20
  # @return [Object]
@@ -21,12 +24,14 @@ module Pinnacle
21
24
  OMIT = Object.new
22
25
 
23
26
  # @param media [String] Media file URLs to send.
27
+ # @param quick_replies [Array<Pinnacle::Types::RichButton>]
24
28
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
29
  # @return [Pinnacle::Types::RcsValidateContentMedia]
26
- def initialize(media:, additional_properties: nil)
30
+ def initialize(media:, quick_replies:, additional_properties: nil)
27
31
  @media = media
32
+ @quick_replies = quick_replies
28
33
  @additional_properties = additional_properties
29
- @_field_set = { "media": media }
34
+ @_field_set = { "media": media, "quickReplies": quick_replies }
30
35
  end
31
36
 
32
37
  # Deserialize a JSON object to an instance of RcsValidateContentMedia
@@ -37,7 +42,15 @@ module Pinnacle
37
42
  struct = JSON.parse(json_object, object_class: OpenStruct)
38
43
  parsed_json = JSON.parse(json_object)
39
44
  media = parsed_json["media"]
40
- new(media: media, additional_properties: struct)
45
+ quick_replies = parsed_json["quickReplies"]&.map do |item|
46
+ item = item.to_json
47
+ Pinnacle::Types::RichButton.from_json(json_object: item)
48
+ end
49
+ new(
50
+ media: media,
51
+ quick_replies: quick_replies,
52
+ additional_properties: struct
53
+ )
41
54
  end
42
55
 
43
56
  # Serialize an instance of RcsValidateContentMedia to a JSON object
@@ -55,6 +68,7 @@ module Pinnacle
55
68
  # @return [Void]
56
69
  def self.validate_raw(obj:)
57
70
  obj.media.is_a?(String) != false || raise("Passed value for field obj.media is not the expected type, validation failed.")
71
+ obj.quick_replies.is_a?(Array) != false || raise("Passed value for field obj.quick_replies is not the expected type, validation failed.")
58
72
  end
59
73
  end
60
74
  end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ module Types
8
+ # Response indicating success of whitelisting operation
9
+ class RcsWhitelistResponse
10
+ # @return [Boolean] Whether the whitelisting operation was successful
11
+ attr_reader :success
12
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
13
+ attr_reader :additional_properties
14
+ # @return [Object]
15
+ attr_reader :_field_set
16
+ protected :_field_set
17
+
18
+ OMIT = Object.new
19
+
20
+ # @param success [Boolean] Whether the whitelisting operation was successful
21
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
22
+ # @return [Pinnacle::Types::RcsWhitelistResponse]
23
+ def initialize(success:, additional_properties: nil)
24
+ @success = success
25
+ @additional_properties = additional_properties
26
+ @_field_set = { "success": success }
27
+ end
28
+
29
+ # Deserialize a JSON object to an instance of RcsWhitelistResponse
30
+ #
31
+ # @param json_object [String]
32
+ # @return [Pinnacle::Types::RcsWhitelistResponse]
33
+ def self.from_json(json_object:)
34
+ struct = JSON.parse(json_object, object_class: OpenStruct)
35
+ parsed_json = JSON.parse(json_object)
36
+ success = parsed_json["success"]
37
+ new(success: success, additional_properties: struct)
38
+ end
39
+
40
+ # Serialize an instance of RcsWhitelistResponse to a JSON object
41
+ #
42
+ # @return [String]
43
+ def to_json(*_args)
44
+ @_field_set&.to_json
45
+ end
46
+
47
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
48
+ # hash and check each fields type against the current object's property
49
+ # definitions.
50
+ #
51
+ # @param obj [Object]
52
+ # @return [Void]
53
+ def self.validate_raw(obj:)
54
+ obj.success.is_a?(Boolean) != false || raise("Passed value for field obj.success is not the expected type, validation failed.")
55
+ end
56
+ end
57
+ end
58
+ end