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,382 @@
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
+ # Associated `member`. `null` until the registration flow for the connected organization has been completed.
18
+ class ListConnectedOrganizationMembers200ResponseConnectedOrganizationMembersInnerMember
19
+ attr_accessor :id
20
+
21
+ # Email address of the member
22
+ attr_accessor :email
23
+
24
+ # Full name of the member
25
+ attr_accessor :name
26
+
27
+ # Is this member currently active in the organization. If `false`, the member will not be able to access the organization.
28
+ attr_accessor :active
29
+
30
+ # The role ID associated with the member within the organization.
31
+ attr_accessor :role
32
+
33
+ # Current status of the member's account. When creating a member it starts out in the status `INVITED`. As soon as that member open the invitation link and registers an account, the status switches to `REGISTERED`.
34
+ attr_accessor :status
35
+
36
+ # Timestamp when this member was created. The `created_at` timestamp is **NOT** returned when retrieving a member (but is part of the response when listing or creating members).
37
+ attr_accessor :created_at
38
+
39
+ # Timestamp when this member most recently logged into the dashboard of the organization associated with this API key.
40
+ attr_accessor :last_login_at
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
+ :'id' => :'id',
68
+ :'email' => :'email',
69
+ :'name' => :'name',
70
+ :'active' => :'active',
71
+ :'role' => :'role',
72
+ :'status' => :'status',
73
+ :'created_at' => :'created_at',
74
+ :'last_login_at' => :'last_login_at'
75
+ }
76
+ end
77
+
78
+ # Returns attribute mapping this model knows about
79
+ def self.acceptable_attribute_map
80
+ attribute_map
81
+ end
82
+
83
+ # Returns all the JSON keys this model knows about
84
+ def self.acceptable_attributes
85
+ acceptable_attribute_map.values
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.openapi_types
90
+ {
91
+ :'id' => :'String',
92
+ :'email' => :'String',
93
+ :'name' => :'String',
94
+ :'active' => :'Boolean',
95
+ :'role' => :'String',
96
+ :'status' => :'String',
97
+ :'created_at' => :'Time',
98
+ :'last_login_at' => :'Time'
99
+ }
100
+ end
101
+
102
+ # List of attributes with nullable: true
103
+ def self.openapi_nullable
104
+ Set.new([
105
+ :'name',
106
+ :'role',
107
+ :'last_login_at'
108
+ ])
109
+ end
110
+
111
+ # Initializes the object
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ def initialize(attributes = {})
114
+ if (!attributes.is_a?(Hash))
115
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListConnectedOrganizationMembers200ResponseConnectedOrganizationMembersInnerMember` initialize method"
116
+ end
117
+
118
+ # check to see if the attribute exists and convert string to symbol for hash key
119
+ acceptable_attribute_map = self.class.acceptable_attribute_map
120
+ attributes = attributes.each_with_object({}) { |(k, v), h|
121
+ if (!acceptable_attribute_map.key?(k.to_sym))
122
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListConnectedOrganizationMembers200ResponseConnectedOrganizationMembersInnerMember`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
123
+ end
124
+ h[k.to_sym] = v
125
+ }
126
+
127
+ if attributes.key?(:'id')
128
+ self.id = attributes[:'id']
129
+ else
130
+ self.id = nil
131
+ end
132
+
133
+ if attributes.key?(:'email')
134
+ self.email = attributes[:'email']
135
+ else
136
+ self.email = nil
137
+ end
138
+
139
+ if attributes.key?(:'name')
140
+ self.name = attributes[:'name']
141
+ else
142
+ self.name = nil
143
+ end
144
+
145
+ if attributes.key?(:'active')
146
+ self.active = attributes[:'active']
147
+ end
148
+
149
+ if attributes.key?(:'role')
150
+ self.role = attributes[:'role']
151
+ end
152
+
153
+ if attributes.key?(:'status')
154
+ self.status = attributes[:'status']
155
+ else
156
+ self.status = nil
157
+ end
158
+
159
+ if attributes.key?(:'created_at')
160
+ self.created_at = attributes[:'created_at']
161
+ end
162
+
163
+ if attributes.key?(:'last_login_at')
164
+ self.last_login_at = attributes[:'last_login_at']
165
+ end
166
+ end
167
+
168
+ # Show invalid properties with the reasons. Usually used together with valid?
169
+ # @return Array for valid properties with the reasons
170
+ def list_invalid_properties
171
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
172
+ invalid_properties = Array.new
173
+ if @id.nil?
174
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
175
+ end
176
+
177
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
178
+ if @id !~ pattern
179
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
180
+ end
181
+
182
+ if @email.nil?
183
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
184
+ end
185
+
186
+ if @status.nil?
187
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
188
+ end
189
+
190
+ invalid_properties
191
+ end
192
+
193
+ # Check to see if the all the properties in the model are valid
194
+ # @return true if the model is valid
195
+ def valid?
196
+ warn '[DEPRECATED] the `valid?` method is obsolete'
197
+ return false if @id.nil?
198
+ return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
199
+ return false if @email.nil?
200
+ return false if @status.nil?
201
+ status_validator = EnumAttributeValidator.new('String', ["REGISTERED", "INVITED"])
202
+ return false unless status_validator.valid?(@status)
203
+ true
204
+ end
205
+
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] id Value to be assigned
208
+ def id=(id)
209
+ if id.nil?
210
+ fail ArgumentError, 'id cannot be nil'
211
+ end
212
+
213
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
214
+ if id !~ pattern
215
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
216
+ end
217
+
218
+ @id = id
219
+ end
220
+
221
+ # Custom attribute writer method with validation
222
+ # @param [Object] email Value to be assigned
223
+ def email=(email)
224
+ if email.nil?
225
+ fail ArgumentError, 'email cannot be nil'
226
+ end
227
+
228
+ @email = email
229
+ end
230
+
231
+ # Custom attribute writer method checking allowed values (enum).
232
+ # @param [Object] status Object to be assigned
233
+ def status=(status)
234
+ validator = EnumAttributeValidator.new('String', ["REGISTERED", "INVITED"])
235
+ unless validator.valid?(status)
236
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
237
+ end
238
+ @status = status
239
+ end
240
+
241
+ # Checks equality by comparing each attribute.
242
+ # @param [Object] Object to be compared
243
+ def ==(o)
244
+ return true if self.equal?(o)
245
+ self.class == o.class &&
246
+ id == o.id &&
247
+ email == o.email &&
248
+ name == o.name &&
249
+ active == o.active &&
250
+ role == o.role &&
251
+ status == o.status &&
252
+ created_at == o.created_at &&
253
+ last_login_at == o.last_login_at
254
+ end
255
+
256
+ # @see the `==` method
257
+ # @param [Object] Object to be compared
258
+ def eql?(o)
259
+ self == o
260
+ end
261
+
262
+ # Calculates hash code according to all attributes.
263
+ # @return [Integer] Hash code
264
+ def hash
265
+ [id, email, name, active, role, status, created_at, last_login_at].hash
266
+ end
267
+
268
+ # Builds the object from hash
269
+ # @param [Hash] attributes Model attributes in the form of hash
270
+ # @return [Object] Returns the model itself
271
+ def self.build_from_hash(attributes)
272
+ return nil unless attributes.is_a?(Hash)
273
+ attributes = attributes.transform_keys(&:to_sym)
274
+ transformed_hash = {}
275
+ openapi_types.each_pair do |key, type|
276
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
277
+ transformed_hash["#{key}"] = nil
278
+ elsif type =~ /\AArray<(.*)>/i
279
+ # check to ensure the input is an array given that the attribute
280
+ # is documented as an array but the input is not
281
+ if attributes[attribute_map[key]].is_a?(Array)
282
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
283
+ end
284
+ elsif !attributes[attribute_map[key]].nil?
285
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
286
+ end
287
+ end
288
+ new(transformed_hash)
289
+ end
290
+
291
+ # Deserializes the data based on type
292
+ # @param string type Data type
293
+ # @param string value Value to be deserialized
294
+ # @return [Object] Deserialized data
295
+ def self._deserialize(type, value)
296
+ case type.to_sym
297
+ when :Time
298
+ Time.parse(value)
299
+ when :Date
300
+ Date.parse(value)
301
+ when :String
302
+ value.to_s
303
+ when :Integer
304
+ value.to_i
305
+ when :Float
306
+ value.to_f
307
+ when :Boolean
308
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
309
+ true
310
+ else
311
+ false
312
+ end
313
+ when :Object
314
+ # generic object (usually a Hash), return directly
315
+ value
316
+ when /\AArray<(?<inner_type>.+)>\z/
317
+ inner_type = Regexp.last_match[:inner_type]
318
+ value.map { |v| _deserialize(inner_type, v) }
319
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
320
+ k_type = Regexp.last_match[:k_type]
321
+ v_type = Regexp.last_match[:v_type]
322
+ {}.tap do |hash|
323
+ value.each do |k, v|
324
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
325
+ end
326
+ end
327
+ else # model
328
+ # models (e.g. Pet) or oneOf
329
+ klass = Tremendous.const_get(type)
330
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
331
+ end
332
+ end
333
+
334
+ # Returns the string representation of the object
335
+ # @return [String] String presentation of the object
336
+ def to_s
337
+ to_hash.to_s
338
+ end
339
+
340
+ # to_body is an alias to to_hash (backward compatibility)
341
+ # @return [Hash] Returns the object in the form of hash
342
+ def to_body
343
+ to_hash
344
+ end
345
+
346
+ # Returns the object in the form of hash
347
+ # @return [Hash] Returns the object in the form of hash
348
+ def to_hash
349
+ hash = {}
350
+ self.class.attribute_map.each_pair do |attr, param|
351
+ value = self.send(attr)
352
+ if value.nil?
353
+ is_nullable = self.class.openapi_nullable.include?(attr)
354
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
355
+ end
356
+
357
+ hash[param] = _to_hash(value)
358
+ end
359
+ hash
360
+ end
361
+
362
+ # Outputs non-array value in the form of hash
363
+ # For object, use to_hash. Otherwise, just return the value
364
+ # @param [Object] value Any valid value
365
+ # @return [Hash] Returns the value in the form of hash
366
+ def _to_hash(value)
367
+ if value.is_a?(Array)
368
+ value.compact.map { |v| _to_hash(v) }
369
+ elsif value.is_a?(Hash)
370
+ {}.tap do |hash|
371
+ value.each { |k, v| hash[k] = _to_hash(v) }
372
+ end
373
+ elsif value.respond_to? :to_hash
374
+ value.to_hash
375
+ else
376
+ value
377
+ end
378
+ end
379
+
380
+ end
381
+
382
+ end
@@ -0,0 +1,266 @@
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 ListConnectedOrganizations200Response
18
+ attr_accessor :connected_organizations
19
+
20
+ # The total number of connected organizations across all pages
21
+ attr_accessor :total_count
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'connected_organizations' => :'connected_organizations',
27
+ :'total_count' => :'total_count'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'connected_organizations' => :'Array<ListConnectedOrganizations200ResponseConnectedOrganizationsInner>',
45
+ :'total_count' => :'Integer'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListConnectedOrganizations200Response` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListConnectedOrganizations200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'connected_organizations')
72
+ if (value = attributes[:'connected_organizations']).is_a?(Array)
73
+ self.connected_organizations = value
74
+ end
75
+ else
76
+ self.connected_organizations = nil
77
+ end
78
+
79
+ if attributes.key?(:'total_count')
80
+ self.total_count = attributes[:'total_count']
81
+ else
82
+ self.total_count = nil
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ if @connected_organizations.nil?
92
+ invalid_properties.push('invalid value for "connected_organizations", connected_organizations cannot be nil.')
93
+ end
94
+
95
+ if @total_count.nil?
96
+ invalid_properties.push('invalid value for "total_count", total_count cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if @connected_organizations.nil?
107
+ return false if @total_count.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] connected_organizations Value to be assigned
113
+ def connected_organizations=(connected_organizations)
114
+ if connected_organizations.nil?
115
+ fail ArgumentError, 'connected_organizations cannot be nil'
116
+ end
117
+
118
+ @connected_organizations = connected_organizations
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] total_count Value to be assigned
123
+ def total_count=(total_count)
124
+ if total_count.nil?
125
+ fail ArgumentError, 'total_count cannot be nil'
126
+ end
127
+
128
+ @total_count = total_count
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ connected_organizations == o.connected_organizations &&
137
+ total_count == o.total_count
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [connected_organizations, total_count].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ transformed_hash = {}
159
+ openapi_types.each_pair do |key, type|
160
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = nil
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[attribute_map[key]].is_a?(Array)
166
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
+ end
168
+ elsif !attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
+ end
171
+ end
172
+ new(transformed_hash)
173
+ end
174
+
175
+ # Deserializes the data based on type
176
+ # @param string type Data type
177
+ # @param string value Value to be deserialized
178
+ # @return [Object] Deserialized data
179
+ def self._deserialize(type, value)
180
+ case type.to_sym
181
+ when :Time
182
+ Time.parse(value)
183
+ when :Date
184
+ Date.parse(value)
185
+ when :String
186
+ value.to_s
187
+ when :Integer
188
+ value.to_i
189
+ when :Float
190
+ value.to_f
191
+ when :Boolean
192
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
193
+ true
194
+ else
195
+ false
196
+ end
197
+ when :Object
198
+ # generic object (usually a Hash), return directly
199
+ value
200
+ when /\AArray<(?<inner_type>.+)>\z/
201
+ inner_type = Regexp.last_match[:inner_type]
202
+ value.map { |v| _deserialize(inner_type, v) }
203
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
204
+ k_type = Regexp.last_match[:k_type]
205
+ v_type = Regexp.last_match[:v_type]
206
+ {}.tap do |hash|
207
+ value.each do |k, v|
208
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
209
+ end
210
+ end
211
+ else # model
212
+ # models (e.g. Pet) or oneOf
213
+ klass = Tremendous.const_get(type)
214
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ if value.nil?
237
+ is_nullable = self.class.openapi_nullable.include?(attr)
238
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
239
+ end
240
+
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ end
265
+
266
+ end