rcs 2.0.0.pre.rc.3 → 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.
@@ -1,66 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "conversation"
4
- require "ostruct"
5
3
  require "json"
4
+ require_relative "error_response"
5
+ require_relative "retrieved_conversations"
6
6
 
7
7
  module Pinnacle
8
8
  module Types
9
9
  # Response for list conversation.
10
10
  class ConversationList
11
- # @return [Integer] Total number of conversations matching the filter.
12
- attr_reader :count
13
- # @return [Array<Pinnacle::Types::Conversation>]
14
- attr_reader :conversations
15
- # @return [Boolean] Indicates if more conversations are available beyond the current page.
16
- attr_reader :has_more
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 count [Integer] Total number of conversations matching the filter.
26
- # @param conversations [Array<Pinnacle::Types::Conversation>]
27
- # @param has_more [Boolean] Indicates if more conversations are available beyond the current page.
28
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
- # @return [Pinnacle::Types::ConversationList]
30
- def initialize(count:, conversations:, has_more:, additional_properties: nil)
31
- @count = count
32
- @conversations = conversations
33
- @has_more = has_more
34
- @additional_properties = additional_properties
35
- @_field_set = { "count": count, "conversations": conversations, "hasMore": has_more }
36
- end
37
-
38
11
  # Deserialize a JSON object to an instance of ConversationList
39
12
  #
40
13
  # @param json_object [String]
41
14
  # @return [Pinnacle::Types::ConversationList]
42
15
  def self.from_json(json_object:)
43
16
  struct = JSON.parse(json_object, object_class: OpenStruct)
44
- parsed_json = JSON.parse(json_object)
45
- count = parsed_json["count"]
46
- conversations = parsed_json["conversations"]&.map do |item|
47
- item = item.to_json
48
- Pinnacle::Types::Conversation.from_json(json_object: item)
17
+ begin
18
+ Pinnacle::Types::ErrorResponse.validate_raw(obj: struct)
19
+ return Pinnacle::Types::ErrorResponse.from_json(json_object: struct) unless struct.nil?
20
+
21
+ return nil
22
+ rescue StandardError
23
+ # noop
49
24
  end
50
- has_more = parsed_json["hasMore"]
51
- new(
52
- count: count,
53
- conversations: conversations,
54
- has_more: has_more,
55
- additional_properties: struct
56
- )
57
- end
25
+ begin
26
+ Pinnacle::Types::RetrievedConversations.validate_raw(obj: struct)
27
+ return Pinnacle::Types::RetrievedConversations.from_json(json_object: struct) unless struct.nil?
58
28
 
59
- # Serialize an instance of ConversationList to a JSON object
60
- #
61
- # @return [String]
62
- def to_json(*_args)
63
- @_field_set&.to_json
29
+ return nil
30
+ rescue StandardError
31
+ # noop
32
+ end
33
+ struct
64
34
  end
65
35
 
66
36
  # Leveraged for Union-type generation, validate_raw attempts to parse the given
@@ -70,9 +40,17 @@ module Pinnacle
70
40
  # @param obj [Object]
71
41
  # @return [Void]
72
42
  def self.validate_raw(obj:)
73
- obj.count.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
74
- obj.conversations.is_a?(Array) != false || raise("Passed value for field obj.conversations is not the expected type, validation failed.")
75
- obj.has_more.is_a?(Boolean) != false || raise("Passed value for field obj.has_more is not the expected type, validation failed.")
43
+ begin
44
+ return Pinnacle::Types::ErrorResponse.validate_raw(obj: obj)
45
+ rescue StandardError
46
+ # noop
47
+ end
48
+ begin
49
+ return Pinnacle::Types::RetrievedConversations.validate_raw(obj: obj)
50
+ rescue StandardError
51
+ # noop
52
+ end
53
+ raise("Passed value matched no type within the union, validation failed.")
76
54
  end
77
55
  end
78
56
  end
@@ -22,7 +22,7 @@ module Pinnacle
22
22
  # `FAILED`: Issues and errors related to the campaign's details. See
23
23
  # [error](dlc-campaign#response.body.error) for these potential issues.
24
24
  attr_reader :status
25
- # @return [Pinnacle::Types::GetDlcCampaignStatusResponseUpdates] Status of toll free numbers that are being attached to this campaign. <br>
25
+ # @return [Pinnacle::Types::GetDlcCampaignStatusResponseUpdates] Status of local long code numbers that are being attached to this campaign. <br>
26
26
  # Note that phone numbers can only be attached to `VERIFIED` campaigns via the
27
27
  # [attach campaign endpoint](../phone-numbers/attach-campaign).
28
28
  attr_reader :updates
@@ -44,7 +44,7 @@ module Pinnacle
44
44
  # `VERIFIED`: Approved and ready to send messages.<br>
45
45
  # `FAILED`: Issues and errors related to the campaign's details. See
46
46
  # [error](dlc-campaign#response.body.error) for these potential issues.
47
- # @param updates [Pinnacle::Types::GetDlcCampaignStatusResponseUpdates] Status of toll free numbers that are being attached to this campaign. <br>
47
+ # @param updates [Pinnacle::Types::GetDlcCampaignStatusResponseUpdates] Status of local long code numbers that are being attached to this campaign. <br>
48
48
  # Note that phone numbers can only be attached to `VERIFIED` campaigns via the
49
49
  # [attach campaign endpoint](../phone-numbers/attach-campaign).
50
50
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
@@ -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
@@ -18,6 +18,10 @@ module Pinnacle
18
18
  attr_reader :agent_id
19
19
  # @return [Pinnacle::Types::ExtendedBrand] Brand associated with this campaign.
20
20
  attr_reader :brand
21
+ # @return [String] Link to document verifying the brand's name. This may be the certificate of
22
+ # incorporation, business license, or other relevant document. You can typically
23
+ # find this on the Secretary of State website.
24
+ attr_reader :brand_verification_url
21
25
  # @return [Boolean] Indicates whether the brand has provided an attestation.
22
26
  attr_reader :brand_attestation
23
27
  # @return [Integer] Unique identifier for the campaign.
@@ -43,6 +47,9 @@ module Pinnacle
43
47
  # @param agent [Pinnacle::Types::RcsCampaignSchemaExtraAgent] Agent configured to the campaign.
44
48
  # @param agent_id [String] Agent's unique identifier.
45
49
  # @param brand [Pinnacle::Types::ExtendedBrand] Brand associated with this campaign.
50
+ # @param brand_verification_url [String] Link to document verifying the brand's name. This may be the certificate of
51
+ # incorporation, business license, or other relevant document. You can typically
52
+ # find this on the Secretary of State website.
46
53
  # @param brand_attestation [Boolean] Indicates whether the brand has provided an attestation.
47
54
  # @param campaign_id [Integer] Unique identifier for the campaign.
48
55
  # @param expected_agent_responses [Array<String>] List of what the agent might say to users.
@@ -52,11 +59,12 @@ module Pinnacle
52
59
  # @param use_case [Pinnacle::Types::RcsCampaignSchemaExtraUseCase] Use case classification for the campaign.
53
60
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
54
61
  # @return [Pinnacle::Types::ExtendedRcsCampaign]
55
- def initialize(agent:, agent_id:, brand:, brand_attestation:, campaign_id:, links:, opt_in:, opt_out:, use_case:,
62
+ def initialize(agent:, agent_id:, brand:, brand_attestation:, campaign_id:, links:, opt_in:, opt_out:, use_case:, brand_verification_url: OMIT,
56
63
  expected_agent_responses: OMIT, additional_properties: nil)
57
64
  @agent = agent
58
65
  @agent_id = agent_id
59
66
  @brand = brand
67
+ @brand_verification_url = brand_verification_url if brand_verification_url != OMIT
60
68
  @brand_attestation = brand_attestation
61
69
  @campaign_id = campaign_id
62
70
  @expected_agent_responses = expected_agent_responses if expected_agent_responses != OMIT
@@ -69,6 +77,7 @@ module Pinnacle
69
77
  "agent": agent,
70
78
  "agentId": agent_id,
71
79
  "brand": brand,
80
+ "brandVerificationUrl": brand_verification_url,
72
81
  "brandAttestation": brand_attestation,
73
82
  "campaignId": campaign_id,
74
83
  "expectedAgentResponses": expected_agent_responses,
@@ -101,6 +110,7 @@ module Pinnacle
101
110
  brand = parsed_json["brand"].to_json
102
111
  brand = Pinnacle::Types::ExtendedBrand.from_json(json_object: brand)
103
112
  end
113
+ brand_verification_url = parsed_json["brandVerificationUrl"]
104
114
  brand_attestation = parsed_json["brandAttestation"]
105
115
  campaign_id = parsed_json["campaignId"]
106
116
  expected_agent_responses = parsed_json["expectedAgentResponses"]
@@ -132,6 +142,7 @@ module Pinnacle
132
142
  agent: agent,
133
143
  agent_id: agent_id,
134
144
  brand: brand,
145
+ brand_verification_url: brand_verification_url,
135
146
  brand_attestation: brand_attestation,
136
147
  campaign_id: campaign_id,
137
148
  expected_agent_responses: expected_agent_responses,
@@ -160,6 +171,7 @@ module Pinnacle
160
171
  Pinnacle::Types::RcsCampaignSchemaExtraAgent.validate_raw(obj: obj.agent)
161
172
  obj.agent_id.is_a?(String) != false || raise("Passed value for field obj.agent_id is not the expected type, validation failed.")
162
173
  Pinnacle::Types::ExtendedBrand.validate_raw(obj: obj.brand)
174
+ obj.brand_verification_url&.is_a?(String) != false || raise("Passed value for field obj.brand_verification_url is not the expected type, validation failed.")
163
175
  obj.brand_attestation.is_a?(Boolean) != false || raise("Passed value for field obj.brand_attestation is not the expected type, validation failed.")
164
176
  obj.campaign_id.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
165
177
  obj.expected_agent_responses&.is_a?(Array) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
@@ -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.")
@@ -15,6 +15,10 @@ module Pinnacle
15
15
  attr_reader :agent
16
16
  # @return [Integer] Unique identifier for the campaign.
17
17
  attr_reader :campaign_id
18
+ # @return [String] Link to document verifying the brand's name. This may be the certificate of
19
+ # incorporation, business license, or other relevant document. You can typically
20
+ # find this on the Secretary of State website.
21
+ attr_reader :brand_verification_url
18
22
  # @return [Array<String>] List of what the agent might say to users.
19
23
  attr_reader :expected_agent_responses
20
24
  # @return [Pinnacle::Types::RcsCampaignSchemaLinks] Legal documentation links.
@@ -35,6 +39,9 @@ module Pinnacle
35
39
 
36
40
  # @param agent [Pinnacle::Types::RcsCampaignSchemaAgent] Agent configured to the campaign.
37
41
  # @param campaign_id [Integer] Unique identifier for the campaign.
42
+ # @param brand_verification_url [String] Link to document verifying the brand's name. This may be the certificate of
43
+ # incorporation, business license, or other relevant document. You can typically
44
+ # find this on the Secretary of State website.
38
45
  # @param expected_agent_responses [Array<String>] List of what the agent might say to users.
39
46
  # @param links [Pinnacle::Types::RcsCampaignSchemaLinks] Legal documentation links.
40
47
  # @param opt_in [Pinnacle::Types::RcsCampaignSchemaOptIn] Opt-in configuration.
@@ -42,10 +49,11 @@ module Pinnacle
42
49
  # @param use_case [Pinnacle::Types::RcsCampaignSchemaUseCase] Use case classification for the campaign.
43
50
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
44
51
  # @return [Pinnacle::Types::RcsCampaign]
45
- def initialize(agent: OMIT, campaign_id: OMIT, expected_agent_responses: OMIT, links: OMIT, opt_in: OMIT,
46
- opt_out: OMIT, use_case: OMIT, additional_properties: nil)
52
+ def initialize(agent: OMIT, campaign_id: OMIT, brand_verification_url: OMIT, expected_agent_responses: OMIT,
53
+ links: OMIT, opt_in: OMIT, opt_out: OMIT, use_case: OMIT, additional_properties: nil)
47
54
  @agent = agent if agent != OMIT
48
55
  @campaign_id = campaign_id if campaign_id != OMIT
56
+ @brand_verification_url = brand_verification_url if brand_verification_url != OMIT
49
57
  @expected_agent_responses = expected_agent_responses if expected_agent_responses != OMIT
50
58
  @links = links if links != OMIT
51
59
  @opt_in = opt_in if opt_in != OMIT
@@ -55,6 +63,7 @@ module Pinnacle
55
63
  @_field_set = {
56
64
  "agent": agent,
57
65
  "campaignId": campaign_id,
66
+ "brandVerificationUrl": brand_verification_url,
58
67
  "expectedAgentResponses": expected_agent_responses,
59
68
  "links": links,
60
69
  "optIn": opt_in,
@@ -79,6 +88,7 @@ module Pinnacle
79
88
  agent = Pinnacle::Types::RcsCampaignSchemaAgent.from_json(json_object: agent)
80
89
  end
81
90
  campaign_id = parsed_json["campaignId"]
91
+ brand_verification_url = parsed_json["brandVerificationUrl"]
82
92
  expected_agent_responses = parsed_json["expectedAgentResponses"]
83
93
  if parsed_json["links"].nil?
84
94
  links = nil
@@ -107,6 +117,7 @@ module Pinnacle
107
117
  new(
108
118
  agent: agent,
109
119
  campaign_id: campaign_id,
120
+ brand_verification_url: brand_verification_url,
110
121
  expected_agent_responses: expected_agent_responses,
111
122
  links: links,
112
123
  opt_in: opt_in,
@@ -132,6 +143,7 @@ module Pinnacle
132
143
  def self.validate_raw(obj:)
133
144
  obj.agent.nil? || Pinnacle::Types::RcsCampaignSchemaAgent.validate_raw(obj: obj.agent)
134
145
  obj.campaign_id&.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
146
+ obj.brand_verification_url&.is_a?(String) != false || raise("Passed value for field obj.brand_verification_url is not the expected type, validation failed.")
135
147
  obj.expected_agent_responses&.is_a?(Array) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
136
148
  obj.links.nil? || Pinnacle::Types::RcsCampaignSchemaLinks.validate_raw(obj: obj.links)
137
149
  obj.opt_in.nil? || Pinnacle::Types::RcsCampaignSchemaOptIn.validate_raw(obj: obj.opt_in)
@@ -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