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