pingram 0.1.0

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 (187) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +54 -0
  4. data/Rakefile +10 -0
  5. data/lib/pingram/api/account_api.rb +506 -0
  6. data/lib/pingram/api/addresses_api.rb +209 -0
  7. data/lib/pingram/api/components_api.rb +396 -0
  8. data/lib/pingram/api/default_api.rb +88 -0
  9. data/lib/pingram/api/domains_api.rb +204 -0
  10. data/lib/pingram/api/editor_api.rb +88 -0
  11. data/lib/pingram/api/environments_api.rb +215 -0
  12. data/lib/pingram/api/health_api.rb +77 -0
  13. data/lib/pingram/api/insights_api.rb +88 -0
  14. data/lib/pingram/api/keys_api.rb +204 -0
  15. data/lib/pingram/api/logs_api.rb +375 -0
  16. data/lib/pingram/api/members_api.rb +433 -0
  17. data/lib/pingram/api/sender_api.rb +221 -0
  18. data/lib/pingram/api/templates_api.rb +479 -0
  19. data/lib/pingram/api/types_api.rb +335 -0
  20. data/lib/pingram/api/user_api.rb +587 -0
  21. data/lib/pingram/api/users_api.rb +228 -0
  22. data/lib/pingram/api_client.rb +397 -0
  23. data/lib/pingram/api_error.rb +58 -0
  24. data/lib/pingram/api_model_base.rb +88 -0
  25. data/lib/pingram/client_wrapper.rb +212 -0
  26. data/lib/pingram/configuration.rb +330 -0
  27. data/lib/pingram/models/account_addresses_response.rb +166 -0
  28. data/lib/pingram/models/account_addresses_response_addresses_inner.rb +301 -0
  29. data/lib/pingram/models/account_get_response.rb +354 -0
  30. data/lib/pingram/models/account_get_response_pending_downgrade_usage_limit.rb +201 -0
  31. data/lib/pingram/models/address_response.rb +164 -0
  32. data/lib/pingram/models/auto_join_get_response.rb +192 -0
  33. data/lib/pingram/models/auto_join_post_response.rb +192 -0
  34. data/lib/pingram/models/auto_join_request_body.rb +166 -0
  35. data/lib/pingram/models/bee_token_v2.rb +190 -0
  36. data/lib/pingram/models/billing_post_request_body.rb +216 -0
  37. data/lib/pingram/models/billing_post_response_body.rb +367 -0
  38. data/lib/pingram/models/billing_post_response_body_pending_downgrade_usage_limit.rb +202 -0
  39. data/lib/pingram/models/channels_enum.rb +45 -0
  40. data/lib/pingram/models/create_account_request_body.rb +164 -0
  41. data/lib/pingram/models/create_account_response.rb +190 -0
  42. data/lib/pingram/models/create_address_request.rb +182 -0
  43. data/lib/pingram/models/create_key_request.rb +227 -0
  44. data/lib/pingram/models/create_key_response.rb +308 -0
  45. data/lib/pingram/models/delete_key_response.rb +165 -0
  46. data/lib/pingram/models/delete_user_response.rb +164 -0
  47. data/lib/pingram/models/email_auth_token_post_request.rb +147 -0
  48. data/lib/pingram/models/email_component_patch_request.rb +174 -0
  49. data/lib/pingram/models/email_component_post_request.rb +217 -0
  50. data/lib/pingram/models/email_component_response.rb +424 -0
  51. data/lib/pingram/models/email_component_response_referenced_by_inner.rb +238 -0
  52. data/lib/pingram/models/environment.rb +270 -0
  53. data/lib/pingram/models/environment_create_request.rb +164 -0
  54. data/lib/pingram/models/environment_patch_request.rb +176 -0
  55. data/lib/pingram/models/get_account_metadata_response.rb +164 -0
  56. data/lib/pingram/models/get_account_metadata_response_user_account_metadata.rb +216 -0
  57. data/lib/pingram/models/get_email_components_response_inner.rb +424 -0
  58. data/lib/pingram/models/get_environments_response_inner.rb +270 -0
  59. data/lib/pingram/models/get_inapp_notifications_response.rb +166 -0
  60. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner.rb +389 -0
  61. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options.rb +206 -0
  62. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_instant.rb +191 -0
  63. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_delivery_options_off.rb +164 -0
  64. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_replies_inner.rb +190 -0
  65. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_template.rb +103 -0
  66. data/lib/pingram/models/get_inapp_notifications_response_notifications_inner_template_any_of.rb +301 -0
  67. data/lib/pingram/models/get_keys_response.rb +168 -0
  68. data/lib/pingram/models/get_keys_response_keys_inner.rb +371 -0
  69. data/lib/pingram/models/get_logs_response.rb +175 -0
  70. data/lib/pingram/models/get_logs_response_messages_inner.rb +419 -0
  71. data/lib/pingram/models/get_logs_response_messages_inner_attachments_inner.rb +225 -0
  72. data/lib/pingram/models/get_members_response_inner.rb +236 -0
  73. data/lib/pingram/models/get_metrics_response_inner.rb +238 -0
  74. data/lib/pingram/models/get_metrics_response_inner_messages_inner.rb +159 -0
  75. data/lib/pingram/models/get_notifications_response_inner.rb +317 -0
  76. data/lib/pingram/models/get_notifications_response_inner_deduplication.rb +164 -0
  77. data/lib/pingram/models/get_notifications_response_inner_options.rb +201 -0
  78. data/lib/pingram/models/get_notifications_response_inner_options_email.rb +242 -0
  79. data/lib/pingram/models/get_notifications_response_inner_options_email_daily.rb +173 -0
  80. data/lib/pingram/models/get_notifications_response_inner_options_email_monthly.rb +216 -0
  81. data/lib/pingram/models/get_notifications_response_inner_options_email_weekly.rb +182 -0
  82. data/lib/pingram/models/get_notifications_response_inner_templates_inner.rb +214 -0
  83. data/lib/pingram/models/get_notifications_response_inner_throttling.rb +294 -0
  84. data/lib/pingram/models/get_senders_response_inner.rb +342 -0
  85. data/lib/pingram/models/get_templates_response.rb +103 -0
  86. data/lib/pingram/models/get_users_response.rb +201 -0
  87. data/lib/pingram/models/get_users_response_users_inner.rb +268 -0
  88. data/lib/pingram/models/get_users_response_users_inner_email_suppression_status.rb +214 -0
  89. data/lib/pingram/models/get_users_response_users_inner_push_tokens_inner.rb +252 -0
  90. data/lib/pingram/models/get_users_response_users_inner_push_tokens_inner_device.rb +209 -0
  91. data/lib/pingram/models/get_users_response_users_inner_slack_token.rb +317 -0
  92. data/lib/pingram/models/get_users_response_users_inner_slack_token_authed_user.rb +192 -0
  93. data/lib/pingram/models/get_users_response_users_inner_slack_token_enterprise.rb +156 -0
  94. data/lib/pingram/models/get_users_response_users_inner_slack_token_incoming_webhook.rb +174 -0
  95. data/lib/pingram/models/get_users_response_users_inner_slack_token_response_metadata.rb +200 -0
  96. data/lib/pingram/models/get_users_response_users_inner_web_push_tokens_inner.rb +164 -0
  97. data/lib/pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub.rb +191 -0
  98. data/lib/pingram/models/get_users_response_users_inner_web_push_tokens_inner_sub_keys.rb +190 -0
  99. data/lib/pingram/models/in_app_notification_patch_request.rb +231 -0
  100. data/lib/pingram/models/in_app_notification_unread_clear_request.rb +156 -0
  101. data/lib/pingram/models/inapp_unread_count_response.rb +164 -0
  102. data/lib/pingram/models/inbound_request_body.rb +103 -0
  103. data/lib/pingram/models/inbound_response_body.rb +216 -0
  104. data/lib/pingram/models/inbound_response_body_results_inner.rb +216 -0
  105. data/lib/pingram/models/ingishts_post_request.rb +288 -0
  106. data/lib/pingram/models/ingishts_post_request_label_options.rb +147 -0
  107. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner.rb +208 -0
  108. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat.rb +211 -0
  109. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric.rb +171 -0
  110. data/lib/pingram/models/ingishts_post_request_metric_data_queries_inner_metric_stat_metric_dimensions_inner.rb +159 -0
  111. data/lib/pingram/models/intercom_webhook.rb +293 -0
  112. data/lib/pingram/models/intercom_webhook_data.rb +164 -0
  113. data/lib/pingram/models/intercom_webhook_data_item.rb +103 -0
  114. data/lib/pingram/models/intercom_webhook_data_item_any_of.rb +453 -0
  115. data/lib/pingram/models/intercom_webhook_data_item_any_of_contacts.rb +216 -0
  116. data/lib/pingram/models/intercom_webhook_data_item_any_of_contacts_contacts_inner.rb +199 -0
  117. data/lib/pingram/models/intercom_webhook_data_item_any_of_source.rb +260 -0
  118. data/lib/pingram/models/intercom_webhook_data_item_any_of_source_author.rb +208 -0
  119. data/lib/pingram/models/invite_post_response.rb +156 -0
  120. data/lib/pingram/models/log_query_post_body.rb +251 -0
  121. data/lib/pingram/models/logs_bulk_request.rb +167 -0
  122. data/lib/pingram/models/logs_get_response.rb +167 -0
  123. data/lib/pingram/models/logs_get_response_logs_inner.rb +1808 -0
  124. data/lib/pingram/models/logs_query_response.rb +165 -0
  125. data/lib/pingram/models/logs_query_result_response.rb +194 -0
  126. data/lib/pingram/models/logs_retention_response.rb +165 -0
  127. data/lib/pingram/models/logs_tail_response.rb +167 -0
  128. data/lib/pingram/models/member_invite_request.rb +173 -0
  129. data/lib/pingram/models/member_update_request.rb +164 -0
  130. data/lib/pingram/models/message_response.rb +164 -0
  131. data/lib/pingram/models/notification.rb +317 -0
  132. data/lib/pingram/models/notification_create_request.rb +227 -0
  133. data/lib/pingram/models/notification_patch_request.rb +203 -0
  134. data/lib/pingram/models/post_email_test_request.rb +303 -0
  135. data/lib/pingram/models/post_email_test_response.rb +175 -0
  136. data/lib/pingram/models/post_senders_request_body.rb +164 -0
  137. data/lib/pingram/models/post_user_request.rb +215 -0
  138. data/lib/pingram/models/sender_post_body.rb +324 -0
  139. data/lib/pingram/models/sender_post_body_email.rb +217 -0
  140. data/lib/pingram/models/sender_post_body_inapp.rb +182 -0
  141. data/lib/pingram/models/sender_post_body_mobile_push.rb +190 -0
  142. data/lib/pingram/models/sender_post_body_options.rb +165 -0
  143. data/lib/pingram/models/sender_post_body_options_apn.rb +201 -0
  144. data/lib/pingram/models/sender_post_body_options_email.rb +209 -0
  145. data/lib/pingram/models/sender_post_body_options_email_attachments_inner.rb +103 -0
  146. data/lib/pingram/models/sender_post_body_options_email_attachments_inner_any_of.rb +190 -0
  147. data/lib/pingram/models/sender_post_body_options_email_attachments_inner_any_of1.rb +199 -0
  148. data/lib/pingram/models/sender_post_body_options_fcm.rb +147 -0
  149. data/lib/pingram/models/sender_post_body_options_fcm_android.rb +208 -0
  150. data/lib/pingram/models/sender_post_body_slack.rb +299 -0
  151. data/lib/pingram/models/sender_post_body_slack_metadata.rb +173 -0
  152. data/lib/pingram/models/sender_post_body_slack_metadata_entities_inner.rb +257 -0
  153. data/lib/pingram/models/sender_post_body_slack_metadata_entities_inner_external_ref.rb +174 -0
  154. data/lib/pingram/models/sender_post_body_sms.rb +156 -0
  155. data/lib/pingram/models/sender_post_body_sms_auto_reply.rb +164 -0
  156. data/lib/pingram/models/sender_post_body_to.rb +251 -0
  157. data/lib/pingram/models/sender_post_body_user.rb +268 -0
  158. data/lib/pingram/models/sender_post_body_web_push.rb +208 -0
  159. data/lib/pingram/models/sender_post_response.rb +192 -0
  160. data/lib/pingram/models/set_default_template_request.rb +204 -0
  161. data/lib/pingram/models/slack_interactivity_response.rb +165 -0
  162. data/lib/pingram/models/slack_oauth_request.rb +190 -0
  163. data/lib/pingram/models/success_response.rb +164 -0
  164. data/lib/pingram/models/supabase_configure_request.rb +242 -0
  165. data/lib/pingram/models/supabase_configure_response.rb +173 -0
  166. data/lib/pingram/models/supabase_o_auth_request.rb +216 -0
  167. data/lib/pingram/models/supabase_o_auth_response.rb +173 -0
  168. data/lib/pingram/models/supabase_projects_response.rb +166 -0
  169. data/lib/pingram/models/supabase_projects_response_projects_inner.rb +268 -0
  170. data/lib/pingram/models/supabase_status_response.rb +208 -0
  171. data/lib/pingram/models/template.rb +301 -0
  172. data/lib/pingram/models/template_patch_request.rb +104 -0
  173. data/lib/pingram/models/template_patch_request_any_of.rb +199 -0
  174. data/lib/pingram/models/template_patch_request_any_of1.rb +187 -0
  175. data/lib/pingram/models/template_patch_request_any_of1_batch.rb +217 -0
  176. data/lib/pingram/models/template_patch_request_any_of1_instant.rb +184 -0
  177. data/lib/pingram/models/template_post_request.rb +346 -0
  178. data/lib/pingram/models/template_post_request_batch.rb +217 -0
  179. data/lib/pingram/models/template_post_request_instant.rb +183 -0
  180. data/lib/pingram/models/update_address_request.rb +182 -0
  181. data/lib/pingram/models/user.rb +268 -0
  182. data/lib/pingram/models/user_suppression_delete_response.rb +164 -0
  183. data/lib/pingram/models/webhook_response.rb +182 -0
  184. data/lib/pingram/version.rb +15 -0
  185. data/lib/pingram.rb +215 -0
  186. data/pingram.gemspec +38 -0
  187. metadata +270 -0
@@ -0,0 +1,184 @@
1
+ =begin
2
+ #NotificationAPI
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pingram
17
+ # In-app instant delivery: title, redirect URL, and image URL shown when the notification is delivered in real time.
18
+ class TemplatePatchRequestAnyOf1Instant < ApiModelBase
19
+ attr_accessor :title
20
+
21
+ attr_accessor :redirect_url
22
+
23
+ # Required for instant. Image URL shown in the in-app notification.
24
+ attr_accessor :image_url
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'title' => :'title',
30
+ :'redirect_url' => :'redirectURL',
31
+ :'image_url' => :'imageURL'
32
+ }
33
+ end
34
+
35
+ # Returns attribute mapping this model knows about
36
+ def self.acceptable_attribute_map
37
+ attribute_map
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ acceptable_attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'title' => :'String',
49
+ :'redirect_url' => :'String',
50
+ :'image_url' => :'String'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestAnyOf1Instant` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestAnyOf1Instant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'title')
77
+ self.title = attributes[:'title']
78
+ end
79
+
80
+ if attributes.key?(:'redirect_url')
81
+ self.redirect_url = attributes[:'redirect_url']
82
+ end
83
+
84
+ if attributes.key?(:'image_url')
85
+ self.image_url = attributes[:'image_url']
86
+ else
87
+ self.image_url = nil
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ if @image_url.nil?
97
+ invalid_properties.push('invalid value for "image_url", image_url cannot be nil.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ return false if @image_url.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] image_url Value to be assigned
113
+ def image_url=(image_url)
114
+ if image_url.nil?
115
+ fail ArgumentError, 'image_url cannot be nil'
116
+ end
117
+
118
+ @image_url = image_url
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ title == o.title &&
127
+ redirect_url == o.redirect_url &&
128
+ image_url == o.image_url
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [title, redirect_url, image_url].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash)
164
+ end
165
+
166
+ # Returns the object in the form of hash
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_hash
169
+ hash = {}
170
+ self.class.attribute_map.each_pair do |attr, param|
171
+ value = self.send(attr)
172
+ if value.nil?
173
+ is_nullable = self.class.openapi_nullable.include?(attr)
174
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
175
+ end
176
+
177
+ hash[param] = _to_hash(value)
178
+ end
179
+ hash
180
+ end
181
+
182
+ end
183
+
184
+ end
@@ -0,0 +1,346 @@
1
+ =begin
2
+ #NotificationAPI
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Pingram
17
+ # Request body for creating a template. Include templateId (required) plus any channel-specific fields for the channel in the path. Which fields apply depends on the channel (EMAIL, INAPP_WEB, SMS, PUSH, etc.).
18
+ class TemplatePostRequest < ApiModelBase
19
+ # Unique ID for this template within the notification and channel. Required.
20
+ attr_accessor :template_id
21
+
22
+ # HTML body of the email.
23
+ attr_accessor :html
24
+
25
+ # Preview text (e.g. for inbox).
26
+ attr_accessor :preview_text
27
+
28
+ # Internal editor representation of the email content (e.g. Bee or Redactor JSON). Used for editing and component embedding; the actual email sent to recipients uses the html field.
29
+ attr_accessor :internal
30
+
31
+ # Email subject line.
32
+ attr_accessor :subject
33
+
34
+ # Sender display name.
35
+ attr_accessor :sender_name
36
+
37
+ # Sender email address.
38
+ attr_accessor :sender_email
39
+
40
+ # Migration metadata (e.g. from template migration).
41
+ attr_accessor :migration
42
+
43
+ # Notification title (in-app).
44
+ attr_accessor :title
45
+
46
+ # URL to open when the user taps the notification.
47
+ attr_accessor :redirect_url
48
+
49
+ # Image URL shown in the in-app notification.
50
+ attr_accessor :image_url
51
+
52
+ attr_accessor :instant
53
+
54
+ attr_accessor :batch
55
+
56
+ # Message text (SMS or call).
57
+ attr_accessor :text
58
+
59
+ # Push notification body text. (title is shared with INAPP_WEB above.)
60
+ attr_accessor :message
61
+
62
+ # Web push: icon URL. Slack: bot icon (emoji or URL).
63
+ attr_accessor :icon
64
+
65
+ # Web push: URL to open when the notification is clicked.
66
+ attr_accessor :url
67
+
68
+ # Slack message blocks (optional).
69
+ attr_accessor :blocks
70
+
71
+ # Slack bot username.
72
+ attr_accessor :username
73
+
74
+ # Attribute mapping from ruby-style variable name to JSON key.
75
+ def self.attribute_map
76
+ {
77
+ :'template_id' => :'templateId',
78
+ :'html' => :'html',
79
+ :'preview_text' => :'previewText',
80
+ :'internal' => :'internal',
81
+ :'subject' => :'subject',
82
+ :'sender_name' => :'senderName',
83
+ :'sender_email' => :'senderEmail',
84
+ :'migration' => :'migration',
85
+ :'title' => :'title',
86
+ :'redirect_url' => :'redirectURL',
87
+ :'image_url' => :'imageURL',
88
+ :'instant' => :'instant',
89
+ :'batch' => :'batch',
90
+ :'text' => :'text',
91
+ :'message' => :'message',
92
+ :'icon' => :'icon',
93
+ :'url' => :'url',
94
+ :'blocks' => :'blocks',
95
+ :'username' => :'username'
96
+ }
97
+ end
98
+
99
+ # Returns attribute mapping this model knows about
100
+ def self.acceptable_attribute_map
101
+ attribute_map
102
+ end
103
+
104
+ # Returns all the JSON keys this model knows about
105
+ def self.acceptable_attributes
106
+ acceptable_attribute_map.values
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.openapi_types
111
+ {
112
+ :'template_id' => :'String',
113
+ :'html' => :'String',
114
+ :'preview_text' => :'String',
115
+ :'internal' => :'String',
116
+ :'subject' => :'String',
117
+ :'sender_name' => :'String',
118
+ :'sender_email' => :'String',
119
+ :'migration' => :'String',
120
+ :'title' => :'String',
121
+ :'redirect_url' => :'String',
122
+ :'image_url' => :'String',
123
+ :'instant' => :'TemplatePostRequestInstant',
124
+ :'batch' => :'TemplatePostRequestBatch',
125
+ :'text' => :'String',
126
+ :'message' => :'String',
127
+ :'icon' => :'String',
128
+ :'url' => :'String',
129
+ :'blocks' => :'Array<Hash<String, Object>>',
130
+ :'username' => :'String'
131
+ }
132
+ end
133
+
134
+ # List of attributes with nullable: true
135
+ def self.openapi_nullable
136
+ Set.new([
137
+ ])
138
+ end
139
+
140
+ # Initializes the object
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ def initialize(attributes = {})
143
+ if (!attributes.is_a?(Hash))
144
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePostRequest` initialize method"
145
+ end
146
+
147
+ # check to see if the attribute exists and convert string to symbol for hash key
148
+ acceptable_attribute_map = self.class.acceptable_attribute_map
149
+ attributes = attributes.each_with_object({}) { |(k, v), h|
150
+ if (!acceptable_attribute_map.key?(k.to_sym))
151
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePostRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
152
+ end
153
+ h[k.to_sym] = v
154
+ }
155
+
156
+ if attributes.key?(:'template_id')
157
+ self.template_id = attributes[:'template_id']
158
+ else
159
+ self.template_id = nil
160
+ end
161
+
162
+ if attributes.key?(:'html')
163
+ self.html = attributes[:'html']
164
+ end
165
+
166
+ if attributes.key?(:'preview_text')
167
+ self.preview_text = attributes[:'preview_text']
168
+ end
169
+
170
+ if attributes.key?(:'internal')
171
+ self.internal = attributes[:'internal']
172
+ end
173
+
174
+ if attributes.key?(:'subject')
175
+ self.subject = attributes[:'subject']
176
+ end
177
+
178
+ if attributes.key?(:'sender_name')
179
+ self.sender_name = attributes[:'sender_name']
180
+ end
181
+
182
+ if attributes.key?(:'sender_email')
183
+ self.sender_email = attributes[:'sender_email']
184
+ end
185
+
186
+ if attributes.key?(:'migration')
187
+ self.migration = attributes[:'migration']
188
+ end
189
+
190
+ if attributes.key?(:'title')
191
+ self.title = attributes[:'title']
192
+ end
193
+
194
+ if attributes.key?(:'redirect_url')
195
+ self.redirect_url = attributes[:'redirect_url']
196
+ end
197
+
198
+ if attributes.key?(:'image_url')
199
+ self.image_url = attributes[:'image_url']
200
+ end
201
+
202
+ if attributes.key?(:'instant')
203
+ self.instant = attributes[:'instant']
204
+ end
205
+
206
+ if attributes.key?(:'batch')
207
+ self.batch = attributes[:'batch']
208
+ end
209
+
210
+ if attributes.key?(:'text')
211
+ self.text = attributes[:'text']
212
+ end
213
+
214
+ if attributes.key?(:'message')
215
+ self.message = attributes[:'message']
216
+ end
217
+
218
+ if attributes.key?(:'icon')
219
+ self.icon = attributes[:'icon']
220
+ end
221
+
222
+ if attributes.key?(:'url')
223
+ self.url = attributes[:'url']
224
+ end
225
+
226
+ if attributes.key?(:'blocks')
227
+ if (value = attributes[:'blocks']).is_a?(Array)
228
+ self.blocks = value
229
+ end
230
+ end
231
+
232
+ if attributes.key?(:'username')
233
+ self.username = attributes[:'username']
234
+ end
235
+ end
236
+
237
+ # Show invalid properties with the reasons. Usually used together with valid?
238
+ # @return Array for valid properties with the reasons
239
+ def list_invalid_properties
240
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
241
+ invalid_properties = Array.new
242
+ if @template_id.nil?
243
+ invalid_properties.push('invalid value for "template_id", template_id cannot be nil.')
244
+ end
245
+
246
+ invalid_properties
247
+ end
248
+
249
+ # Check to see if the all the properties in the model are valid
250
+ # @return true if the model is valid
251
+ def valid?
252
+ warn '[DEPRECATED] the `valid?` method is obsolete'
253
+ return false if @template_id.nil?
254
+ true
255
+ end
256
+
257
+ # Custom attribute writer method with validation
258
+ # @param [Object] template_id Value to be assigned
259
+ def template_id=(template_id)
260
+ if template_id.nil?
261
+ fail ArgumentError, 'template_id cannot be nil'
262
+ end
263
+
264
+ @template_id = template_id
265
+ end
266
+
267
+ # Checks equality by comparing each attribute.
268
+ # @param [Object] Object to be compared
269
+ def ==(o)
270
+ return true if self.equal?(o)
271
+ self.class == o.class &&
272
+ template_id == o.template_id &&
273
+ html == o.html &&
274
+ preview_text == o.preview_text &&
275
+ internal == o.internal &&
276
+ subject == o.subject &&
277
+ sender_name == o.sender_name &&
278
+ sender_email == o.sender_email &&
279
+ migration == o.migration &&
280
+ title == o.title &&
281
+ redirect_url == o.redirect_url &&
282
+ image_url == o.image_url &&
283
+ instant == o.instant &&
284
+ batch == o.batch &&
285
+ text == o.text &&
286
+ message == o.message &&
287
+ icon == o.icon &&
288
+ url == o.url &&
289
+ blocks == o.blocks &&
290
+ username == o.username
291
+ end
292
+
293
+ # @see the `==` method
294
+ # @param [Object] Object to be compared
295
+ def eql?(o)
296
+ self == o
297
+ end
298
+
299
+ # Calculates hash code according to all attributes.
300
+ # @return [Integer] Hash code
301
+ def hash
302
+ [template_id, html, preview_text, internal, subject, sender_name, sender_email, migration, title, redirect_url, image_url, instant, batch, text, message, icon, url, blocks, username].hash
303
+ end
304
+
305
+ # Builds the object from hash
306
+ # @param [Hash] attributes Model attributes in the form of hash
307
+ # @return [Object] Returns the model itself
308
+ def self.build_from_hash(attributes)
309
+ return nil unless attributes.is_a?(Hash)
310
+ attributes = attributes.transform_keys(&:to_sym)
311
+ transformed_hash = {}
312
+ openapi_types.each_pair do |key, type|
313
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
314
+ transformed_hash["#{key}"] = nil
315
+ elsif type =~ /\AArray<(.*)>/i
316
+ # check to ensure the input is an array given that the attribute
317
+ # is documented as an array but the input is not
318
+ if attributes[attribute_map[key]].is_a?(Array)
319
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
320
+ end
321
+ elsif !attributes[attribute_map[key]].nil?
322
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
323
+ end
324
+ end
325
+ new(transformed_hash)
326
+ end
327
+
328
+ # Returns the object in the form of hash
329
+ # @return [Hash] Returns the object in the form of hash
330
+ def to_hash
331
+ hash = {}
332
+ self.class.attribute_map.each_pair do |attr, param|
333
+ value = self.send(attr)
334
+ if value.nil?
335
+ is_nullable = self.class.openapi_nullable.include?(attr)
336
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
337
+ end
338
+
339
+ hash[param] = _to_hash(value)
340
+ end
341
+ hash
342
+ end
343
+
344
+ end
345
+
346
+ end