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,240 @@
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 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 all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'connected_organizations' => :'Array<ListConnectedOrganizations200ResponseConnectedOrganizationsInner>',
40
+ :'total_count' => :'Integer'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListConnectedOrganizations200Response` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListConnectedOrganizations200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'connected_organizations')
66
+ if (value = attributes[:'connected_organizations']).is_a?(Array)
67
+ self.connected_organizations = value
68
+ end
69
+ else
70
+ self.connected_organizations = nil
71
+ end
72
+
73
+ if attributes.key?(:'total_count')
74
+ self.total_count = attributes[:'total_count']
75
+ else
76
+ self.total_count = nil
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ if @connected_organizations.nil?
86
+ invalid_properties.push('invalid value for "connected_organizations", connected_organizations cannot be nil.')
87
+ end
88
+
89
+ if @total_count.nil?
90
+ invalid_properties.push('invalid value for "total_count", total_count cannot be nil.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ return false if @connected_organizations.nil?
101
+ return false if @total_count.nil?
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ connected_organizations == o.connected_organizations &&
111
+ total_count == o.total_count
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [connected_organizations, total_count].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def self._deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = Tremendous.const_get(type)
188
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -0,0 +1,287 @@
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 ListConnectedOrganizations200ResponseConnectedOrganizationsInner
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 all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'id' => :'String',
48
+ :'client_id' => :'String',
49
+ :'created_at' => :'Time',
50
+ :'organization' => :'ListConnectedOrganizations200ResponseConnectedOrganizationsInnerOrganization'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ :'organization'
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListConnectedOrganizations200ResponseConnectedOrganizationsInner` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListConnectedOrganizations200ResponseConnectedOrganizationsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'id')
77
+ self.id = attributes[:'id']
78
+ else
79
+ self.id = nil
80
+ end
81
+
82
+ if attributes.key?(:'client_id')
83
+ self.client_id = attributes[:'client_id']
84
+ else
85
+ self.client_id = nil
86
+ end
87
+
88
+ if attributes.key?(:'created_at')
89
+ self.created_at = attributes[:'created_at']
90
+ else
91
+ self.created_at = nil
92
+ end
93
+
94
+ if attributes.key?(:'organization')
95
+ self.organization = attributes[:'organization']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
103
+ invalid_properties = Array.new
104
+ if @id.nil?
105
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
106
+ end
107
+
108
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
109
+ if @id !~ pattern
110
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
111
+ end
112
+
113
+ if @client_id.nil?
114
+ invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
115
+ end
116
+
117
+ if @created_at.nil?
118
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
119
+ end
120
+
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ warn '[DEPRECATED] the `valid?` method is obsolete'
128
+ return false if @id.nil?
129
+ return false if @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
130
+ return false if @client_id.nil?
131
+ return false if @created_at.nil?
132
+ true
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] id Value to be assigned
137
+ def id=(id)
138
+ if id.nil?
139
+ fail ArgumentError, 'id cannot be nil'
140
+ end
141
+
142
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
143
+ if id !~ pattern
144
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
145
+ end
146
+
147
+ @id = id
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ id == o.id &&
156
+ client_id == o.client_id &&
157
+ created_at == o.created_at &&
158
+ organization == o.organization
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [id, client_id, created_at, organization].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ return nil unless attributes.is_a?(Hash)
178
+ attributes = attributes.transform_keys(&:to_sym)
179
+ transformed_hash = {}
180
+ openapi_types.each_pair do |key, type|
181
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = nil
183
+ elsif type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[attribute_map[key]].is_a?(Array)
187
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
188
+ end
189
+ elsif !attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
191
+ end
192
+ end
193
+ new(transformed_hash)
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def self._deserialize(type, value)
201
+ case type.to_sym
202
+ when :Time
203
+ Time.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :Boolean
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ # models (e.g. Pet) or oneOf
234
+ klass = Tremendous.const_get(type)
235
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ # Outputs non-array value in the form of hash
268
+ # For object, use to_hash. Otherwise, just return the value
269
+ # @param [Object] value Any valid value
270
+ # @return [Hash] Returns the value in the form of hash
271
+ def _to_hash(value)
272
+ if value.is_a?(Array)
273
+ value.compact.map { |v| _to_hash(v) }
274
+ elsif value.is_a?(Hash)
275
+ {}.tap do |hash|
276
+ value.each { |k, v| hash[k] = _to_hash(v) }
277
+ end
278
+ elsif value.respond_to? :to_hash
279
+ value.to_hash
280
+ else
281
+ value
282
+ end
283
+ end
284
+
285
+ end
286
+
287
+ end