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,208 @@
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
+ class SenderPostBodyOptionsFcmAndroid < ApiModelBase
18
+ attr_accessor :collapse_key
19
+
20
+ attr_accessor :priority
21
+
22
+ attr_accessor :ttl
23
+
24
+ attr_accessor :restricted_package_name
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'collapse_key' => :'collapseKey',
52
+ :'priority' => :'priority',
53
+ :'ttl' => :'ttl',
54
+ :'restricted_package_name' => :'restrictedPackageName'
55
+ }
56
+ end
57
+
58
+ # Returns attribute mapping this model knows about
59
+ def self.acceptable_attribute_map
60
+ attribute_map
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ acceptable_attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'collapse_key' => :'String',
72
+ :'priority' => :'String',
73
+ :'ttl' => :'Float',
74
+ :'restricted_package_name' => :'String'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::SenderPostBodyOptionsFcmAndroid` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::SenderPostBodyOptionsFcmAndroid`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'collapse_key')
101
+ self.collapse_key = attributes[:'collapse_key']
102
+ end
103
+
104
+ if attributes.key?(:'priority')
105
+ self.priority = attributes[:'priority']
106
+ end
107
+
108
+ if attributes.key?(:'ttl')
109
+ self.ttl = attributes[:'ttl']
110
+ end
111
+
112
+ if attributes.key?(:'restricted_package_name')
113
+ self.restricted_package_name = attributes[:'restricted_package_name']
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
129
+ priority_validator = EnumAttributeValidator.new('String', ["high", "normal"])
130
+ return false unless priority_validator.valid?(@priority)
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method checking allowed values (enum).
135
+ # @param [Object] priority Object to be assigned
136
+ def priority=(priority)
137
+ validator = EnumAttributeValidator.new('String', ["high", "normal"])
138
+ unless validator.valid?(priority)
139
+ fail ArgumentError, "invalid value for \"priority\", must be one of #{validator.allowable_values}."
140
+ end
141
+ @priority = priority
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ collapse_key == o.collapse_key &&
150
+ priority == o.priority &&
151
+ ttl == o.ttl &&
152
+ restricted_package_name == o.restricted_package_name
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [collapse_key, priority, ttl, restricted_package_name].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ attributes = attributes.transform_keys(&:to_sym)
173
+ transformed_hash = {}
174
+ openapi_types.each_pair do |key, type|
175
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = nil
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[attribute_map[key]].is_a?(Array)
181
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
182
+ end
183
+ elsif !attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
185
+ end
186
+ end
187
+ new(transformed_hash)
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ end
207
+
208
+ end
@@ -0,0 +1,299 @@
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
+ class SenderPostBodySlack < ApiModelBase
18
+ attr_accessor :text
19
+
20
+ attr_accessor :blocks
21
+
22
+ attr_accessor :username
23
+
24
+ attr_accessor :icon
25
+
26
+ attr_accessor :thread_ts
27
+
28
+ attr_accessor :reply_broadcast
29
+
30
+ attr_accessor :parse
31
+
32
+ attr_accessor :link_names
33
+
34
+ attr_accessor :mrkdwn
35
+
36
+ attr_accessor :unfurl_links
37
+
38
+ attr_accessor :unfurl_media
39
+
40
+ attr_accessor :metadata
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'text' => :'text',
68
+ :'blocks' => :'blocks',
69
+ :'username' => :'username',
70
+ :'icon' => :'icon',
71
+ :'thread_ts' => :'thread_ts',
72
+ :'reply_broadcast' => :'reply_broadcast',
73
+ :'parse' => :'parse',
74
+ :'link_names' => :'link_names',
75
+ :'mrkdwn' => :'mrkdwn',
76
+ :'unfurl_links' => :'unfurl_links',
77
+ :'unfurl_media' => :'unfurl_media',
78
+ :'metadata' => :'metadata'
79
+ }
80
+ end
81
+
82
+ # Returns attribute mapping this model knows about
83
+ def self.acceptable_attribute_map
84
+ attribute_map
85
+ end
86
+
87
+ # Returns all the JSON keys this model knows about
88
+ def self.acceptable_attributes
89
+ acceptable_attribute_map.values
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'text' => :'String',
96
+ :'blocks' => :'Array<Hash<String, Object>>',
97
+ :'username' => :'String',
98
+ :'icon' => :'String',
99
+ :'thread_ts' => :'String',
100
+ :'reply_broadcast' => :'Boolean',
101
+ :'parse' => :'String',
102
+ :'link_names' => :'Boolean',
103
+ :'mrkdwn' => :'Boolean',
104
+ :'unfurl_links' => :'Boolean',
105
+ :'unfurl_media' => :'Boolean',
106
+ :'metadata' => :'SenderPostBodySlackMetadata'
107
+ }
108
+ end
109
+
110
+ # List of attributes with nullable: true
111
+ def self.openapi_nullable
112
+ Set.new([
113
+ ])
114
+ end
115
+
116
+ # Initializes the object
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ def initialize(attributes = {})
119
+ if (!attributes.is_a?(Hash))
120
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::SenderPostBodySlack` initialize method"
121
+ end
122
+
123
+ # check to see if the attribute exists and convert string to symbol for hash key
124
+ acceptable_attribute_map = self.class.acceptable_attribute_map
125
+ attributes = attributes.each_with_object({}) { |(k, v), h|
126
+ if (!acceptable_attribute_map.key?(k.to_sym))
127
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::SenderPostBodySlack`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
128
+ end
129
+ h[k.to_sym] = v
130
+ }
131
+
132
+ if attributes.key?(:'text')
133
+ self.text = attributes[:'text']
134
+ else
135
+ self.text = nil
136
+ end
137
+
138
+ if attributes.key?(:'blocks')
139
+ if (value = attributes[:'blocks']).is_a?(Array)
140
+ self.blocks = value
141
+ end
142
+ end
143
+
144
+ if attributes.key?(:'username')
145
+ self.username = attributes[:'username']
146
+ end
147
+
148
+ if attributes.key?(:'icon')
149
+ self.icon = attributes[:'icon']
150
+ end
151
+
152
+ if attributes.key?(:'thread_ts')
153
+ self.thread_ts = attributes[:'thread_ts']
154
+ end
155
+
156
+ if attributes.key?(:'reply_broadcast')
157
+ self.reply_broadcast = attributes[:'reply_broadcast']
158
+ end
159
+
160
+ if attributes.key?(:'parse')
161
+ self.parse = attributes[:'parse']
162
+ end
163
+
164
+ if attributes.key?(:'link_names')
165
+ self.link_names = attributes[:'link_names']
166
+ end
167
+
168
+ if attributes.key?(:'mrkdwn')
169
+ self.mrkdwn = attributes[:'mrkdwn']
170
+ end
171
+
172
+ if attributes.key?(:'unfurl_links')
173
+ self.unfurl_links = attributes[:'unfurl_links']
174
+ end
175
+
176
+ if attributes.key?(:'unfurl_media')
177
+ self.unfurl_media = attributes[:'unfurl_media']
178
+ end
179
+
180
+ if attributes.key?(:'metadata')
181
+ self.metadata = attributes[:'metadata']
182
+ end
183
+ end
184
+
185
+ # Show invalid properties with the reasons. Usually used together with valid?
186
+ # @return Array for valid properties with the reasons
187
+ def list_invalid_properties
188
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
189
+ invalid_properties = Array.new
190
+ if @text.nil?
191
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
192
+ end
193
+
194
+ invalid_properties
195
+ end
196
+
197
+ # Check to see if the all the properties in the model are valid
198
+ # @return true if the model is valid
199
+ def valid?
200
+ warn '[DEPRECATED] the `valid?` method is obsolete'
201
+ return false if @text.nil?
202
+ parse_validator = EnumAttributeValidator.new('String', ["full", "none"])
203
+ return false unless parse_validator.valid?(@parse)
204
+ true
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] text Value to be assigned
209
+ def text=(text)
210
+ if text.nil?
211
+ fail ArgumentError, 'text cannot be nil'
212
+ end
213
+
214
+ @text = text
215
+ end
216
+
217
+ # Custom attribute writer method checking allowed values (enum).
218
+ # @param [Object] parse Object to be assigned
219
+ def parse=(parse)
220
+ validator = EnumAttributeValidator.new('String', ["full", "none"])
221
+ unless validator.valid?(parse)
222
+ fail ArgumentError, "invalid value for \"parse\", must be one of #{validator.allowable_values}."
223
+ end
224
+ @parse = parse
225
+ end
226
+
227
+ # Checks equality by comparing each attribute.
228
+ # @param [Object] Object to be compared
229
+ def ==(o)
230
+ return true if self.equal?(o)
231
+ self.class == o.class &&
232
+ text == o.text &&
233
+ blocks == o.blocks &&
234
+ username == o.username &&
235
+ icon == o.icon &&
236
+ thread_ts == o.thread_ts &&
237
+ reply_broadcast == o.reply_broadcast &&
238
+ parse == o.parse &&
239
+ link_names == o.link_names &&
240
+ mrkdwn == o.mrkdwn &&
241
+ unfurl_links == o.unfurl_links &&
242
+ unfurl_media == o.unfurl_media &&
243
+ metadata == o.metadata
244
+ end
245
+
246
+ # @see the `==` method
247
+ # @param [Object] Object to be compared
248
+ def eql?(o)
249
+ self == o
250
+ end
251
+
252
+ # Calculates hash code according to all attributes.
253
+ # @return [Integer] Hash code
254
+ def hash
255
+ [text, blocks, username, icon, thread_ts, reply_broadcast, parse, link_names, mrkdwn, unfurl_links, unfurl_media, metadata].hash
256
+ end
257
+
258
+ # Builds the object from hash
259
+ # @param [Hash] attributes Model attributes in the form of hash
260
+ # @return [Object] Returns the model itself
261
+ def self.build_from_hash(attributes)
262
+ return nil unless attributes.is_a?(Hash)
263
+ attributes = attributes.transform_keys(&:to_sym)
264
+ transformed_hash = {}
265
+ openapi_types.each_pair do |key, type|
266
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
267
+ transformed_hash["#{key}"] = nil
268
+ elsif type =~ /\AArray<(.*)>/i
269
+ # check to ensure the input is an array given that the attribute
270
+ # is documented as an array but the input is not
271
+ if attributes[attribute_map[key]].is_a?(Array)
272
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
273
+ end
274
+ elsif !attributes[attribute_map[key]].nil?
275
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
276
+ end
277
+ end
278
+ new(transformed_hash)
279
+ end
280
+
281
+ # Returns the object in the form of hash
282
+ # @return [Hash] Returns the object in the form of hash
283
+ def to_hash
284
+ hash = {}
285
+ self.class.attribute_map.each_pair do |attr, param|
286
+ value = self.send(attr)
287
+ if value.nil?
288
+ is_nullable = self.class.openapi_nullable.include?(attr)
289
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
290
+ end
291
+
292
+ hash[param] = _to_hash(value)
293
+ end
294
+ hash
295
+ end
296
+
297
+ end
298
+
299
+ end
@@ -0,0 +1,173 @@
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
+ # Slack message metadata with optional work object entities. Combines standard Slack message metadata fields with an array of entity objects.
18
+ class SenderPostBodySlackMetadata < ApiModelBase
19
+ # An array of work object entities.
20
+ attr_accessor :entities
21
+
22
+ # A human readable alphanumeric string representing your application's metadata event.
23
+ attr_accessor :event_type
24
+
25
+ # A free-form object containing whatever data your application wishes to attach to messages.
26
+ attr_accessor :event_payload
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'entities' => :'entities',
32
+ :'event_type' => :'event_type',
33
+ :'event_payload' => :'event_payload'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'entities' => :'Array<SenderPostBodySlackMetadataEntitiesInner>',
51
+ :'event_type' => :'String',
52
+ :'event_payload' => :'Hash<String, Object>'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::SenderPostBodySlackMetadata` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::SenderPostBodySlackMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'entities')
79
+ if (value = attributes[:'entities']).is_a?(Array)
80
+ self.entities = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'event_type')
85
+ self.event_type = attributes[:'event_type']
86
+ end
87
+
88
+ if attributes.key?(:'event_payload')
89
+ if (value = attributes[:'event_payload']).is_a?(Hash)
90
+ self.event_payload = value
91
+ end
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
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
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ entities == o.entities &&
116
+ event_type == o.event_type &&
117
+ event_payload == o.event_payload
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [entities, event_type, event_payload].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ end
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
151
+ end
152
+ new(transformed_hash)
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ if value.nil?
162
+ is_nullable = self.class.openapi_nullable.include?(attr)
163
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
164
+ end
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ end
172
+
173
+ end