rcs 2.0.2 → 2.0.4

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.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcs/brands/client.rb +52 -90
  3. data/lib/rcs/brands/types/{brand_contact.rb → upsert_brand_schema_contact.rb} +20 -18
  4. data/lib/rcs/brands/types/upsert_brand_schema_entity_type.rb +16 -0
  5. data/lib/rcs/brands/types/upsert_brand_schema_sector.rb +28 -0
  6. data/lib/rcs/brands/types/upsert_brand_schema_type.rb +16 -0
  7. data/lib/rcs/campaigns/dlc/client.rb +12 -12
  8. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_help_keywords.rb → dlc_campaign_help_keywords.rb} +5 -5
  9. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_keywords.rb → dlc_campaign_keywords.rb} +20 -20
  10. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_links.rb → dlc_campaign_links.rb} +5 -5
  11. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_opt_in_keywords.rb → dlc_campaign_opt_in_keywords.rb} +5 -5
  12. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_opt_out_keywords.rb → dlc_campaign_opt_out_keywords.rb} +5 -5
  13. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_options.rb → dlc_campaign_options.rb} +5 -5
  14. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_use_case.rb → dlc_campaign_use_case.rb} +5 -5
  15. data/lib/rcs/campaigns/rcs/client.rb +144 -51
  16. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_agent.rb → rcs_agent.rb} +15 -9
  17. data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +122 -43
  18. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_opt_out.rb → rcs_campaign_help_keywords.rb} +20 -19
  19. data/lib/rcs/campaigns/rcs/types/rcs_campaign_keywords.rb +98 -0
  20. data/lib/rcs/campaigns/rcs/types/rcs_campaign_opt_in_keywords.rb +87 -0
  21. data/lib/rcs/campaigns/rcs/types/rcs_campaign_opt_out_keywords.rb +83 -0
  22. data/lib/rcs/campaigns/rcs/types/rcs_campaign_traffic.rb +76 -0
  23. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_links.rb → rcs_links.rb} +5 -5
  24. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_use_case.rb → rcs_use_case.rb} +7 -7
  25. data/lib/rcs/campaigns/toll_free/client.rb +53 -10
  26. data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +54 -12
  27. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_help_keywords.rb +66 -0
  28. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_keywords.rb +86 -0
  29. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_links.rb +74 -0
  30. data/lib/rcs/campaigns/toll_free/types/{upsert_toll_free_schema_opt_in.rb → toll_free_campaign_opt_in.rb} +5 -5
  31. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_opt_in_keywords.rb +78 -0
  32. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_options.rb +64 -0
  33. data/lib/rcs/campaigns/toll_free/types/{upsert_toll_free_schema_use_case.rb → toll_free_campaign_use_case.rb} +5 -5
  34. data/lib/rcs/messages/blast/client.rb +419 -0
  35. data/lib/rcs/messages/blast/types/blast_mms_options.rb +82 -0
  36. data/lib/rcs/messages/blast/types/blast_mms_response.rb +60 -0
  37. data/lib/rcs/messages/blast/types/blast_rcs_options.rb +118 -0
  38. data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card.rb +82 -0
  39. data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card_image_alignment.rb +16 -0
  40. data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card_orientation.rb +15 -0
  41. data/lib/rcs/messages/blast/types/blast_rcs_response.rb +60 -0
  42. data/lib/rcs/messages/blast/types/blast_sms_options.rb +70 -0
  43. data/lib/rcs/messages/blast/types/blast_sms_response.rb +60 -0
  44. data/lib/rcs/messages/mms/client.rb +6 -6
  45. data/lib/rcs/messages/mms/types/mms_send_response.rb +4 -4
  46. data/lib/rcs/messages/rcs/client.rb +7 -7
  47. data/lib/rcs/messages/rcs/types/{rcs_send_response.rb → send_rich_message_response.rb} +11 -11
  48. data/lib/rcs/messages/schedule/client.rb +103 -0
  49. data/lib/rcs/messages/sms/client.rb +6 -6
  50. data/lib/rcs/messages/sms/types/sms_send_response.rb +4 -4
  51. data/lib/rcs/types/{rcs_base.rb → base_rich_message.rb} +10 -10
  52. data/lib/rcs/types/blast_details.rb +110 -0
  53. data/lib/rcs/types/company_entity_type_enum.rb +14 -0
  54. data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +30 -2
  55. data/lib/rcs/types/dlc_with_extended_brand_and_status_mno_brand_tier.rb +15 -0
  56. data/lib/rcs/types/dlc_with_extended_brand_and_status_mno_tcr_tier.rb +22 -0
  57. data/lib/rcs/types/extended_brand.rb +10 -1
  58. data/lib/rcs/types/extended_brand_with_vetting.rb +10 -1
  59. data/lib/rcs/types/extended_rcs_campaign.rb +122 -51
  60. data/lib/rcs/types/message_schedule.rb +52 -24
  61. data/lib/rcs/types/message_status_enum.rb +1 -0
  62. data/lib/rcs/types/optional_brand_info.rb +10 -1
  63. data/lib/rcs/types/rcs_campaign.rb +122 -43
  64. data/lib/rcs/types/rcs_campaign_schema_extra_keywords.rb +94 -0
  65. data/lib/rcs/types/{rcs_campaign_schema_extra_opt_out.rb → rcs_campaign_schema_extra_keywords_help.rb} +18 -17
  66. data/lib/rcs/types/rcs_campaign_schema_extra_keywords_opt_in.rb +73 -0
  67. data/lib/rcs/types/rcs_campaign_schema_extra_keywords_opt_out.rb +73 -0
  68. data/lib/rcs/types/rcs_campaign_schema_extra_traffic.rb +72 -0
  69. data/lib/rcs/types/rcs_campaign_schema_extra_use_case.rb +2 -2
  70. data/lib/rcs/types/rcs_campaign_schema_keywords.rb +94 -0
  71. data/lib/rcs/types/{rcs_campaign_schema_opt_out.rb → rcs_campaign_schema_keywords_help.rb} +18 -17
  72. data/lib/rcs/types/rcs_campaign_schema_keywords_opt_in.rb +73 -0
  73. data/lib/rcs/types/rcs_campaign_schema_keywords_opt_out.rb +73 -0
  74. data/lib/rcs/types/rcs_campaign_schema_traffic.rb +72 -0
  75. data/lib/rcs/types/rcs_campaign_schema_use_case.rb +2 -2
  76. data/lib/rcs/types/rcs_cards_content_cards_item.rb +4 -2
  77. data/lib/rcs/types/rcs_content.rb +4 -4
  78. data/lib/rcs/types/rcs_messaging_type_enum.rb +17 -0
  79. data/lib/rcs/types/rcs_validate_content.rb +8 -8
  80. data/lib/rcs/types/rcs_validation_result.rb +9 -2
  81. data/lib/rcs/types/{rcs_cards_cards_item.rb → rich_card.rb} +9 -7
  82. data/lib/rcs/types/{rcs_cards.rb → rich_cards.rb} +9 -9
  83. data/lib/rcs/types/rich_cards_message.rb +9 -9
  84. data/lib/rcs/types/rich_media_message.rb +5 -5
  85. data/lib/rcs/types/{send_rcs_card_options_standalone_card.rb → rich_standalone_card_options.rb} +9 -7
  86. data/lib/rcs/types/{rcs_text_content.rb → rich_text.rb} +5 -5
  87. data/lib/rcs/types/rich_text_message.rb +5 -5
  88. data/lib/rcs/types/schedule_cancel_result.rb +58 -0
  89. data/lib/rcs/types/scheduled_blast_details.rb +76 -0
  90. data/lib/rcs/types/scheduled_blast_response_config.rb +89 -0
  91. data/lib/rcs/types/{scheduled_messaage.rb → scheduled_message.rb} +5 -5
  92. data/lib/rcs/types/{send_rcs_card_options.rb → send_rich_cards_options.rb} +18 -14
  93. data/lib/rcs/types/{rcs_base_options.rb → send_rich_message_options.rb} +5 -5
  94. data/lib/rcs/types/{sent_rcs_details.rb → sent_rich_message.rb} +5 -5
  95. data/lib/rcs/types/toll_free_campaign.rb +54 -12
  96. data/lib/rcs/types/toll_free_campaign_schema_keywords.rb +82 -0
  97. data/lib/rcs/types/toll_free_campaign_schema_keywords_help.rb +62 -0
  98. data/lib/rcs/types/toll_free_campaign_schema_keywords_opt_in.rb +74 -0
  99. data/lib/rcs/types/toll_free_campaign_schema_links.rb +70 -0
  100. data/lib/rcs/types/{upsert_toll_free_campaign_opt_in.rb → toll_free_campaign_schema_opt_in.rb} +5 -5
  101. data/lib/rcs/types/toll_free_campaign_schema_options.rb +60 -0
  102. data/lib/rcs/types/{upsert_toll_free_campaign_use_case.rb → toll_free_campaign_schema_use_case.rb} +5 -5
  103. data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +54 -12
  104. data/lib/requests.rb +2 -2
  105. data/lib/types_export.rb +70 -34
  106. metadata +74 -36
  107. data/lib/rcs/campaigns/rcs/types/upsert_rcs_opt_in.rb +0 -75
  108. data/lib/rcs/types/options.rb +0 -111
  109. data/lib/rcs/types/rcs_campaign_opt_in_method_enum.rb +0 -15
  110. data/lib/rcs/types/rcs_campaign_schema_extra_opt_in.rb +0 -71
  111. data/lib/rcs/types/rcs_campaign_schema_opt_in.rb +0 -71
  112. data/lib/rcs/types/upsert_contact.rb +0 -84
@@ -1,75 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "../../../types/rcs_campaign_opt_in_method_enum"
4
- require "ostruct"
5
- require "json"
6
-
7
- module Pinnacle
8
- module Campaigns
9
- module Rcs
10
- module Types
11
- # Opt-in configuration.
12
- class UpsertRcsOptIn
13
- # @return [Pinnacle::Types::RcsCampaignOptInMethodEnum]
14
- attr_reader :method_
15
- # @return [String] Message shown to users explaining what they are agreeing to when opting in.
16
- attr_reader :terms_and_conditions
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 method_ [Pinnacle::Types::RcsCampaignOptInMethodEnum]
26
- # @param terms_and_conditions [String] Message shown to users explaining what they are agreeing to when opting in.
27
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
28
- # @return [Pinnacle::Campaigns::Rcs::Types::UpsertRcsOptIn]
29
- def initialize(method_: OMIT, terms_and_conditions: OMIT, additional_properties: nil)
30
- @method_ = method_ if method_ != OMIT
31
- @terms_and_conditions = terms_and_conditions if terms_and_conditions != OMIT
32
- @additional_properties = additional_properties
33
- @_field_set = { "method": method_, "termsAndConditions": terms_and_conditions }.reject do |_k, v|
34
- v == OMIT
35
- end
36
- end
37
-
38
- # Deserialize a JSON object to an instance of UpsertRcsOptIn
39
- #
40
- # @param json_object [String]
41
- # @return [Pinnacle::Campaigns::Rcs::Types::UpsertRcsOptIn]
42
- def self.from_json(json_object:)
43
- struct = JSON.parse(json_object, object_class: OpenStruct)
44
- parsed_json = JSON.parse(json_object)
45
- method_ = parsed_json["method"]
46
- terms_and_conditions = parsed_json["termsAndConditions"]
47
- new(
48
- method_: method_,
49
- terms_and_conditions: terms_and_conditions,
50
- additional_properties: struct
51
- )
52
- end
53
-
54
- # Serialize an instance of UpsertRcsOptIn to a JSON object
55
- #
56
- # @return [String]
57
- def to_json(*_args)
58
- @_field_set&.to_json
59
- end
60
-
61
- # Leveraged for Union-type generation, validate_raw attempts to parse the given
62
- # hash and check each fields type against the current object's property
63
- # definitions.
64
- #
65
- # @param obj [Object]
66
- # @return [Void]
67
- def self.validate_raw(obj:)
68
- obj.method_&.is_a?(Pinnacle::Types::RcsCampaignOptInMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
69
- obj.terms_and_conditions&.is_a?(String) != false || raise("Passed value for field obj.terms_and_conditions is not the expected type, validation failed.")
70
- end
71
- end
72
- end
73
- end
74
- end
75
- end
@@ -1,111 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "message_schedule"
4
- require_relative "tracking"
5
- require "ostruct"
6
- require "json"
7
-
8
- module Pinnacle
9
- module Types
10
- # Configure how your RCS message is sent and tracked.
11
- class Options
12
- # @return [Pinnacle::Types::MessageSchedule]
13
- attr_reader :schedule
14
- # @return [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
15
- # debugging.
16
- attr_reader :test_mode
17
- # @return [Pinnacle::Types::Tracking]
18
- attr_reader :tracking
19
- # @return [Boolean] Media files and card media will be transcoded to a supported RCS format. This
20
- # adds a small delay to sending the message. Ignored for rich text messages.
21
- attr_reader :transcode
22
- # @return [Boolean] Validate your message for any unsupported files. <br>
23
- # If failed, errors will be thrown and the message will not send.
24
- attr_reader :validate
25
- # @return [OpenStruct] Additional properties unmapped to the current class definition
26
- attr_reader :additional_properties
27
- # @return [Object]
28
- attr_reader :_field_set
29
- protected :_field_set
30
-
31
- OMIT = Object.new
32
-
33
- # @param schedule [Pinnacle::Types::MessageSchedule]
34
- # @param test_mode [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
35
- # debugging.
36
- # @param tracking [Pinnacle::Types::Tracking]
37
- # @param transcode [Boolean] Media files and card media will be transcoded to a supported RCS format. This
38
- # adds a small delay to sending the message. Ignored for rich text messages.
39
- # @param validate [Boolean] Validate your message for any unsupported files. <br>
40
- # If failed, errors will be thrown and the message will not send.
41
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
42
- # @return [Pinnacle::Types::Options]
43
- def initialize(schedule: OMIT, test_mode: OMIT, tracking: OMIT, transcode: OMIT, validate: OMIT,
44
- additional_properties: nil)
45
- @schedule = schedule if schedule != OMIT
46
- @test_mode = test_mode if test_mode != OMIT
47
- @tracking = tracking if tracking != OMIT
48
- @transcode = transcode if transcode != OMIT
49
- @validate = validate if validate != OMIT
50
- @additional_properties = additional_properties
51
- @_field_set = {
52
- "schedule": schedule,
53
- "test_mode": test_mode,
54
- "tracking": tracking,
55
- "transcode": transcode,
56
- "validate": validate
57
- }.reject do |_k, v|
58
- v == OMIT
59
- end
60
- end
61
-
62
- # Deserialize a JSON object to an instance of Options
63
- #
64
- # @param json_object [String]
65
- # @return [Pinnacle::Types::Options]
66
- def self.from_json(json_object:)
67
- struct = JSON.parse(json_object, object_class: OpenStruct)
68
- parsed_json = JSON.parse(json_object)
69
- if parsed_json["schedule"].nil?
70
- schedule = nil
71
- else
72
- schedule = parsed_json["schedule"].to_json
73
- schedule = Pinnacle::Types::MessageSchedule.from_json(json_object: schedule)
74
- end
75
- test_mode = parsed_json["test_mode"]
76
- tracking = parsed_json["tracking"]
77
- transcode = parsed_json["transcode"]
78
- validate = parsed_json["validate"]
79
- new(
80
- schedule: schedule,
81
- test_mode: test_mode,
82
- tracking: tracking,
83
- transcode: transcode,
84
- validate: validate,
85
- additional_properties: struct
86
- )
87
- end
88
-
89
- # Serialize an instance of Options to a JSON object
90
- #
91
- # @return [String]
92
- def to_json(*_args)
93
- @_field_set&.to_json
94
- end
95
-
96
- # Leveraged for Union-type generation, validate_raw attempts to parse the given
97
- # hash and check each fields type against the current object's property
98
- # definitions.
99
- #
100
- # @param obj [Object]
101
- # @return [Void]
102
- def self.validate_raw(obj:)
103
- obj.schedule.nil? || Pinnacle::Types::MessageSchedule.validate_raw(obj: obj.schedule)
104
- obj.test_mode&.is_a?(Boolean) != false || raise("Passed value for field obj.test_mode is not the expected type, validation failed.")
105
- obj.tracking&.is_a?(Pinnacle::Types::Tracking) != false || raise("Passed value for field obj.tracking is not the expected type, validation failed.")
106
- obj.transcode&.is_a?(Boolean) != false || raise("Passed value for field obj.transcode is not the expected type, validation failed.")
107
- obj.validate&.is_a?(Boolean) != false || raise("Passed value for field obj.validate is not the expected type, validation failed.")
108
- end
109
- end
110
- end
111
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Pinnacle
4
- module Types
5
- # Opt in options.
6
- class RcsCampaignOptInMethodEnum
7
- WEBSITE = "WEBSITE"
8
- SMS = "SMS"
9
- APP = "APP"
10
- VERBAL = "VERBAL"
11
- WRITTEN = "WRITTEN"
12
- OTHER = "OTHER"
13
- end
14
- end
15
- end
@@ -1,71 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "rcs_campaign_opt_in_method_enum"
4
- require "ostruct"
5
- require "json"
6
-
7
- module Pinnacle
8
- module Types
9
- # Opt-in configuration.
10
- class RcsCampaignSchemaExtraOptIn
11
- # @return [Pinnacle::Types::RcsCampaignOptInMethodEnum]
12
- attr_reader :method_
13
- # @return [String] Message shown to users explaining what they are agreeing to when opting in.
14
- attr_reader :terms_and_conditions
15
- # @return [OpenStruct] Additional properties unmapped to the current class definition
16
- attr_reader :additional_properties
17
- # @return [Object]
18
- attr_reader :_field_set
19
- protected :_field_set
20
-
21
- OMIT = Object.new
22
-
23
- # @param method_ [Pinnacle::Types::RcsCampaignOptInMethodEnum]
24
- # @param terms_and_conditions [String] Message shown to users explaining what they are agreeing to when opting in.
25
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
- # @return [Pinnacle::Types::RcsCampaignSchemaExtraOptIn]
27
- def initialize(method_: OMIT, terms_and_conditions: OMIT, additional_properties: nil)
28
- @method_ = method_ if method_ != OMIT
29
- @terms_and_conditions = terms_and_conditions if terms_and_conditions != OMIT
30
- @additional_properties = additional_properties
31
- @_field_set = { "method": method_, "termsAndConditions": terms_and_conditions }.reject do |_k, v|
32
- v == OMIT
33
- end
34
- end
35
-
36
- # Deserialize a JSON object to an instance of RcsCampaignSchemaExtraOptIn
37
- #
38
- # @param json_object [String]
39
- # @return [Pinnacle::Types::RcsCampaignSchemaExtraOptIn]
40
- def self.from_json(json_object:)
41
- struct = JSON.parse(json_object, object_class: OpenStruct)
42
- parsed_json = JSON.parse(json_object)
43
- method_ = parsed_json["method"]
44
- terms_and_conditions = parsed_json["termsAndConditions"]
45
- new(
46
- method_: method_,
47
- terms_and_conditions: terms_and_conditions,
48
- additional_properties: struct
49
- )
50
- end
51
-
52
- # Serialize an instance of RcsCampaignSchemaExtraOptIn to a JSON object
53
- #
54
- # @return [String]
55
- def to_json(*_args)
56
- @_field_set&.to_json
57
- end
58
-
59
- # Leveraged for Union-type generation, validate_raw attempts to parse the given
60
- # hash and check each fields type against the current object's property
61
- # definitions.
62
- #
63
- # @param obj [Object]
64
- # @return [Void]
65
- def self.validate_raw(obj:)
66
- obj.method_&.is_a?(Pinnacle::Types::RcsCampaignOptInMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
67
- obj.terms_and_conditions&.is_a?(String) != false || raise("Passed value for field obj.terms_and_conditions is not the expected type, validation failed.")
68
- end
69
- end
70
- end
71
- end
@@ -1,71 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "rcs_campaign_opt_in_method_enum"
4
- require "ostruct"
5
- require "json"
6
-
7
- module Pinnacle
8
- module Types
9
- # Opt-in configuration.
10
- class RcsCampaignSchemaOptIn
11
- # @return [String] Message shown to users explaining what they are agreeing to when opting in.
12
- attr_reader :terms_and_conditions
13
- # @return [Pinnacle::Types::RcsCampaignOptInMethodEnum]
14
- attr_reader :method_
15
- # @return [OpenStruct] Additional properties unmapped to the current class definition
16
- attr_reader :additional_properties
17
- # @return [Object]
18
- attr_reader :_field_set
19
- protected :_field_set
20
-
21
- OMIT = Object.new
22
-
23
- # @param terms_and_conditions [String] Message shown to users explaining what they are agreeing to when opting in.
24
- # @param method_ [Pinnacle::Types::RcsCampaignOptInMethodEnum]
25
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
- # @return [Pinnacle::Types::RcsCampaignSchemaOptIn]
27
- def initialize(terms_and_conditions: OMIT, method_: OMIT, additional_properties: nil)
28
- @terms_and_conditions = terms_and_conditions if terms_and_conditions != OMIT
29
- @method_ = method_ if method_ != OMIT
30
- @additional_properties = additional_properties
31
- @_field_set = { "termsAndConditions": terms_and_conditions, "method": method_ }.reject do |_k, v|
32
- v == OMIT
33
- end
34
- end
35
-
36
- # Deserialize a JSON object to an instance of RcsCampaignSchemaOptIn
37
- #
38
- # @param json_object [String]
39
- # @return [Pinnacle::Types::RcsCampaignSchemaOptIn]
40
- def self.from_json(json_object:)
41
- struct = JSON.parse(json_object, object_class: OpenStruct)
42
- parsed_json = JSON.parse(json_object)
43
- terms_and_conditions = parsed_json["termsAndConditions"]
44
- method_ = parsed_json["method"]
45
- new(
46
- terms_and_conditions: terms_and_conditions,
47
- method_: method_,
48
- additional_properties: struct
49
- )
50
- end
51
-
52
- # Serialize an instance of RcsCampaignSchemaOptIn to a JSON object
53
- #
54
- # @return [String]
55
- def to_json(*_args)
56
- @_field_set&.to_json
57
- end
58
-
59
- # Leveraged for Union-type generation, validate_raw attempts to parse the given
60
- # hash and check each fields type against the current object's property
61
- # definitions.
62
- #
63
- # @param obj [Object]
64
- # @return [Void]
65
- def self.validate_raw(obj:)
66
- obj.terms_and_conditions&.is_a?(String) != false || raise("Passed value for field obj.terms_and_conditions is not the expected type, validation failed.")
67
- obj.method_&.is_a?(Pinnacle::Types::RcsCampaignOptInMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
68
- end
69
- end
70
- end
71
- end
@@ -1,84 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "ostruct"
4
- require "json"
5
-
6
- module Pinnacle
7
- module Types
8
- # Contact information for the brand.
9
- class UpsertContact
10
- # @return [String] Email address of the contact person.
11
- attr_reader :email
12
- # @return [String] Full name of the contact person.
13
- attr_reader :name
14
- # @return [String] Phone number of the contact person in E.164 format.
15
- attr_reader :phone
16
- # @return [String] Job title of the contact person.
17
- attr_reader :title
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 email [String] Email address of the contact person.
27
- # @param name [String] Full name of the contact person.
28
- # @param phone [String] Phone number of the contact person in E.164 format.
29
- # @param title [String] Job title of the contact person.
30
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
- # @return [Pinnacle::Types::UpsertContact]
32
- def initialize(email: OMIT, name: OMIT, phone: OMIT, title: OMIT, additional_properties: nil)
33
- @email = email if email != OMIT
34
- @name = name if name != OMIT
35
- @phone = phone if phone != OMIT
36
- @title = title if title != OMIT
37
- @additional_properties = additional_properties
38
- @_field_set = { "email": email, "name": name, "phone": phone, "title": title }.reject do |_k, v|
39
- v == OMIT
40
- end
41
- end
42
-
43
- # Deserialize a JSON object to an instance of UpsertContact
44
- #
45
- # @param json_object [String]
46
- # @return [Pinnacle::Types::UpsertContact]
47
- def self.from_json(json_object:)
48
- struct = JSON.parse(json_object, object_class: OpenStruct)
49
- parsed_json = JSON.parse(json_object)
50
- email = parsed_json["email"]
51
- name = parsed_json["name"]
52
- phone = parsed_json["phone"]
53
- title = parsed_json["title"]
54
- new(
55
- email: email,
56
- name: name,
57
- phone: phone,
58
- title: title,
59
- additional_properties: struct
60
- )
61
- end
62
-
63
- # Serialize an instance of UpsertContact 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
- obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
78
- obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
79
- obj.phone&.is_a?(String) != false || raise("Passed value for field obj.phone is not the expected type, validation failed.")
80
- obj.title&.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
81
- end
82
- end
83
- end
84
- end