tremendous_ruby 5.9.0 → 5.11.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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +530 -58
  3. data/lib/tremendous/api_client.rb +1 -1
  4. data/lib/tremendous/api_error.rb +1 -1
  5. data/lib/tremendous/configuration.rb +1 -1
  6. data/lib/tremendous/models/allow_email.rb +20 -4
  7. data/lib/tremendous/models/allow_email1.rb +20 -4
  8. data/lib/tremendous/models/allow_ip.rb +20 -4
  9. data/lib/tremendous/models/allow_ip1.rb +20 -4
  10. data/lib/tremendous/models/balance_transaction.rb +60 -4
  11. data/lib/tremendous/models/balance_transaction_order.rb +10 -4
  12. data/lib/tremendous/models/balance_transaction_order_payment.rb +10 -4
  13. data/lib/tremendous/models/base_order_for_create.rb +20 -4
  14. data/lib/tremendous/models/campaign.rb +30 -4
  15. data/lib/tremendous/models/campaign_base.rb +10 -4
  16. data/lib/tremendous/models/channel.rb +3 -2
  17. data/lib/tremendous/models/connected_organization.rb +313 -0
  18. data/lib/tremendous/models/connected_organization_member.rb +346 -0
  19. data/lib/tremendous/models/connected_organization_member_member.rb +382 -0
  20. data/lib/tremendous/models/connected_organization_member_session.rb +357 -0
  21. data/lib/tremendous/models/connected_organization_organization.rb +350 -0
  22. data/lib/tremendous/models/create_api_key200_response.rb +10 -4
  23. data/lib/tremendous/models/create_campaign200_response.rb +237 -0
  24. data/lib/tremendous/models/create_campaign_request.rb +30 -4
  25. data/lib/tremendous/models/create_connected_organization200_response.rb +237 -0
  26. data/lib/tremendous/models/create_connected_organization_member200_response.rb +237 -0
  27. data/lib/tremendous/models/create_connected_organization_member_request.rb +238 -0
  28. data/lib/tremendous/models/create_connected_organization_member_session200_response.rb +237 -0
  29. data/lib/tremendous/models/create_connected_organization_member_session200_response_connected_organization_member_session.rb +357 -0
  30. data/lib/tremendous/models/create_connected_organization_member_session_request.rb +238 -0
  31. data/lib/tremendous/models/create_connected_organization_request.rb +238 -0
  32. data/lib/tremendous/models/create_invoice200_response.rb +20 -4
  33. data/lib/tremendous/models/create_invoice_request.rb +20 -4
  34. data/lib/tremendous/models/create_member.rb +30 -4
  35. data/lib/tremendous/models/create_member200_response.rb +20 -4
  36. data/lib/tremendous/models/create_member_request.rb +30 -4
  37. data/lib/tremendous/models/create_order200_response.rb +20 -4
  38. data/lib/tremendous/models/create_order200_response_order.rb +22 -6
  39. data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +10 -4
  40. data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +11 -5
  41. data/lib/tremendous/models/create_order_request.rb +1 -1
  42. data/lib/tremendous/models/create_organization.rb +40 -4
  43. data/lib/tremendous/models/create_organization200_response.rb +10 -4
  44. data/lib/tremendous/models/create_organization200_response_organization.rb +30 -4
  45. data/lib/tremendous/models/create_organization_for_response.rb +30 -4
  46. data/lib/tremendous/models/create_organization_properties.rb +10 -4
  47. data/lib/tremendous/models/create_organization_request.rb +40 -4
  48. data/lib/tremendous/models/create_organization_request_copy_settings.rb +26 -8
  49. data/lib/tremendous/models/create_report200_response.rb +247 -0
  50. data/lib/tremendous/models/create_report200_response_report.rb +297 -0
  51. data/lib/tremendous/models/create_report_request.rb +10 -4
  52. data/lib/tremendous/models/create_report_request_filters.rb +10 -4
  53. data/lib/tremendous/models/create_report_request_filters_digital_rewards.rb +10 -4
  54. data/lib/tremendous/models/create_report_request_filters_digital_rewards_amount.rb +10 -4
  55. data/lib/tremendous/models/create_report_request_filters_digital_rewards_created_at.rb +10 -4
  56. data/lib/tremendous/models/create_webhook200_response.rb +10 -4
  57. data/lib/tremendous/models/create_webhook_request.rb +20 -4
  58. data/lib/tremendous/models/currency_codes.rb +1 -1
  59. data/lib/tremendous/models/custom_field.rb +10 -4
  60. data/lib/tremendous/models/delete_fraud_rule200_response.rb +20 -4
  61. data/lib/tremendous/models/delivery_details.rb +11 -5
  62. data/lib/tremendous/models/delivery_details_with_link.rb +11 -5
  63. data/lib/tremendous/models/delivery_metadata.rb +10 -4
  64. data/lib/tremendous/models/delivery_method.rb +1 -1
  65. data/lib/tremendous/models/delivery_status.rb +1 -1
  66. data/lib/tremendous/models/error_model.rb +20 -4
  67. data/lib/tremendous/models/field.rb +10 -4
  68. data/lib/tremendous/models/fraud_config_allow_email.rb +20 -4
  69. data/lib/tremendous/models/fraud_config_country.rb +20 -4
  70. data/lib/tremendous/models/fraud_config_country_update_list.rb +20 -4
  71. data/lib/tremendous/models/fraud_config_ip.rb +20 -4
  72. data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +10 -4
  73. data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +10 -4
  74. data/lib/tremendous/models/fraud_config_review_email.rb +10 -4
  75. data/lib/tremendous/models/fraud_generic_response.rb +20 -4
  76. data/lib/tremendous/models/fraud_review.rb +10 -4
  77. data/lib/tremendous/models/fraud_review_geo.rb +10 -4
  78. data/lib/tremendous/models/fraud_review_list_item.rb +10 -4
  79. data/lib/tremendous/models/fraud_review_reason.rb +1 -1
  80. data/lib/tremendous/models/fraud_review_redemption_method.rb +1 -1
  81. data/lib/tremendous/models/fraud_review_related_rewards.rb +10 -4
  82. data/lib/tremendous/models/fraud_review_risk.rb +1 -1
  83. data/lib/tremendous/models/fraud_review_status.rb +1 -1
  84. data/lib/tremendous/models/fraud_rule200_response.rb +20 -4
  85. data/lib/tremendous/models/fraud_rule400_response.rb +20 -4
  86. data/lib/tremendous/models/fraud_rule422_response.rb +20 -4
  87. data/lib/tremendous/models/fraud_rule_request.rb +10 -4
  88. data/lib/tremendous/models/fraud_rule_request_config.rb +1 -1
  89. data/lib/tremendous/models/fraud_rule_type.rb +1 -1
  90. data/lib/tremendous/models/fraud_rules_list_item.rb +10 -4
  91. data/lib/tremendous/models/funding_source.rb +55 -5
  92. data/lib/tremendous/models/generate_reward_link200_response.rb +20 -4
  93. data/lib/tremendous/models/generate_reward_link200_response_reward.rb +10 -4
  94. data/lib/tremendous/models/generate_reward_link403_response.rb +20 -4
  95. data/lib/tremendous/models/get_fraud_review200_response.rb +20 -4
  96. data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +10 -4
  97. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +10 -4
  98. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +10 -4
  99. data/lib/tremendous/models/get_funding_source200_response.rb +20 -4
  100. data/lib/tremendous/models/get_member200_response.rb +20 -4
  101. data/lib/tremendous/models/get_member200_response_member.rb +20 -4
  102. data/lib/tremendous/models/get_member200_response_member_events_inner.rb +10 -4
  103. data/lib/tremendous/models/get_order200_response.rb +20 -4
  104. data/lib/tremendous/models/get_organization200_response.rb +10 -4
  105. data/lib/tremendous/models/get_product_response.rb +20 -4
  106. data/lib/tremendous/models/get_reward200_response.rb +20 -4
  107. data/lib/tremendous/models/inline_object.rb +231 -0
  108. data/lib/tremendous/models/inline_object1.rb +237 -0
  109. data/lib/tremendous/models/inline_object1_reward.rb +263 -0
  110. data/lib/tremendous/models/invoice.rb +40 -4
  111. data/lib/tremendous/models/list_balance_transactions200_response.rb +20 -4
  112. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner.rb +60 -4
  113. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order.rb +10 -4
  114. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order_payment.rb +10 -4
  115. data/lib/tremendous/models/list_campaigns200_response.rb +20 -4
  116. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +30 -4
  117. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +10 -4
  118. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +10 -4
  119. data/lib/tremendous/models/list_connected_organization_members200_response.rb +266 -0
  120. data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner.rb +346 -0
  121. data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner_member.rb +382 -0
  122. data/lib/tremendous/models/list_connected_organizations200_response.rb +266 -0
  123. data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner.rb +313 -0
  124. data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +350 -0
  125. data/lib/tremendous/models/list_fields200_response.rb +10 -4
  126. data/lib/tremendous/models/list_fields200_response_fields_inner.rb +10 -4
  127. data/lib/tremendous/models/list_forex_response.rb +20 -4
  128. data/lib/tremendous/models/list_fraud_reviews200_response.rb +30 -4
  129. data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +10 -4
  130. data/lib/tremendous/models/list_fraud_rules200_response.rb +20 -4
  131. data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +10 -4
  132. data/lib/tremendous/models/list_funding_sources200_response.rb +20 -4
  133. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +55 -5
  134. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +144 -6
  135. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta_failure_details.rb +10 -4
  136. data/lib/tremendous/models/list_invoices200_response.rb +30 -4
  137. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +40 -4
  138. data/lib/tremendous/models/list_members200_response.rb +20 -4
  139. data/lib/tremendous/models/list_members200_response_members_inner.rb +20 -4
  140. data/lib/tremendous/models/list_orders200_response.rb +30 -4
  141. data/lib/tremendous/models/list_orders200_response_orders_inner.rb +22 -6
  142. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +10 -4
  143. data/lib/tremendous/models/list_orders200_response_orders_inner_payment_refund.rb +10 -4
  144. data/lib/tremendous/models/list_organizations200_response.rb +10 -4
  145. data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +30 -4
  146. data/lib/tremendous/models/list_products_response.rb +20 -4
  147. data/lib/tremendous/models/list_products_response_products_inner.rb +67 -11
  148. data/lib/tremendous/models/list_products_response_products_inner_countries_inner.rb +20 -4
  149. data/lib/tremendous/models/list_products_response_products_inner_documents.rb +242 -0
  150. data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +35 -8
  151. data/lib/tremendous/models/list_products_response_products_inner_skus_inner.rb +10 -4
  152. data/lib/tremendous/models/list_rewards200_response.rb +10 -4
  153. data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +10 -4
  154. data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +10 -4
  155. data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +11 -5
  156. data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +10 -4
  157. data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +20 -4
  158. data/lib/tremendous/models/list_rewards401_response.rb +20 -4
  159. data/lib/tremendous/models/list_rewards401_response_errors.rb +10 -4
  160. data/lib/tremendous/models/list_rewards429_response.rb +20 -4
  161. data/lib/tremendous/models/list_roles200_response.rb +20 -4
  162. data/lib/tremendous/models/list_roles200_response_roles_inner.rb +30 -4
  163. data/lib/tremendous/models/list_webhook_events200_response.rb +10 -4
  164. data/lib/tremendous/models/list_webhooks200_response.rb +10 -4
  165. data/lib/tremendous/models/list_webhooks200_response_webhooks_inner.rb +10 -4
  166. data/lib/tremendous/models/member.rb +20 -4
  167. data/lib/tremendous/models/member_base.rb +20 -4
  168. data/lib/tremendous/models/member_with_events.rb +20 -4
  169. data/lib/tremendous/models/member_without_events.rb +20 -4
  170. data/lib/tremendous/models/order.rb +22 -6
  171. data/lib/tremendous/models/order_base.rb +22 -6
  172. data/lib/tremendous/models/order_base_payment.rb +10 -4
  173. data/lib/tremendous/models/order_status.rb +1 -1
  174. data/lib/tremendous/models/order_with_link.rb +22 -6
  175. data/lib/tremendous/models/order_with_link_rewards_inner.rb +10 -4
  176. data/lib/tremendous/models/order_without_link.rb +22 -6
  177. data/lib/tremendous/models/order_without_link_rewards_inner.rb +10 -4
  178. data/lib/tremendous/models/organization.rb +30 -4
  179. data/lib/tremendous/models/payment_details.rb +10 -4
  180. data/lib/tremendous/models/payment_details_refund.rb +10 -4
  181. data/lib/tremendous/models/payout.rb +10 -4
  182. data/lib/tremendous/models/product.rb +67 -11
  183. data/lib/tremendous/models/product_documents.rb +242 -0
  184. data/lib/tremendous/models/recipient.rb +10 -4
  185. data/lib/tremendous/models/refund_details.rb +10 -4
  186. data/lib/tremendous/models/report.rb +10 -4
  187. data/lib/tremendous/models/resend_reward422_response.rb +20 -4
  188. data/lib/tremendous/models/resend_reward_request.rb +10 -4
  189. data/lib/tremendous/models/review_country.rb +20 -4
  190. data/lib/tremendous/models/review_country1.rb +20 -4
  191. data/lib/tremendous/models/review_email.rb +10 -4
  192. data/lib/tremendous/models/review_email1.rb +10 -4
  193. data/lib/tremendous/models/review_ip.rb +20 -4
  194. data/lib/tremendous/models/review_ip1.rb +20 -4
  195. data/lib/tremendous/models/review_redeemed_rewards_amount.rb +10 -4
  196. data/lib/tremendous/models/review_redeemed_rewards_count.rb +10 -4
  197. data/lib/tremendous/models/reward.rb +10 -4
  198. data/lib/tremendous/models/reward_base.rb +10 -4
  199. data/lib/tremendous/models/reward_base_custom_fields_inner.rb +10 -4
  200. data/lib/tremendous/models/reward_for_order_create.rb +10 -4
  201. data/lib/tremendous/models/reward_link.rb +10 -4
  202. data/lib/tremendous/models/reward_token.rb +10 -4
  203. data/lib/tremendous/models/reward_value.rb +20 -4
  204. data/lib/tremendous/models/reward_with_link.rb +10 -4
  205. data/lib/tremendous/models/reward_with_link_delivery.rb +11 -5
  206. data/lib/tremendous/models/reward_without_link.rb +10 -4
  207. data/lib/tremendous/models/reward_without_link_delivery.rb +11 -5
  208. data/lib/tremendous/models/role.rb +30 -4
  209. data/lib/tremendous/models/simulate_webhook_request.rb +20 -4
  210. data/lib/tremendous/models/single_reward_order.rb +20 -4
  211. data/lib/tremendous/models/single_reward_order_payment.rb +20 -4
  212. data/lib/tremendous/models/single_reward_order_reward.rb +10 -4
  213. data/lib/tremendous/models/single_reward_order_reward_custom_fields_inner.rb +10 -4
  214. data/lib/tremendous/models/single_reward_order_reward_delivery.rb +10 -4
  215. data/lib/tremendous/models/single_reward_order_reward_delivery_meta.rb +10 -4
  216. data/lib/tremendous/models/single_reward_order_with_link.rb +20 -4
  217. data/lib/tremendous/models/single_reward_order_with_link_order.rb +22 -6
  218. data/lib/tremendous/models/single_reward_order_without_link.rb +20 -4
  219. data/lib/tremendous/models/single_reward_order_without_link_order.rb +22 -6
  220. data/lib/tremendous/models/update_campaign.rb +10 -4
  221. data/lib/tremendous/models/update_campaign_request.rb +10 -4
  222. data/lib/tremendous/models/update_fraud_rule_list200_response.rb +20 -4
  223. data/lib/tremendous/models/update_fraud_rule_list_request.rb +20 -4
  224. data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +1 -1
  225. data/lib/tremendous/models/webhook.rb +10 -4
  226. data/lib/tremendous/models/webhook_post.rb +20 -4
  227. data/lib/tremendous/version.rb +1 -1
  228. data/lib/tremendous.rb +27 -6
  229. metadata +29 -7
@@ -0,0 +1,313 @@
1
+ =begin
2
+ #API Endpoints
3
+
4
+ #Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and its members within Tremendous, please see the Tremendous Organizational API.
5
+
6
+ The version of the OpenAPI document: 2
7
+ Contact: developers@tremendous.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class ConnectedOrganization
18
+ # Tremendous' identifier for the connected organization.
19
+ attr_accessor :id
20
+
21
+ # Client ID of the OAuth app that is to be used by the platform once the integration is complete.
22
+ attr_accessor :client_id
23
+
24
+ # Timestamp of when the connected organization was created.
25
+ attr_accessor :created_at
26
+
27
+ attr_accessor :organization
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'id' => :'id',
33
+ :'client_id' => :'client_id',
34
+ :'created_at' => :'created_at',
35
+ :'organization' => :'organization'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'id' => :'String',
53
+ :'client_id' => :'String',
54
+ :'created_at' => :'Time',
55
+ :'organization' => :'ConnectedOrganizationOrganization'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ :'organization'
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ConnectedOrganization` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ConnectedOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'id')
83
+ self.id = attributes[:'id']
84
+ else
85
+ self.id = nil
86
+ end
87
+
88
+ if attributes.key?(:'client_id')
89
+ self.client_id = attributes[:'client_id']
90
+ else
91
+ self.client_id = nil
92
+ end
93
+
94
+ if attributes.key?(:'created_at')
95
+ self.created_at = attributes[:'created_at']
96
+ else
97
+ self.created_at = nil
98
+ end
99
+
100
+ if attributes.key?(:'organization')
101
+ self.organization = attributes[:'organization']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ if @id.nil?
111
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
112
+ end
113
+
114
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
115
+ if @id !~ pattern
116
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
117
+ end
118
+
119
+ if @client_id.nil?
120
+ invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
121
+ end
122
+
123
+ if @created_at.nil?
124
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
125
+ end
126
+
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ warn '[DEPRECATED] the `valid?` method is obsolete'
134
+ return false if @id.nil?
135
+ return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
136
+ return false if @client_id.nil?
137
+ return false if @created_at.nil?
138
+ true
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] id Value to be assigned
143
+ def id=(id)
144
+ if id.nil?
145
+ fail ArgumentError, 'id cannot be nil'
146
+ end
147
+
148
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
149
+ if id !~ pattern
150
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
151
+ end
152
+
153
+ @id = id
154
+ end
155
+
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] client_id Value to be assigned
158
+ def client_id=(client_id)
159
+ if client_id.nil?
160
+ fail ArgumentError, 'client_id cannot be nil'
161
+ end
162
+
163
+ @client_id = client_id
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] created_at Value to be assigned
168
+ def created_at=(created_at)
169
+ if created_at.nil?
170
+ fail ArgumentError, 'created_at cannot be nil'
171
+ end
172
+
173
+ @created_at = created_at
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ id == o.id &&
182
+ client_id == o.client_id &&
183
+ created_at == o.created_at &&
184
+ organization == o.organization
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Integer] Hash code
195
+ def hash
196
+ [id, client_id, created_at, organization].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def self.build_from_hash(attributes)
203
+ return nil unless attributes.is_a?(Hash)
204
+ attributes = attributes.transform_keys(&:to_sym)
205
+ transformed_hash = {}
206
+ openapi_types.each_pair do |key, type|
207
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
208
+ transformed_hash["#{key}"] = nil
209
+ elsif type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[attribute_map[key]].is_a?(Array)
213
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
214
+ end
215
+ elsif !attributes[attribute_map[key]].nil?
216
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
217
+ end
218
+ end
219
+ new(transformed_hash)
220
+ end
221
+
222
+ # Deserializes the data based on type
223
+ # @param string type Data type
224
+ # @param string value Value to be deserialized
225
+ # @return [Object] Deserialized data
226
+ def self._deserialize(type, value)
227
+ case type.to_sym
228
+ when :Time
229
+ Time.parse(value)
230
+ when :Date
231
+ Date.parse(value)
232
+ when :String
233
+ value.to_s
234
+ when :Integer
235
+ value.to_i
236
+ when :Float
237
+ value.to_f
238
+ when :Boolean
239
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
240
+ true
241
+ else
242
+ false
243
+ end
244
+ when :Object
245
+ # generic object (usually a Hash), return directly
246
+ value
247
+ when /\AArray<(?<inner_type>.+)>\z/
248
+ inner_type = Regexp.last_match[:inner_type]
249
+ value.map { |v| _deserialize(inner_type, v) }
250
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
251
+ k_type = Regexp.last_match[:k_type]
252
+ v_type = Regexp.last_match[:v_type]
253
+ {}.tap do |hash|
254
+ value.each do |k, v|
255
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
256
+ end
257
+ end
258
+ else # model
259
+ # models (e.g. Pet) or oneOf
260
+ klass = Tremendous.const_get(type)
261
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
262
+ end
263
+ end
264
+
265
+ # Returns the string representation of the object
266
+ # @return [String] String presentation of the object
267
+ def to_s
268
+ to_hash.to_s
269
+ end
270
+
271
+ # to_body is an alias to to_hash (backward compatibility)
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_body
274
+ to_hash
275
+ end
276
+
277
+ # Returns the object in the form of hash
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_hash
280
+ hash = {}
281
+ self.class.attribute_map.each_pair do |attr, param|
282
+ value = self.send(attr)
283
+ if value.nil?
284
+ is_nullable = self.class.openapi_nullable.include?(attr)
285
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
286
+ end
287
+
288
+ hash[param] = _to_hash(value)
289
+ end
290
+ hash
291
+ end
292
+
293
+ # Outputs non-array value in the form of hash
294
+ # For object, use to_hash. Otherwise, just return the value
295
+ # @param [Object] value Any valid value
296
+ # @return [Hash] Returns the value in the form of hash
297
+ def _to_hash(value)
298
+ if value.is_a?(Array)
299
+ value.compact.map { |v| _to_hash(v) }
300
+ elsif value.is_a?(Hash)
301
+ {}.tap do |hash|
302
+ value.each { |k, v| hash[k] = _to_hash(v) }
303
+ end
304
+ elsif value.respond_to? :to_hash
305
+ value.to_hash
306
+ else
307
+ value
308
+ end
309
+ end
310
+
311
+ end
312
+
313
+ end
@@ -0,0 +1,346 @@
1
+ =begin
2
+ #API Endpoints
3
+
4
+ #Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and its members within Tremendous, please see the Tremendous Organizational API.
5
+
6
+ The version of the OpenAPI document: 2
7
+ Contact: developers@tremendous.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ class ConnectedOrganizationMember
18
+ # Tremendous' identifier for the connected organization member.
19
+ attr_accessor :id
20
+
21
+ # The name associated with the user in your systems.
22
+ attr_accessor :external_name
23
+
24
+ # The email associated with the user in your systems.
25
+ attr_accessor :external_email
26
+
27
+ # Timestamp of when the connected organization member was created.
28
+ attr_accessor :created_at
29
+
30
+ # Tremendous' identifier for the connected organization.
31
+ attr_accessor :connected_organization_id
32
+
33
+ attr_accessor :member
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'id' => :'id',
39
+ :'external_name' => :'external_name',
40
+ :'external_email' => :'external_email',
41
+ :'created_at' => :'created_at',
42
+ :'connected_organization_id' => :'connected_organization_id',
43
+ :'member' => :'member'
44
+ }
45
+ end
46
+
47
+ # Returns attribute mapping this model knows about
48
+ def self.acceptable_attribute_map
49
+ attribute_map
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ acceptable_attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'id' => :'String',
61
+ :'external_name' => :'String',
62
+ :'external_email' => :'String',
63
+ :'created_at' => :'Time',
64
+ :'connected_organization_id' => :'String',
65
+ :'member' => :'ConnectedOrganizationMemberMember'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'external_name',
73
+ :'external_email',
74
+ :'member'
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ConnectedOrganizationMember` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ConnectedOrganizationMember`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'id')
95
+ self.id = attributes[:'id']
96
+ else
97
+ self.id = nil
98
+ end
99
+
100
+ if attributes.key?(:'external_name')
101
+ self.external_name = attributes[:'external_name']
102
+ end
103
+
104
+ if attributes.key?(:'external_email')
105
+ self.external_email = attributes[:'external_email']
106
+ end
107
+
108
+ if attributes.key?(:'created_at')
109
+ self.created_at = attributes[:'created_at']
110
+ else
111
+ self.created_at = nil
112
+ end
113
+
114
+ if attributes.key?(:'connected_organization_id')
115
+ self.connected_organization_id = attributes[:'connected_organization_id']
116
+ else
117
+ self.connected_organization_id = nil
118
+ end
119
+
120
+ if attributes.key?(:'member')
121
+ self.member = attributes[:'member']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @id.nil?
131
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
132
+ end
133
+
134
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
135
+ if @id !~ pattern
136
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
137
+ end
138
+
139
+ if @created_at.nil?
140
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
141
+ end
142
+
143
+ if @connected_organization_id.nil?
144
+ invalid_properties.push('invalid value for "connected_organization_id", connected_organization_id cannot be nil.')
145
+ end
146
+
147
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
148
+ if @connected_organization_id !~ pattern
149
+ invalid_properties.push("invalid value for \"connected_organization_id\", must conform to the pattern #{pattern}.")
150
+ end
151
+
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ warn '[DEPRECATED] the `valid?` method is obsolete'
159
+ return false if @id.nil?
160
+ return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
161
+ return false if @created_at.nil?
162
+ return false if @connected_organization_id.nil?
163
+ return false if @connected_organization_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
164
+ true
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] id Value to be assigned
169
+ def id=(id)
170
+ if id.nil?
171
+ fail ArgumentError, 'id cannot be nil'
172
+ end
173
+
174
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
175
+ if id !~ pattern
176
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
177
+ end
178
+
179
+ @id = id
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] created_at Value to be assigned
184
+ def created_at=(created_at)
185
+ if created_at.nil?
186
+ fail ArgumentError, 'created_at cannot be nil'
187
+ end
188
+
189
+ @created_at = created_at
190
+ end
191
+
192
+ # Custom attribute writer method with validation
193
+ # @param [Object] connected_organization_id Value to be assigned
194
+ def connected_organization_id=(connected_organization_id)
195
+ if connected_organization_id.nil?
196
+ fail ArgumentError, 'connected_organization_id cannot be nil'
197
+ end
198
+
199
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
200
+ if connected_organization_id !~ pattern
201
+ fail ArgumentError, "invalid value for \"connected_organization_id\", must conform to the pattern #{pattern}."
202
+ end
203
+
204
+ @connected_organization_id = connected_organization_id
205
+ end
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] Object to be compared
209
+ def ==(o)
210
+ return true if self.equal?(o)
211
+ self.class == o.class &&
212
+ id == o.id &&
213
+ external_name == o.external_name &&
214
+ external_email == o.external_email &&
215
+ created_at == o.created_at &&
216
+ connected_organization_id == o.connected_organization_id &&
217
+ member == o.member
218
+ end
219
+
220
+ # @see the `==` method
221
+ # @param [Object] Object to be compared
222
+ def eql?(o)
223
+ self == o
224
+ end
225
+
226
+ # Calculates hash code according to all attributes.
227
+ # @return [Integer] Hash code
228
+ def hash
229
+ [id, external_name, external_email, created_at, connected_organization_id, member].hash
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def self.build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+ attributes = attributes.transform_keys(&:to_sym)
238
+ transformed_hash = {}
239
+ openapi_types.each_pair do |key, type|
240
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
241
+ transformed_hash["#{key}"] = nil
242
+ elsif type =~ /\AArray<(.*)>/i
243
+ # check to ensure the input is an array given that the attribute
244
+ # is documented as an array but the input is not
245
+ if attributes[attribute_map[key]].is_a?(Array)
246
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
247
+ end
248
+ elsif !attributes[attribute_map[key]].nil?
249
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
250
+ end
251
+ end
252
+ new(transformed_hash)
253
+ end
254
+
255
+ # Deserializes the data based on type
256
+ # @param string type Data type
257
+ # @param string value Value to be deserialized
258
+ # @return [Object] Deserialized data
259
+ def self._deserialize(type, value)
260
+ case type.to_sym
261
+ when :Time
262
+ Time.parse(value)
263
+ when :Date
264
+ Date.parse(value)
265
+ when :String
266
+ value.to_s
267
+ when :Integer
268
+ value.to_i
269
+ when :Float
270
+ value.to_f
271
+ when :Boolean
272
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
273
+ true
274
+ else
275
+ false
276
+ end
277
+ when :Object
278
+ # generic object (usually a Hash), return directly
279
+ value
280
+ when /\AArray<(?<inner_type>.+)>\z/
281
+ inner_type = Regexp.last_match[:inner_type]
282
+ value.map { |v| _deserialize(inner_type, v) }
283
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
284
+ k_type = Regexp.last_match[:k_type]
285
+ v_type = Regexp.last_match[:v_type]
286
+ {}.tap do |hash|
287
+ value.each do |k, v|
288
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
289
+ end
290
+ end
291
+ else # model
292
+ # models (e.g. Pet) or oneOf
293
+ klass = Tremendous.const_get(type)
294
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
295
+ end
296
+ end
297
+
298
+ # Returns the string representation of the object
299
+ # @return [String] String presentation of the object
300
+ def to_s
301
+ to_hash.to_s
302
+ end
303
+
304
+ # to_body is an alias to to_hash (backward compatibility)
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_body
307
+ to_hash
308
+ end
309
+
310
+ # Returns the object in the form of hash
311
+ # @return [Hash] Returns the object in the form of hash
312
+ def to_hash
313
+ hash = {}
314
+ self.class.attribute_map.each_pair do |attr, param|
315
+ value = self.send(attr)
316
+ if value.nil?
317
+ is_nullable = self.class.openapi_nullable.include?(attr)
318
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
319
+ end
320
+
321
+ hash[param] = _to_hash(value)
322
+ end
323
+ hash
324
+ end
325
+
326
+ # Outputs non-array value in the form of hash
327
+ # For object, use to_hash. Otherwise, just return the value
328
+ # @param [Object] value Any valid value
329
+ # @return [Hash] Returns the value in the form of hash
330
+ def _to_hash(value)
331
+ if value.is_a?(Array)
332
+ value.compact.map { |v| _to_hash(v) }
333
+ elsif value.is_a?(Hash)
334
+ {}.tap do |hash|
335
+ value.each { |k, v| hash[k] = _to_hash(v) }
336
+ end
337
+ elsif value.respond_to? :to_hash
338
+ value.to_hash
339
+ else
340
+ value
341
+ end
342
+ end
343
+
344
+ end
345
+
346
+ end