ifeelgoods 0.0.1

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 (240) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +81 -0
  4. data/README.md +167 -0
  5. data/Rakefile +10 -0
  6. data/docs/Account.md +34 -0
  7. data/docs/AccountsApi.md +84 -0
  8. data/docs/ActivateRedemptionRequest.md +18 -0
  9. data/docs/ActivateRedemptionRequestData.md +18 -0
  10. data/docs/Address.md +32 -0
  11. data/docs/BrandSummary.md +24 -0
  12. data/docs/BudgetLineItem.md +30 -0
  13. data/docs/CardConsultRedemption200Response.md +18 -0
  14. data/docs/CardConsultRedemption200ResponseData.md +20 -0
  15. data/docs/CardConsultRedemption422Response.md +20 -0
  16. data/docs/ClientDetails.md +40 -0
  17. data/docs/ClientSummary.md +40 -0
  18. data/docs/ClientSummaryBudgetAlerts.md +20 -0
  19. data/docs/ClientsApi.md +341 -0
  20. data/docs/CreateAndRedeemRequest.md +18 -0
  21. data/docs/CreateAndRedeemRequestData.md +24 -0
  22. data/docs/CreateRedemption201Response.md +18 -0
  23. data/docs/CreateRedemption422Response.md +20 -0
  24. data/docs/CreateRedemptionRequest.md +18 -0
  25. data/docs/CreateRedemptionRequestData.md +26 -0
  26. data/docs/CreateRedemptionRequestDataCustomization.md +18 -0
  27. data/docs/CreateRedemptionRequestDataCustomizationPdf.md +20 -0
  28. data/docs/CreateRedemptionRequestDataReward.md +18 -0
  29. data/docs/CreateRedemptionRequestDataValue.md +18 -0
  30. data/docs/Dimension.md +44 -0
  31. data/docs/DimensionDenomination.md +49 -0
  32. data/docs/DiscountSummary.md +28 -0
  33. data/docs/ErrorResponse.md +20 -0
  34. data/docs/GetClientBudgetHistory200Response.md +20 -0
  35. data/docs/GetClientById200Response.md +18 -0
  36. data/docs/GetCurrentAccount200Response.md +18 -0
  37. data/docs/GetPromotionByID200Response.md +18 -0
  38. data/docs/GetPromotionByID401Response.md +20 -0
  39. data/docs/GetPromotionByID404Response.md +20 -0
  40. data/docs/GetRedemptionStats200Response.md +20 -0
  41. data/docs/GetRewardBySKU200Response.md +18 -0
  42. data/docs/ListClientDiscounts200Response.md +20 -0
  43. data/docs/ListClientPromotions200Response.md +20 -0
  44. data/docs/ListClientPromotions200ResponsePaging.md +22 -0
  45. data/docs/ListClientPromotions401Response.md +20 -0
  46. data/docs/ListClientVendorPlaces200Response.md +20 -0
  47. data/docs/ListClients200Response.md +20 -0
  48. data/docs/ListRedemptions200Response.md +20 -0
  49. data/docs/ListRewards200Response.md +20 -0
  50. data/docs/ProductSummary.md +26 -0
  51. data/docs/ProductType.md +20 -0
  52. data/docs/PromotionDetails.md +46 -0
  53. data/docs/PromotionDetailsClient.md +20 -0
  54. data/docs/PromotionDetailsRewardsInner.md +28 -0
  55. data/docs/PromotionsApi.md +173 -0
  56. data/docs/Redemption.md +58 -0
  57. data/docs/RedemptionPromotion.md +24 -0
  58. data/docs/RedemptionReward.md +24 -0
  59. data/docs/RedemptionRewardFormat.md +20 -0
  60. data/docs/RedemptionValue.md +20 -0
  61. data/docs/RedemptionsApi.md +857 -0
  62. data/docs/RewardDetails.md +76 -0
  63. data/docs/RewardDetailsBrand.md +24 -0
  64. data/docs/RewardDetailsDimensions.md +44 -0
  65. data/docs/RewardDetailsProduct.md +26 -0
  66. data/docs/RewardDetailsProductType.md +20 -0
  67. data/docs/RewardDetailsTargeting.md +22 -0
  68. data/docs/RewardFormat.md +20 -0
  69. data/docs/RewardsApi.md +175 -0
  70. data/docs/Stats.md +20 -0
  71. data/docs/StatsApi.md +101 -0
  72. data/docs/StatsTimeframe.md +20 -0
  73. data/docs/StatsValuesInner.md +24 -0
  74. data/docs/StatsValuesInnerGroupByInner.md +26 -0
  75. data/docs/StatsValuesInnerStates.md +34 -0
  76. data/docs/User.md +26 -0
  77. data/docs/VendorPlace.md +26 -0
  78. data/docs/VendorPlaceBrand.md +20 -0
  79. data/docs/VendorPlaceGeoloc.md +20 -0
  80. data/docs/VendorPlacesApi.md +97 -0
  81. data/git_push.sh +57 -0
  82. data/ifeelgoods.gemspec +39 -0
  83. data/lib/ifeelgoods/api/accounts_api.rb +79 -0
  84. data/lib/ifeelgoods/api/clients_api.rb +318 -0
  85. data/lib/ifeelgoods/api/promotions_api.rb +166 -0
  86. data/lib/ifeelgoods/api/redemptions_api.rb +762 -0
  87. data/lib/ifeelgoods/api/rewards_api.rb +166 -0
  88. data/lib/ifeelgoods/api/stats_api.rb +111 -0
  89. data/lib/ifeelgoods/api/vendor_places_api.rb +109 -0
  90. data/lib/ifeelgoods/api_client.rb +397 -0
  91. data/lib/ifeelgoods/api_error.rb +58 -0
  92. data/lib/ifeelgoods/api_model_base.rb +88 -0
  93. data/lib/ifeelgoods/configuration.rb +332 -0
  94. data/lib/ifeelgoods/models/account.rb +260 -0
  95. data/lib/ifeelgoods/models/activate_redemption_request.rb +164 -0
  96. data/lib/ifeelgoods/models/activate_redemption_request_data.rb +147 -0
  97. data/lib/ifeelgoods/models/address.rb +219 -0
  98. data/lib/ifeelgoods/models/brand_summary.rb +212 -0
  99. data/lib/ifeelgoods/models/budget_line_item.rb +249 -0
  100. data/lib/ifeelgoods/models/card_consult_redemption200_response.rb +147 -0
  101. data/lib/ifeelgoods/models/card_consult_redemption200_response_data.rb +158 -0
  102. data/lib/ifeelgoods/models/card_consult_redemption422_response.rb +157 -0
  103. data/lib/ifeelgoods/models/client_details.rb +287 -0
  104. data/lib/ifeelgoods/models/client_summary.rb +287 -0
  105. data/lib/ifeelgoods/models/client_summary_budget_alerts.rb +159 -0
  106. data/lib/ifeelgoods/models/create_and_redeem_request.rb +164 -0
  107. data/lib/ifeelgoods/models/create_and_redeem_request_data.rb +174 -0
  108. data/lib/ifeelgoods/models/create_redemption201_response.rb +147 -0
  109. data/lib/ifeelgoods/models/create_redemption422_response.rb +157 -0
  110. data/lib/ifeelgoods/models/create_redemption_request.rb +164 -0
  111. data/lib/ifeelgoods/models/create_redemption_request_data.rb +235 -0
  112. data/lib/ifeelgoods/models/create_redemption_request_data_customization.rb +147 -0
  113. data/lib/ifeelgoods/models/create_redemption_request_data_customization_pdf.rb +157 -0
  114. data/lib/ifeelgoods/models/create_redemption_request_data_reward.rb +147 -0
  115. data/lib/ifeelgoods/models/create_redemption_request_data_value.rb +148 -0
  116. data/lib/ifeelgoods/models/dimension.rb +293 -0
  117. data/lib/ifeelgoods/models/dimension_denomination.rb +105 -0
  118. data/lib/ifeelgoods/models/discount_summary.rb +195 -0
  119. data/lib/ifeelgoods/models/error_response.rb +157 -0
  120. data/lib/ifeelgoods/models/get_client_budget_history200_response.rb +158 -0
  121. data/lib/ifeelgoods/models/get_client_by_id200_response.rb +147 -0
  122. data/lib/ifeelgoods/models/get_current_account200_response.rb +147 -0
  123. data/lib/ifeelgoods/models/get_promotion_by_id200_response.rb +147 -0
  124. data/lib/ifeelgoods/models/get_promotion_by_id401_response.rb +157 -0
  125. data/lib/ifeelgoods/models/get_promotion_by_id404_response.rb +157 -0
  126. data/lib/ifeelgoods/models/get_redemption_stats200_response.rb +158 -0
  127. data/lib/ifeelgoods/models/get_reward_by_sku200_response.rb +147 -0
  128. data/lib/ifeelgoods/models/list_client_discounts200_response.rb +158 -0
  129. data/lib/ifeelgoods/models/list_client_promotions200_response.rb +158 -0
  130. data/lib/ifeelgoods/models/list_client_promotions200_response_paging.rb +165 -0
  131. data/lib/ifeelgoods/models/list_client_promotions401_response.rb +157 -0
  132. data/lib/ifeelgoods/models/list_client_vendor_places200_response.rb +158 -0
  133. data/lib/ifeelgoods/models/list_clients200_response.rb +158 -0
  134. data/lib/ifeelgoods/models/list_redemptions200_response.rb +158 -0
  135. data/lib/ifeelgoods/models/list_rewards200_response.rb +158 -0
  136. data/lib/ifeelgoods/models/product_summary.rb +222 -0
  137. data/lib/ifeelgoods/models/product_type.rb +204 -0
  138. data/lib/ifeelgoods/models/promotion_details.rb +354 -0
  139. data/lib/ifeelgoods/models/promotion_details_client.rb +157 -0
  140. data/lib/ifeelgoods/models/promotion_details_rewards_inner.rb +245 -0
  141. data/lib/ifeelgoods/models/redemption.rb +383 -0
  142. data/lib/ifeelgoods/models/redemption_promotion.rb +211 -0
  143. data/lib/ifeelgoods/models/redemption_reward.rb +224 -0
  144. data/lib/ifeelgoods/models/redemption_reward_format.rb +193 -0
  145. data/lib/ifeelgoods/models/redemption_value.rb +157 -0
  146. data/lib/ifeelgoods/models/reward_details.rb +486 -0
  147. data/lib/ifeelgoods/models/reward_details_brand.rb +213 -0
  148. data/lib/ifeelgoods/models/reward_details_dimensions.rb +293 -0
  149. data/lib/ifeelgoods/models/reward_details_product.rb +222 -0
  150. data/lib/ifeelgoods/models/reward_details_product_type.rb +204 -0
  151. data/lib/ifeelgoods/models/reward_details_targeting.rb +170 -0
  152. data/lib/ifeelgoods/models/reward_format.rb +192 -0
  153. data/lib/ifeelgoods/models/stats.rb +158 -0
  154. data/lib/ifeelgoods/models/stats_timeframe.rb +156 -0
  155. data/lib/ifeelgoods/models/stats_values_inner.rb +178 -0
  156. data/lib/ifeelgoods/models/stats_values_inner_group_by_inner.rb +186 -0
  157. data/lib/ifeelgoods/models/stats_values_inner_states.rb +219 -0
  158. data/lib/ifeelgoods/models/user.rb +188 -0
  159. data/lib/ifeelgoods/models/vendor_place.rb +186 -0
  160. data/lib/ifeelgoods/models/vendor_place_brand.rb +158 -0
  161. data/lib/ifeelgoods/models/vendor_place_geoloc.rb +156 -0
  162. data/lib/ifeelgoods/version.rb +15 -0
  163. data/lib/ifeelgoods.rb +115 -0
  164. data/spec/api/accounts_api_spec.rb +46 -0
  165. data/spec/api/clients_api_spec.rb +88 -0
  166. data/spec/api/promotions_api_spec.rb +61 -0
  167. data/spec/api/redemptions_api_spec.rb +175 -0
  168. data/spec/api/rewards_api_spec.rb +62 -0
  169. data/spec/api/stats_api_spec.rb +53 -0
  170. data/spec/api/vendor_places_api_spec.rb +51 -0
  171. data/spec/models/account_spec.rb +88 -0
  172. data/spec/models/activate_redemption_request_data_spec.rb +36 -0
  173. data/spec/models/activate_redemption_request_spec.rb +36 -0
  174. data/spec/models/address_spec.rb +78 -0
  175. data/spec/models/brand_summary_spec.rb +58 -0
  176. data/spec/models/budget_line_item_spec.rb +80 -0
  177. data/spec/models/card_consult_redemption200_response_data_spec.rb +42 -0
  178. data/spec/models/card_consult_redemption200_response_spec.rb +36 -0
  179. data/spec/models/card_consult_redemption422_response_spec.rb +42 -0
  180. data/spec/models/client_details_spec.rb +106 -0
  181. data/spec/models/client_summary_budget_alerts_spec.rb +42 -0
  182. data/spec/models/client_summary_spec.rb +106 -0
  183. data/spec/models/create_and_redeem_request_data_spec.rb +54 -0
  184. data/spec/models/create_and_redeem_request_spec.rb +36 -0
  185. data/spec/models/create_redemption201_response_spec.rb +36 -0
  186. data/spec/models/create_redemption422_response_spec.rb +42 -0
  187. data/spec/models/create_redemption_request_data_customization_pdf_spec.rb +42 -0
  188. data/spec/models/create_redemption_request_data_customization_spec.rb +36 -0
  189. data/spec/models/create_redemption_request_data_reward_spec.rb +36 -0
  190. data/spec/models/create_redemption_request_data_spec.rb +60 -0
  191. data/spec/models/create_redemption_request_data_value_spec.rb +36 -0
  192. data/spec/models/create_redemption_request_spec.rb +36 -0
  193. data/spec/models/dimension_denomination_spec.rb +32 -0
  194. data/spec/models/dimension_spec.rb +114 -0
  195. data/spec/models/discount_summary_spec.rb +66 -0
  196. data/spec/models/error_response_spec.rb +42 -0
  197. data/spec/models/get_client_budget_history200_response_spec.rb +42 -0
  198. data/spec/models/get_client_by_id200_response_spec.rb +36 -0
  199. data/spec/models/get_current_account200_response_spec.rb +36 -0
  200. data/spec/models/get_promotion_by_id200_response_spec.rb +36 -0
  201. data/spec/models/get_promotion_by_id401_response_spec.rb +42 -0
  202. data/spec/models/get_promotion_by_id404_response_spec.rb +42 -0
  203. data/spec/models/get_redemption_stats200_response_spec.rb +42 -0
  204. data/spec/models/get_reward_by_sku200_response_spec.rb +36 -0
  205. data/spec/models/list_client_discounts200_response_spec.rb +42 -0
  206. data/spec/models/list_client_promotions200_response_paging_spec.rb +48 -0
  207. data/spec/models/list_client_promotions200_response_spec.rb +42 -0
  208. data/spec/models/list_client_promotions401_response_spec.rb +42 -0
  209. data/spec/models/list_client_vendor_places200_response_spec.rb +42 -0
  210. data/spec/models/list_clients200_response_spec.rb +42 -0
  211. data/spec/models/list_redemptions200_response_spec.rb +42 -0
  212. data/spec/models/list_rewards200_response_spec.rb +42 -0
  213. data/spec/models/product_summary_spec.rb +64 -0
  214. data/spec/models/product_type_spec.rb +50 -0
  215. data/spec/models/promotion_details_client_spec.rb +42 -0
  216. data/spec/models/promotion_details_rewards_inner_spec.rb +78 -0
  217. data/spec/models/promotion_details_spec.rb +136 -0
  218. data/spec/models/redemption_promotion_spec.rb +58 -0
  219. data/spec/models/redemption_reward_format_spec.rb +50 -0
  220. data/spec/models/redemption_reward_spec.rb +62 -0
  221. data/spec/models/redemption_spec.rb +168 -0
  222. data/spec/models/redemption_value_spec.rb +42 -0
  223. data/spec/models/reward_details_brand_spec.rb +58 -0
  224. data/spec/models/reward_details_dimensions_spec.rb +114 -0
  225. data/spec/models/reward_details_product_spec.rb +64 -0
  226. data/spec/models/reward_details_product_type_spec.rb +50 -0
  227. data/spec/models/reward_details_spec.rb +218 -0
  228. data/spec/models/reward_details_targeting_spec.rb +48 -0
  229. data/spec/models/reward_format_spec.rb +50 -0
  230. data/spec/models/stats_spec.rb +42 -0
  231. data/spec/models/stats_timeframe_spec.rb +42 -0
  232. data/spec/models/stats_values_inner_group_by_inner_spec.rb +60 -0
  233. data/spec/models/stats_values_inner_spec.rb +54 -0
  234. data/spec/models/stats_values_inner_states_spec.rb +84 -0
  235. data/spec/models/user_spec.rb +60 -0
  236. data/spec/models/vendor_place_brand_spec.rb +42 -0
  237. data/spec/models/vendor_place_geoloc_spec.rb +42 -0
  238. data/spec/models/vendor_place_spec.rb +60 -0
  239. data/spec/spec_helper.rb +111 -0
  240. metadata +397 -0
@@ -0,0 +1,486 @@
1
+ =begin
2
+ #Fulfillment API
3
+
4
+ #Public API exposed to ifeelgoods customers.
5
+
6
+ The version of the OpenAPI document: v2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Ifeelgoods
17
+ # A Reward (aka Product SKU) is a specific denomination of a Digital or Physical Gift that can be delivered to a User. \"iTunes Code 10$ (US)\" is a Reward.
18
+ class RewardDetails < ApiModelBase
19
+ # Reward name (eg. `$10 iTunes® Code`).
20
+ attr_accessor :name
21
+
22
+ # Unique identifier that represents the reward (eg. `APP-ITC-10USD-US`). It must be used with the redeem APIs.
23
+ attr_accessor :sku
24
+
25
+ # Reward formatted value with currency (eg. `$10`).
26
+ attr_accessor :denomination
27
+
28
+ attr_accessor :display_value
29
+
30
+ # Indicates whether the reward should be redeemed with a value. Range can be found in dimensions.available_denominations_range.
31
+ attr_accessor :free_value
32
+
33
+ # Reward cost for your account (eg. `9.0`). You need to query the API with the `client_id` parameter to retrieve the acutal cost, otherwise it will return `face_value`.
34
+ attr_accessor :cost
35
+
36
+ # Reward cost currency (eg. `USD`, `EUR`).
37
+ attr_accessor :cost_currency
38
+
39
+ # Reward face value, actual reward amount (e.g. `10.00`).
40
+ attr_accessor :face_value
41
+
42
+ # Reward face value currency. (eg. `EUR`).
43
+ attr_accessor :face_value_currency
44
+
45
+ # Boolean that represent reward availability.
46
+ attr_accessor :in_stock
47
+
48
+ # Stock quantity. Can be `null` (if `stock_quantity` is `null`, `in_stock` is always `true`).
49
+ attr_accessor :stock_quantity
50
+
51
+ attr_accessor :brand
52
+
53
+ attr_accessor :product
54
+
55
+ attr_accessor :product_type
56
+
57
+ # Reward code format
58
+ attr_accessor :usages
59
+
60
+ # Expiration date (eg. `2023-03-31`)
61
+ attr_accessor :expiration_date
62
+
63
+ # Reward categories (eg. `['Games & Entertainment', 'Sports']`) (not maintained).
64
+ attr_accessor :categories
65
+
66
+ # Reward description.
67
+ attr_accessor :description
68
+
69
+ # Reward country list (eg. `[\"US\", \"CA\"]` or `[\"WW\"]` if worldwide). If the reward is not specific to a country, it will be considered as worldwide.
70
+ attr_accessor :country
71
+
72
+ attr_accessor :conditions_of_sale
73
+
74
+ attr_accessor :dimensions
75
+
76
+ # Reward tags (not maintained).
77
+ attr_accessor :tags
78
+
79
+ attr_accessor :targeting
80
+
81
+ # Reward image, without scheme (eg. `//cdn.ifeelgoods.com/image.png`).
82
+ attr_accessor :catalog_badge_url
83
+
84
+ # (legacy) Reward image (same as catalog_badge_url).
85
+ attr_accessor :catalog_card_url
86
+
87
+ # Brand logo, without scheme (eg. `//cdn.ifeelgoods.com/logo.png`).
88
+ attr_accessor :logo_url
89
+
90
+ # Reward 'Terms and Conditions' URL (when provided by brand, `null` otherwise).
91
+ attr_accessor :terms_and_conditions_url
92
+
93
+ # Reward 'Terms and Conditions'.
94
+ attr_accessor :terms_and_conditions
95
+
96
+ # Reward 'How to use' instructions.
97
+ attr_accessor :how_to_use_instructions
98
+
99
+ # Reward additional information.
100
+ attr_accessor :important_instructions
101
+
102
+ class EnumAttributeValidator
103
+ attr_reader :datatype
104
+ attr_reader :allowable_values
105
+
106
+ def initialize(datatype, allowable_values)
107
+ @allowable_values = allowable_values.map do |value|
108
+ case datatype.to_s
109
+ when /Integer/i
110
+ value.to_i
111
+ when /Float/i
112
+ value.to_f
113
+ else
114
+ value
115
+ end
116
+ end
117
+ end
118
+
119
+ def valid?(value)
120
+ !value || allowable_values.include?(value)
121
+ end
122
+ end
123
+
124
+ # Attribute mapping from ruby-style variable name to JSON key.
125
+ def self.attribute_map
126
+ {
127
+ :'name' => :'name',
128
+ :'sku' => :'sku',
129
+ :'denomination' => :'denomination',
130
+ :'display_value' => :'display_value',
131
+ :'free_value' => :'free_value',
132
+ :'cost' => :'cost',
133
+ :'cost_currency' => :'cost_currency',
134
+ :'face_value' => :'face_value',
135
+ :'face_value_currency' => :'face_value_currency',
136
+ :'in_stock' => :'in_stock',
137
+ :'stock_quantity' => :'stock_quantity',
138
+ :'brand' => :'brand',
139
+ :'product' => :'product',
140
+ :'product_type' => :'product_type',
141
+ :'usages' => :'usages',
142
+ :'expiration_date' => :'expiration_date',
143
+ :'categories' => :'categories',
144
+ :'description' => :'description',
145
+ :'country' => :'country',
146
+ :'conditions_of_sale' => :'conditions_of_sale',
147
+ :'dimensions' => :'dimensions',
148
+ :'tags' => :'tags',
149
+ :'targeting' => :'targeting',
150
+ :'catalog_badge_url' => :'catalog_badge_url',
151
+ :'catalog_card_url' => :'catalog_card_url',
152
+ :'logo_url' => :'logo_url',
153
+ :'terms_and_conditions_url' => :'terms_and_conditions_url',
154
+ :'terms_and_conditions' => :'terms_and_conditions',
155
+ :'how_to_use_instructions' => :'how_to_use_instructions',
156
+ :'important_instructions' => :'important_instructions'
157
+ }
158
+ end
159
+
160
+ # Returns attribute mapping this model knows about
161
+ def self.acceptable_attribute_map
162
+ attribute_map
163
+ end
164
+
165
+ # Returns all the JSON keys this model knows about
166
+ def self.acceptable_attributes
167
+ acceptable_attribute_map.values
168
+ end
169
+
170
+ # Attribute type mapping.
171
+ def self.openapi_types
172
+ {
173
+ :'name' => :'String',
174
+ :'sku' => :'String',
175
+ :'denomination' => :'String',
176
+ :'display_value' => :'String',
177
+ :'free_value' => :'Boolean',
178
+ :'cost' => :'Float',
179
+ :'cost_currency' => :'String',
180
+ :'face_value' => :'String',
181
+ :'face_value_currency' => :'String',
182
+ :'in_stock' => :'Boolean',
183
+ :'stock_quantity' => :'Integer',
184
+ :'brand' => :'RewardDetailsBrand',
185
+ :'product' => :'RewardDetailsProduct',
186
+ :'product_type' => :'RewardDetailsProductType',
187
+ :'usages' => :'Array<String>',
188
+ :'expiration_date' => :'String',
189
+ :'categories' => :'Array<String>',
190
+ :'description' => :'String',
191
+ :'country' => :'Array<String>',
192
+ :'conditions_of_sale' => :'String',
193
+ :'dimensions' => :'RewardDetailsDimensions',
194
+ :'tags' => :'Array<String>',
195
+ :'targeting' => :'RewardDetailsTargeting',
196
+ :'catalog_badge_url' => :'String',
197
+ :'catalog_card_url' => :'String',
198
+ :'logo_url' => :'String',
199
+ :'terms_and_conditions_url' => :'String',
200
+ :'terms_and_conditions' => :'String',
201
+ :'how_to_use_instructions' => :'String',
202
+ :'important_instructions' => :'String'
203
+ }
204
+ end
205
+
206
+ # List of attributes with nullable: true
207
+ def self.openapi_nullable
208
+ Set.new([
209
+ :'cost',
210
+ :'stock_quantity',
211
+ :'expiration_date',
212
+ :'description',
213
+ :'conditions_of_sale',
214
+ :'catalog_badge_url',
215
+ :'catalog_card_url',
216
+ :'logo_url',
217
+ :'terms_and_conditions_url',
218
+ :'terms_and_conditions',
219
+ :'how_to_use_instructions',
220
+ :'important_instructions'
221
+ ])
222
+ end
223
+
224
+ # Initializes the object
225
+ # @param [Hash] attributes Model attributes in the form of hash
226
+ def initialize(attributes = {})
227
+ if (!attributes.is_a?(Hash))
228
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ifeelgoods::RewardDetails` initialize method"
229
+ end
230
+
231
+ # check to see if the attribute exists and convert string to symbol for hash key
232
+ acceptable_attribute_map = self.class.acceptable_attribute_map
233
+ attributes = attributes.each_with_object({}) { |(k, v), h|
234
+ if (!acceptable_attribute_map.key?(k.to_sym))
235
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ifeelgoods::RewardDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
236
+ end
237
+ h[k.to_sym] = v
238
+ }
239
+
240
+ if attributes.key?(:'name')
241
+ self.name = attributes[:'name']
242
+ end
243
+
244
+ if attributes.key?(:'sku')
245
+ self.sku = attributes[:'sku']
246
+ end
247
+
248
+ if attributes.key?(:'denomination')
249
+ self.denomination = attributes[:'denomination']
250
+ end
251
+
252
+ if attributes.key?(:'display_value')
253
+ self.display_value = attributes[:'display_value']
254
+ end
255
+
256
+ if attributes.key?(:'free_value')
257
+ self.free_value = attributes[:'free_value']
258
+ end
259
+
260
+ if attributes.key?(:'cost')
261
+ self.cost = attributes[:'cost']
262
+ end
263
+
264
+ if attributes.key?(:'cost_currency')
265
+ self.cost_currency = attributes[:'cost_currency']
266
+ end
267
+
268
+ if attributes.key?(:'face_value')
269
+ self.face_value = attributes[:'face_value']
270
+ end
271
+
272
+ if attributes.key?(:'face_value_currency')
273
+ self.face_value_currency = attributes[:'face_value_currency']
274
+ end
275
+
276
+ if attributes.key?(:'in_stock')
277
+ self.in_stock = attributes[:'in_stock']
278
+ end
279
+
280
+ if attributes.key?(:'stock_quantity')
281
+ self.stock_quantity = attributes[:'stock_quantity']
282
+ end
283
+
284
+ if attributes.key?(:'brand')
285
+ self.brand = attributes[:'brand']
286
+ end
287
+
288
+ if attributes.key?(:'product')
289
+ self.product = attributes[:'product']
290
+ end
291
+
292
+ if attributes.key?(:'product_type')
293
+ self.product_type = attributes[:'product_type']
294
+ end
295
+
296
+ if attributes.key?(:'usages')
297
+ if (value = attributes[:'usages']).is_a?(Array)
298
+ self.usages = value
299
+ end
300
+ end
301
+
302
+ if attributes.key?(:'expiration_date')
303
+ self.expiration_date = attributes[:'expiration_date']
304
+ end
305
+
306
+ if attributes.key?(:'categories')
307
+ if (value = attributes[:'categories']).is_a?(Array)
308
+ self.categories = value
309
+ end
310
+ end
311
+
312
+ if attributes.key?(:'description')
313
+ self.description = attributes[:'description']
314
+ end
315
+
316
+ if attributes.key?(:'country')
317
+ if (value = attributes[:'country']).is_a?(Array)
318
+ self.country = value
319
+ end
320
+ end
321
+
322
+ if attributes.key?(:'conditions_of_sale')
323
+ self.conditions_of_sale = attributes[:'conditions_of_sale']
324
+ end
325
+
326
+ if attributes.key?(:'dimensions')
327
+ self.dimensions = attributes[:'dimensions']
328
+ end
329
+
330
+ if attributes.key?(:'tags')
331
+ if (value = attributes[:'tags']).is_a?(Array)
332
+ self.tags = value
333
+ end
334
+ end
335
+
336
+ if attributes.key?(:'targeting')
337
+ self.targeting = attributes[:'targeting']
338
+ end
339
+
340
+ if attributes.key?(:'catalog_badge_url')
341
+ self.catalog_badge_url = attributes[:'catalog_badge_url']
342
+ end
343
+
344
+ if attributes.key?(:'catalog_card_url')
345
+ self.catalog_card_url = attributes[:'catalog_card_url']
346
+ end
347
+
348
+ if attributes.key?(:'logo_url')
349
+ self.logo_url = attributes[:'logo_url']
350
+ end
351
+
352
+ if attributes.key?(:'terms_and_conditions_url')
353
+ self.terms_and_conditions_url = attributes[:'terms_and_conditions_url']
354
+ end
355
+
356
+ if attributes.key?(:'terms_and_conditions')
357
+ self.terms_and_conditions = attributes[:'terms_and_conditions']
358
+ end
359
+
360
+ if attributes.key?(:'how_to_use_instructions')
361
+ self.how_to_use_instructions = attributes[:'how_to_use_instructions']
362
+ end
363
+
364
+ if attributes.key?(:'important_instructions')
365
+ self.important_instructions = attributes[:'important_instructions']
366
+ end
367
+ end
368
+
369
+ # Show invalid properties with the reasons. Usually used together with valid?
370
+ # @return Array for valid properties with the reasons
371
+ def list_invalid_properties
372
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
373
+ invalid_properties = Array.new
374
+ invalid_properties
375
+ end
376
+
377
+ # Check to see if the all the properties in the model are valid
378
+ # @return true if the model is valid
379
+ def valid?
380
+ warn '[DEPRECATED] the `valid?` method is obsolete'
381
+ conditions_of_sale_validator = EnumAttributeValidator.new('String', ["on_demand", "special_order_only"])
382
+ return false unless conditions_of_sale_validator.valid?(@conditions_of_sale)
383
+ true
384
+ end
385
+
386
+ # Custom attribute writer method checking allowed values (enum).
387
+ # @param [Object] conditions_of_sale Object to be assigned
388
+ def conditions_of_sale=(conditions_of_sale)
389
+ validator = EnumAttributeValidator.new('String', ["on_demand", "special_order_only"])
390
+ unless validator.valid?(conditions_of_sale)
391
+ fail ArgumentError, "invalid value for \"conditions_of_sale\", must be one of #{validator.allowable_values}."
392
+ end
393
+ @conditions_of_sale = conditions_of_sale
394
+ end
395
+
396
+ # Checks equality by comparing each attribute.
397
+ # @param [Object] Object to be compared
398
+ def ==(o)
399
+ return true if self.equal?(o)
400
+ self.class == o.class &&
401
+ name == o.name &&
402
+ sku == o.sku &&
403
+ denomination == o.denomination &&
404
+ display_value == o.display_value &&
405
+ free_value == o.free_value &&
406
+ cost == o.cost &&
407
+ cost_currency == o.cost_currency &&
408
+ face_value == o.face_value &&
409
+ face_value_currency == o.face_value_currency &&
410
+ in_stock == o.in_stock &&
411
+ stock_quantity == o.stock_quantity &&
412
+ brand == o.brand &&
413
+ product == o.product &&
414
+ product_type == o.product_type &&
415
+ usages == o.usages &&
416
+ expiration_date == o.expiration_date &&
417
+ categories == o.categories &&
418
+ description == o.description &&
419
+ country == o.country &&
420
+ conditions_of_sale == o.conditions_of_sale &&
421
+ dimensions == o.dimensions &&
422
+ tags == o.tags &&
423
+ targeting == o.targeting &&
424
+ catalog_badge_url == o.catalog_badge_url &&
425
+ catalog_card_url == o.catalog_card_url &&
426
+ logo_url == o.logo_url &&
427
+ terms_and_conditions_url == o.terms_and_conditions_url &&
428
+ terms_and_conditions == o.terms_and_conditions &&
429
+ how_to_use_instructions == o.how_to_use_instructions &&
430
+ important_instructions == o.important_instructions
431
+ end
432
+
433
+ # @see the `==` method
434
+ # @param [Object] Object to be compared
435
+ def eql?(o)
436
+ self == o
437
+ end
438
+
439
+ # Calculates hash code according to all attributes.
440
+ # @return [Integer] Hash code
441
+ def hash
442
+ [name, sku, denomination, display_value, free_value, cost, cost_currency, face_value, face_value_currency, in_stock, stock_quantity, brand, product, product_type, usages, expiration_date, categories, description, country, conditions_of_sale, dimensions, tags, targeting, catalog_badge_url, catalog_card_url, logo_url, terms_and_conditions_url, terms_and_conditions, how_to_use_instructions, important_instructions].hash
443
+ end
444
+
445
+ # Builds the object from hash
446
+ # @param [Hash] attributes Model attributes in the form of hash
447
+ # @return [Object] Returns the model itself
448
+ def self.build_from_hash(attributes)
449
+ return nil unless attributes.is_a?(Hash)
450
+ attributes = attributes.transform_keys(&:to_sym)
451
+ transformed_hash = {}
452
+ openapi_types.each_pair do |key, type|
453
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
454
+ transformed_hash["#{key}"] = nil
455
+ elsif type =~ /\AArray<(.*)>/i
456
+ # check to ensure the input is an array given that the attribute
457
+ # is documented as an array but the input is not
458
+ if attributes[attribute_map[key]].is_a?(Array)
459
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
460
+ end
461
+ elsif !attributes[attribute_map[key]].nil?
462
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
463
+ end
464
+ end
465
+ new(transformed_hash)
466
+ end
467
+
468
+ # Returns the object in the form of hash
469
+ # @return [Hash] Returns the object in the form of hash
470
+ def to_hash
471
+ hash = {}
472
+ self.class.attribute_map.each_pair do |attr, param|
473
+ value = self.send(attr)
474
+ if value.nil?
475
+ is_nullable = self.class.openapi_nullable.include?(attr)
476
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
477
+ end
478
+
479
+ hash[param] = _to_hash(value)
480
+ end
481
+ hash
482
+ end
483
+
484
+ end
485
+
486
+ end
@@ -0,0 +1,213 @@
1
+ =begin
2
+ #Fulfillment API
3
+
4
+ #Public API exposed to ifeelgoods customers.
5
+
6
+ The version of the OpenAPI document: v2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Ifeelgoods
17
+ # Reward brand. In ifeelgoods data model, it's a kind of 'parent' for the product.
18
+ class RewardDetailsBrand < ApiModelBase
19
+ # Unique identifier that represents the brand (eg. `APP`).
20
+ attr_accessor :id
21
+
22
+ # Brand name (eg. `iTunes`).
23
+ attr_accessor :name
24
+
25
+ attr_accessor :status
26
+
27
+ # Brand URL (eg. `https://www.ifeelgoods.com`).
28
+ attr_accessor :url
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'id' => :'id',
56
+ :'name' => :'name',
57
+ :'status' => :'status',
58
+ :'url' => :'url'
59
+ }
60
+ end
61
+
62
+ # Returns attribute mapping this model knows about
63
+ def self.acceptable_attribute_map
64
+ attribute_map
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ acceptable_attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'id' => :'String',
76
+ :'name' => :'String',
77
+ :'status' => :'String',
78
+ :'url' => :'String'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ :'url'
86
+ ])
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ifeelgoods::RewardDetailsBrand` initialize method"
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ acceptable_attribute_map = self.class.acceptable_attribute_map
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!acceptable_attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ifeelgoods::RewardDetailsBrand`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'id')
106
+ self.id = attributes[:'id']
107
+ end
108
+
109
+ if attributes.key?(:'name')
110
+ self.name = attributes[:'name']
111
+ end
112
+
113
+ if attributes.key?(:'status')
114
+ self.status = attributes[:'status']
115
+ end
116
+
117
+ if attributes.key?(:'url')
118
+ self.url = attributes[:'url']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
126
+ invalid_properties = Array.new
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ warn '[DEPRECATED] the `valid?` method is obsolete'
134
+ status_validator = EnumAttributeValidator.new('String', ["active", "deactivated"])
135
+ return false unless status_validator.valid?(@status)
136
+ true
137
+ end
138
+
139
+ # Custom attribute writer method checking allowed values (enum).
140
+ # @param [Object] status Object to be assigned
141
+ def status=(status)
142
+ validator = EnumAttributeValidator.new('String', ["active", "deactivated"])
143
+ unless validator.valid?(status)
144
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
145
+ end
146
+ @status = status
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ id == o.id &&
155
+ name == o.name &&
156
+ status == o.status &&
157
+ url == o.url
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [id, name, status, url].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ transformed_hash = {}
179
+ openapi_types.each_pair do |key, type|
180
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = nil
182
+ elsif type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[attribute_map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
187
+ end
188
+ elsif !attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
190
+ end
191
+ end
192
+ new(transformed_hash)
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ end
212
+
213
+ end