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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +81 -0
- data/README.md +167 -0
- data/Rakefile +10 -0
- data/docs/Account.md +34 -0
- data/docs/AccountsApi.md +84 -0
- data/docs/ActivateRedemptionRequest.md +18 -0
- data/docs/ActivateRedemptionRequestData.md +18 -0
- data/docs/Address.md +32 -0
- data/docs/BrandSummary.md +24 -0
- data/docs/BudgetLineItem.md +30 -0
- data/docs/CardConsultRedemption200Response.md +18 -0
- data/docs/CardConsultRedemption200ResponseData.md +20 -0
- data/docs/CardConsultRedemption422Response.md +20 -0
- data/docs/ClientDetails.md +40 -0
- data/docs/ClientSummary.md +40 -0
- data/docs/ClientSummaryBudgetAlerts.md +20 -0
- data/docs/ClientsApi.md +341 -0
- data/docs/CreateAndRedeemRequest.md +18 -0
- data/docs/CreateAndRedeemRequestData.md +24 -0
- data/docs/CreateRedemption201Response.md +18 -0
- data/docs/CreateRedemption422Response.md +20 -0
- data/docs/CreateRedemptionRequest.md +18 -0
- data/docs/CreateRedemptionRequestData.md +26 -0
- data/docs/CreateRedemptionRequestDataCustomization.md +18 -0
- data/docs/CreateRedemptionRequestDataCustomizationPdf.md +20 -0
- data/docs/CreateRedemptionRequestDataReward.md +18 -0
- data/docs/CreateRedemptionRequestDataValue.md +18 -0
- data/docs/Dimension.md +44 -0
- data/docs/DimensionDenomination.md +49 -0
- data/docs/DiscountSummary.md +28 -0
- data/docs/ErrorResponse.md +20 -0
- data/docs/GetClientBudgetHistory200Response.md +20 -0
- data/docs/GetClientById200Response.md +18 -0
- data/docs/GetCurrentAccount200Response.md +18 -0
- data/docs/GetPromotionByID200Response.md +18 -0
- data/docs/GetPromotionByID401Response.md +20 -0
- data/docs/GetPromotionByID404Response.md +20 -0
- data/docs/GetRedemptionStats200Response.md +20 -0
- data/docs/GetRewardBySKU200Response.md +18 -0
- data/docs/ListClientDiscounts200Response.md +20 -0
- data/docs/ListClientPromotions200Response.md +20 -0
- data/docs/ListClientPromotions200ResponsePaging.md +22 -0
- data/docs/ListClientPromotions401Response.md +20 -0
- data/docs/ListClientVendorPlaces200Response.md +20 -0
- data/docs/ListClients200Response.md +20 -0
- data/docs/ListRedemptions200Response.md +20 -0
- data/docs/ListRewards200Response.md +20 -0
- data/docs/ProductSummary.md +26 -0
- data/docs/ProductType.md +20 -0
- data/docs/PromotionDetails.md +46 -0
- data/docs/PromotionDetailsClient.md +20 -0
- data/docs/PromotionDetailsRewardsInner.md +28 -0
- data/docs/PromotionsApi.md +173 -0
- data/docs/Redemption.md +58 -0
- data/docs/RedemptionPromotion.md +24 -0
- data/docs/RedemptionReward.md +24 -0
- data/docs/RedemptionRewardFormat.md +20 -0
- data/docs/RedemptionValue.md +20 -0
- data/docs/RedemptionsApi.md +857 -0
- data/docs/RewardDetails.md +76 -0
- data/docs/RewardDetailsBrand.md +24 -0
- data/docs/RewardDetailsDimensions.md +44 -0
- data/docs/RewardDetailsProduct.md +26 -0
- data/docs/RewardDetailsProductType.md +20 -0
- data/docs/RewardDetailsTargeting.md +22 -0
- data/docs/RewardFormat.md +20 -0
- data/docs/RewardsApi.md +175 -0
- data/docs/Stats.md +20 -0
- data/docs/StatsApi.md +101 -0
- data/docs/StatsTimeframe.md +20 -0
- data/docs/StatsValuesInner.md +24 -0
- data/docs/StatsValuesInnerGroupByInner.md +26 -0
- data/docs/StatsValuesInnerStates.md +34 -0
- data/docs/User.md +26 -0
- data/docs/VendorPlace.md +26 -0
- data/docs/VendorPlaceBrand.md +20 -0
- data/docs/VendorPlaceGeoloc.md +20 -0
- data/docs/VendorPlacesApi.md +97 -0
- data/git_push.sh +57 -0
- data/ifeelgoods.gemspec +39 -0
- data/lib/ifeelgoods/api/accounts_api.rb +79 -0
- data/lib/ifeelgoods/api/clients_api.rb +318 -0
- data/lib/ifeelgoods/api/promotions_api.rb +166 -0
- data/lib/ifeelgoods/api/redemptions_api.rb +762 -0
- data/lib/ifeelgoods/api/rewards_api.rb +166 -0
- data/lib/ifeelgoods/api/stats_api.rb +111 -0
- data/lib/ifeelgoods/api/vendor_places_api.rb +109 -0
- data/lib/ifeelgoods/api_client.rb +397 -0
- data/lib/ifeelgoods/api_error.rb +58 -0
- data/lib/ifeelgoods/api_model_base.rb +88 -0
- data/lib/ifeelgoods/configuration.rb +332 -0
- data/lib/ifeelgoods/models/account.rb +260 -0
- data/lib/ifeelgoods/models/activate_redemption_request.rb +164 -0
- data/lib/ifeelgoods/models/activate_redemption_request_data.rb +147 -0
- data/lib/ifeelgoods/models/address.rb +219 -0
- data/lib/ifeelgoods/models/brand_summary.rb +212 -0
- data/lib/ifeelgoods/models/budget_line_item.rb +249 -0
- data/lib/ifeelgoods/models/card_consult_redemption200_response.rb +147 -0
- data/lib/ifeelgoods/models/card_consult_redemption200_response_data.rb +158 -0
- data/lib/ifeelgoods/models/card_consult_redemption422_response.rb +157 -0
- data/lib/ifeelgoods/models/client_details.rb +287 -0
- data/lib/ifeelgoods/models/client_summary.rb +287 -0
- data/lib/ifeelgoods/models/client_summary_budget_alerts.rb +159 -0
- data/lib/ifeelgoods/models/create_and_redeem_request.rb +164 -0
- data/lib/ifeelgoods/models/create_and_redeem_request_data.rb +174 -0
- data/lib/ifeelgoods/models/create_redemption201_response.rb +147 -0
- data/lib/ifeelgoods/models/create_redemption422_response.rb +157 -0
- data/lib/ifeelgoods/models/create_redemption_request.rb +164 -0
- data/lib/ifeelgoods/models/create_redemption_request_data.rb +235 -0
- data/lib/ifeelgoods/models/create_redemption_request_data_customization.rb +147 -0
- data/lib/ifeelgoods/models/create_redemption_request_data_customization_pdf.rb +157 -0
- data/lib/ifeelgoods/models/create_redemption_request_data_reward.rb +147 -0
- data/lib/ifeelgoods/models/create_redemption_request_data_value.rb +148 -0
- data/lib/ifeelgoods/models/dimension.rb +293 -0
- data/lib/ifeelgoods/models/dimension_denomination.rb +105 -0
- data/lib/ifeelgoods/models/discount_summary.rb +195 -0
- data/lib/ifeelgoods/models/error_response.rb +157 -0
- data/lib/ifeelgoods/models/get_client_budget_history200_response.rb +158 -0
- data/lib/ifeelgoods/models/get_client_by_id200_response.rb +147 -0
- data/lib/ifeelgoods/models/get_current_account200_response.rb +147 -0
- data/lib/ifeelgoods/models/get_promotion_by_id200_response.rb +147 -0
- data/lib/ifeelgoods/models/get_promotion_by_id401_response.rb +157 -0
- data/lib/ifeelgoods/models/get_promotion_by_id404_response.rb +157 -0
- data/lib/ifeelgoods/models/get_redemption_stats200_response.rb +158 -0
- data/lib/ifeelgoods/models/get_reward_by_sku200_response.rb +147 -0
- data/lib/ifeelgoods/models/list_client_discounts200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_client_promotions200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_client_promotions200_response_paging.rb +165 -0
- data/lib/ifeelgoods/models/list_client_promotions401_response.rb +157 -0
- data/lib/ifeelgoods/models/list_client_vendor_places200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_clients200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_redemptions200_response.rb +158 -0
- data/lib/ifeelgoods/models/list_rewards200_response.rb +158 -0
- data/lib/ifeelgoods/models/product_summary.rb +222 -0
- data/lib/ifeelgoods/models/product_type.rb +204 -0
- data/lib/ifeelgoods/models/promotion_details.rb +354 -0
- data/lib/ifeelgoods/models/promotion_details_client.rb +157 -0
- data/lib/ifeelgoods/models/promotion_details_rewards_inner.rb +245 -0
- data/lib/ifeelgoods/models/redemption.rb +383 -0
- data/lib/ifeelgoods/models/redemption_promotion.rb +211 -0
- data/lib/ifeelgoods/models/redemption_reward.rb +224 -0
- data/lib/ifeelgoods/models/redemption_reward_format.rb +193 -0
- data/lib/ifeelgoods/models/redemption_value.rb +157 -0
- data/lib/ifeelgoods/models/reward_details.rb +486 -0
- data/lib/ifeelgoods/models/reward_details_brand.rb +213 -0
- data/lib/ifeelgoods/models/reward_details_dimensions.rb +293 -0
- data/lib/ifeelgoods/models/reward_details_product.rb +222 -0
- data/lib/ifeelgoods/models/reward_details_product_type.rb +204 -0
- data/lib/ifeelgoods/models/reward_details_targeting.rb +170 -0
- data/lib/ifeelgoods/models/reward_format.rb +192 -0
- data/lib/ifeelgoods/models/stats.rb +158 -0
- data/lib/ifeelgoods/models/stats_timeframe.rb +156 -0
- data/lib/ifeelgoods/models/stats_values_inner.rb +178 -0
- data/lib/ifeelgoods/models/stats_values_inner_group_by_inner.rb +186 -0
- data/lib/ifeelgoods/models/stats_values_inner_states.rb +219 -0
- data/lib/ifeelgoods/models/user.rb +188 -0
- data/lib/ifeelgoods/models/vendor_place.rb +186 -0
- data/lib/ifeelgoods/models/vendor_place_brand.rb +158 -0
- data/lib/ifeelgoods/models/vendor_place_geoloc.rb +156 -0
- data/lib/ifeelgoods/version.rb +15 -0
- data/lib/ifeelgoods.rb +115 -0
- data/spec/api/accounts_api_spec.rb +46 -0
- data/spec/api/clients_api_spec.rb +88 -0
- data/spec/api/promotions_api_spec.rb +61 -0
- data/spec/api/redemptions_api_spec.rb +175 -0
- data/spec/api/rewards_api_spec.rb +62 -0
- data/spec/api/stats_api_spec.rb +53 -0
- data/spec/api/vendor_places_api_spec.rb +51 -0
- data/spec/models/account_spec.rb +88 -0
- data/spec/models/activate_redemption_request_data_spec.rb +36 -0
- data/spec/models/activate_redemption_request_spec.rb +36 -0
- data/spec/models/address_spec.rb +78 -0
- data/spec/models/brand_summary_spec.rb +58 -0
- data/spec/models/budget_line_item_spec.rb +80 -0
- data/spec/models/card_consult_redemption200_response_data_spec.rb +42 -0
- data/spec/models/card_consult_redemption200_response_spec.rb +36 -0
- data/spec/models/card_consult_redemption422_response_spec.rb +42 -0
- data/spec/models/client_details_spec.rb +106 -0
- data/spec/models/client_summary_budget_alerts_spec.rb +42 -0
- data/spec/models/client_summary_spec.rb +106 -0
- data/spec/models/create_and_redeem_request_data_spec.rb +54 -0
- data/spec/models/create_and_redeem_request_spec.rb +36 -0
- data/spec/models/create_redemption201_response_spec.rb +36 -0
- data/spec/models/create_redemption422_response_spec.rb +42 -0
- data/spec/models/create_redemption_request_data_customization_pdf_spec.rb +42 -0
- data/spec/models/create_redemption_request_data_customization_spec.rb +36 -0
- data/spec/models/create_redemption_request_data_reward_spec.rb +36 -0
- data/spec/models/create_redemption_request_data_spec.rb +60 -0
- data/spec/models/create_redemption_request_data_value_spec.rb +36 -0
- data/spec/models/create_redemption_request_spec.rb +36 -0
- data/spec/models/dimension_denomination_spec.rb +32 -0
- data/spec/models/dimension_spec.rb +114 -0
- data/spec/models/discount_summary_spec.rb +66 -0
- data/spec/models/error_response_spec.rb +42 -0
- data/spec/models/get_client_budget_history200_response_spec.rb +42 -0
- data/spec/models/get_client_by_id200_response_spec.rb +36 -0
- data/spec/models/get_current_account200_response_spec.rb +36 -0
- data/spec/models/get_promotion_by_id200_response_spec.rb +36 -0
- data/spec/models/get_promotion_by_id401_response_spec.rb +42 -0
- data/spec/models/get_promotion_by_id404_response_spec.rb +42 -0
- data/spec/models/get_redemption_stats200_response_spec.rb +42 -0
- data/spec/models/get_reward_by_sku200_response_spec.rb +36 -0
- data/spec/models/list_client_discounts200_response_spec.rb +42 -0
- data/spec/models/list_client_promotions200_response_paging_spec.rb +48 -0
- data/spec/models/list_client_promotions200_response_spec.rb +42 -0
- data/spec/models/list_client_promotions401_response_spec.rb +42 -0
- data/spec/models/list_client_vendor_places200_response_spec.rb +42 -0
- data/spec/models/list_clients200_response_spec.rb +42 -0
- data/spec/models/list_redemptions200_response_spec.rb +42 -0
- data/spec/models/list_rewards200_response_spec.rb +42 -0
- data/spec/models/product_summary_spec.rb +64 -0
- data/spec/models/product_type_spec.rb +50 -0
- data/spec/models/promotion_details_client_spec.rb +42 -0
- data/spec/models/promotion_details_rewards_inner_spec.rb +78 -0
- data/spec/models/promotion_details_spec.rb +136 -0
- data/spec/models/redemption_promotion_spec.rb +58 -0
- data/spec/models/redemption_reward_format_spec.rb +50 -0
- data/spec/models/redemption_reward_spec.rb +62 -0
- data/spec/models/redemption_spec.rb +168 -0
- data/spec/models/redemption_value_spec.rb +42 -0
- data/spec/models/reward_details_brand_spec.rb +58 -0
- data/spec/models/reward_details_dimensions_spec.rb +114 -0
- data/spec/models/reward_details_product_spec.rb +64 -0
- data/spec/models/reward_details_product_type_spec.rb +50 -0
- data/spec/models/reward_details_spec.rb +218 -0
- data/spec/models/reward_details_targeting_spec.rb +48 -0
- data/spec/models/reward_format_spec.rb +50 -0
- data/spec/models/stats_spec.rb +42 -0
- data/spec/models/stats_timeframe_spec.rb +42 -0
- data/spec/models/stats_values_inner_group_by_inner_spec.rb +60 -0
- data/spec/models/stats_values_inner_spec.rb +54 -0
- data/spec/models/stats_values_inner_states_spec.rb +84 -0
- data/spec/models/user_spec.rb +60 -0
- data/spec/models/vendor_place_brand_spec.rb +42 -0
- data/spec/models/vendor_place_geoloc_spec.rb +42 -0
- data/spec/models/vendor_place_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- metadata +397 -0
|
@@ -0,0 +1,293 @@
|
|
|
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
|
+
# Additional structured attributes associated with a reward. Each key represents a dimension label and its value is the dimension value for that reward. Not all dimensions are present on every reward — only the ones configured for that specific product will appear.
|
|
18
|
+
class RewardDetailsDimensions < ApiModelBase
|
|
19
|
+
# Indicates the range of values that can be used with open value reward (when free_value is true) (eg. 5..250).
|
|
20
|
+
attr_accessor :available_denominations_range
|
|
21
|
+
|
|
22
|
+
# When a custom offer has been configured for this product (eg. buy one get one, $20 off the second article, etc.).
|
|
23
|
+
attr_accessor :custom_offer
|
|
24
|
+
|
|
25
|
+
# Duration during which the reward code remains valid after delivery. Expressed as a number followed by a unit: d for days, m for months, y for years (eg. 30d for 30 days, 12m for 12 months, 1y for 1 year). Returns null if no validity period applies.
|
|
26
|
+
attr_accessor :validity_period
|
|
27
|
+
|
|
28
|
+
# List of specific monetary amounts available for this reward.
|
|
29
|
+
attr_accessor :available_denominations
|
|
30
|
+
|
|
31
|
+
# Indicates whether the reward code can be broken into smaller values.
|
|
32
|
+
attr_accessor :breakable
|
|
33
|
+
|
|
34
|
+
# Indicates whether multiple reward codes can be combined.
|
|
35
|
+
attr_accessor :cumulable
|
|
36
|
+
|
|
37
|
+
attr_accessor :denomination
|
|
38
|
+
|
|
39
|
+
# Currency of the denomination amount (eg. EUR, USD, etc.).
|
|
40
|
+
attr_accessor :denomination_currency
|
|
41
|
+
|
|
42
|
+
# Duration of a subscription or service (eg. 2 months).
|
|
43
|
+
attr_accessor :duration
|
|
44
|
+
|
|
45
|
+
# Unit of the duration dimension. Possible values: minute, hour, day, week, month, year, varying_duration.
|
|
46
|
+
attr_accessor :duration_unit
|
|
47
|
+
|
|
48
|
+
# Number of people concerned by the reward.
|
|
49
|
+
attr_accessor :people
|
|
50
|
+
|
|
51
|
+
# Virtual currency amount associated with the reward (eg. 300 points, 200 miles, etc.).
|
|
52
|
+
attr_accessor :quantity
|
|
53
|
+
|
|
54
|
+
# Unit of the quantity dimension. Possible values: points, miles, facebook_credits, minutes, movie, meal, e_magazine, e_ticket, song, lesson, box, subscription.
|
|
55
|
+
attr_accessor :quantity_unit
|
|
56
|
+
|
|
57
|
+
attr_accessor :redemption_channel
|
|
58
|
+
|
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
60
|
+
def self.attribute_map
|
|
61
|
+
{
|
|
62
|
+
:'available_denominations_range' => :'available_denominations_range',
|
|
63
|
+
:'custom_offer' => :'custom_offer',
|
|
64
|
+
:'validity_period' => :'validity_period',
|
|
65
|
+
:'available_denominations' => :'available_denominations',
|
|
66
|
+
:'breakable' => :'breakable',
|
|
67
|
+
:'cumulable' => :'cumulable',
|
|
68
|
+
:'denomination' => :'denomination',
|
|
69
|
+
:'denomination_currency' => :'denomination_currency',
|
|
70
|
+
:'duration' => :'duration',
|
|
71
|
+
:'duration_unit' => :'duration_unit',
|
|
72
|
+
:'people' => :'people',
|
|
73
|
+
:'quantity' => :'quantity',
|
|
74
|
+
:'quantity_unit' => :'quantity_unit',
|
|
75
|
+
:'redemption_channel' => :'redemption_channel'
|
|
76
|
+
}
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Returns attribute mapping this model knows about
|
|
80
|
+
def self.acceptable_attribute_map
|
|
81
|
+
attribute_map
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Returns all the JSON keys this model knows about
|
|
85
|
+
def self.acceptable_attributes
|
|
86
|
+
acceptable_attribute_map.values
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Attribute type mapping.
|
|
90
|
+
def self.openapi_types
|
|
91
|
+
{
|
|
92
|
+
:'available_denominations_range' => :'String',
|
|
93
|
+
:'custom_offer' => :'String',
|
|
94
|
+
:'validity_period' => :'String',
|
|
95
|
+
:'available_denominations' => :'String',
|
|
96
|
+
:'breakable' => :'String',
|
|
97
|
+
:'cumulable' => :'String',
|
|
98
|
+
:'denomination' => :'DimensionDenomination',
|
|
99
|
+
:'denomination_currency' => :'String',
|
|
100
|
+
:'duration' => :'String',
|
|
101
|
+
:'duration_unit' => :'String',
|
|
102
|
+
:'people' => :'String',
|
|
103
|
+
:'quantity' => :'String',
|
|
104
|
+
:'quantity_unit' => :'String',
|
|
105
|
+
:'redemption_channel' => :'Array<String>'
|
|
106
|
+
}
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# List of attributes with nullable: true
|
|
110
|
+
def self.openapi_nullable
|
|
111
|
+
Set.new([
|
|
112
|
+
:'available_denominations_range',
|
|
113
|
+
:'custom_offer',
|
|
114
|
+
:'validity_period',
|
|
115
|
+
:'available_denominations',
|
|
116
|
+
:'breakable',
|
|
117
|
+
:'cumulable',
|
|
118
|
+
:'denomination',
|
|
119
|
+
:'denomination_currency',
|
|
120
|
+
:'duration',
|
|
121
|
+
:'duration_unit',
|
|
122
|
+
:'people',
|
|
123
|
+
:'quantity',
|
|
124
|
+
:'quantity_unit',
|
|
125
|
+
:'redemption_channel'
|
|
126
|
+
])
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Initializes the object
|
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
131
|
+
def initialize(attributes = {})
|
|
132
|
+
if (!attributes.is_a?(Hash))
|
|
133
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Ifeelgoods::RewardDetailsDimensions` initialize method"
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
137
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
138
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
139
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
140
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Ifeelgoods::RewardDetailsDimensions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
141
|
+
end
|
|
142
|
+
h[k.to_sym] = v
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'available_denominations_range')
|
|
146
|
+
self.available_denominations_range = attributes[:'available_denominations_range']
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'custom_offer')
|
|
150
|
+
self.custom_offer = attributes[:'custom_offer']
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'validity_period')
|
|
154
|
+
self.validity_period = attributes[:'validity_period']
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'available_denominations')
|
|
158
|
+
self.available_denominations = attributes[:'available_denominations']
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'breakable')
|
|
162
|
+
self.breakable = attributes[:'breakable']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'cumulable')
|
|
166
|
+
self.cumulable = attributes[:'cumulable']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'denomination')
|
|
170
|
+
self.denomination = attributes[:'denomination']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'denomination_currency')
|
|
174
|
+
self.denomination_currency = attributes[:'denomination_currency']
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.key?(:'duration')
|
|
178
|
+
self.duration = attributes[:'duration']
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if attributes.key?(:'duration_unit')
|
|
182
|
+
self.duration_unit = attributes[:'duration_unit']
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.key?(:'people')
|
|
186
|
+
self.people = attributes[:'people']
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'quantity')
|
|
190
|
+
self.quantity = attributes[:'quantity']
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'quantity_unit')
|
|
194
|
+
self.quantity_unit = attributes[:'quantity_unit']
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'redemption_channel')
|
|
198
|
+
if (value = attributes[:'redemption_channel']).is_a?(Array)
|
|
199
|
+
self.redemption_channel = value
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
205
|
+
# @return Array for valid properties with the reasons
|
|
206
|
+
def list_invalid_properties
|
|
207
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
208
|
+
invalid_properties = Array.new
|
|
209
|
+
invalid_properties
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Check to see if the all the properties in the model are valid
|
|
213
|
+
# @return true if the model is valid
|
|
214
|
+
def valid?
|
|
215
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
216
|
+
true
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Checks equality by comparing each attribute.
|
|
220
|
+
# @param [Object] Object to be compared
|
|
221
|
+
def ==(o)
|
|
222
|
+
return true if self.equal?(o)
|
|
223
|
+
self.class == o.class &&
|
|
224
|
+
available_denominations_range == o.available_denominations_range &&
|
|
225
|
+
custom_offer == o.custom_offer &&
|
|
226
|
+
validity_period == o.validity_period &&
|
|
227
|
+
available_denominations == o.available_denominations &&
|
|
228
|
+
breakable == o.breakable &&
|
|
229
|
+
cumulable == o.cumulable &&
|
|
230
|
+
denomination == o.denomination &&
|
|
231
|
+
denomination_currency == o.denomination_currency &&
|
|
232
|
+
duration == o.duration &&
|
|
233
|
+
duration_unit == o.duration_unit &&
|
|
234
|
+
people == o.people &&
|
|
235
|
+
quantity == o.quantity &&
|
|
236
|
+
quantity_unit == o.quantity_unit &&
|
|
237
|
+
redemption_channel == o.redemption_channel
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# @see the `==` method
|
|
241
|
+
# @param [Object] Object to be compared
|
|
242
|
+
def eql?(o)
|
|
243
|
+
self == o
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Calculates hash code according to all attributes.
|
|
247
|
+
# @return [Integer] Hash code
|
|
248
|
+
def hash
|
|
249
|
+
[available_denominations_range, custom_offer, validity_period, available_denominations, breakable, cumulable, denomination, denomination_currency, duration, duration_unit, people, quantity, quantity_unit, redemption_channel].hash
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Builds the object from hash
|
|
253
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
254
|
+
# @return [Object] Returns the model itself
|
|
255
|
+
def self.build_from_hash(attributes)
|
|
256
|
+
return nil unless attributes.is_a?(Hash)
|
|
257
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
258
|
+
transformed_hash = {}
|
|
259
|
+
openapi_types.each_pair do |key, type|
|
|
260
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
261
|
+
transformed_hash["#{key}"] = nil
|
|
262
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
263
|
+
# check to ensure the input is an array given that the attribute
|
|
264
|
+
# is documented as an array but the input is not
|
|
265
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
266
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
267
|
+
end
|
|
268
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
269
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
new(transformed_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
|
+
end
|
|
292
|
+
|
|
293
|
+
end
|
|
@@ -0,0 +1,222 @@
|
|
|
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
|
+
class RewardDetailsProduct < ApiModelBase
|
|
18
|
+
# Unique identifier for the product (eg. `APP-ITC`).
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# The product name (eg. `iTunes Code`).
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# Indicates whether the product can be delivered as PDF or not.
|
|
25
|
+
attr_accessor :deliverable_as_pdf
|
|
26
|
+
|
|
27
|
+
# Indicates product VAT rate.
|
|
28
|
+
attr_accessor :vat_rate
|
|
29
|
+
|
|
30
|
+
# Indicates product VAT rule (BUU or BUM).
|
|
31
|
+
attr_accessor :vat_rule
|
|
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
|
+
:'deliverable_as_pdf' => :'deliverable_as_pdf',
|
|
61
|
+
:'vat_rate' => :'vat_rate',
|
|
62
|
+
:'vat_rule' => :'vat_rule'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns attribute mapping this model knows about
|
|
67
|
+
def self.acceptable_attribute_map
|
|
68
|
+
attribute_map
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns all the JSON keys this model knows about
|
|
72
|
+
def self.acceptable_attributes
|
|
73
|
+
acceptable_attribute_map.values
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Attribute type mapping.
|
|
77
|
+
def self.openapi_types
|
|
78
|
+
{
|
|
79
|
+
:'id' => :'String',
|
|
80
|
+
:'name' => :'String',
|
|
81
|
+
:'deliverable_as_pdf' => :'Boolean',
|
|
82
|
+
:'vat_rate' => :'Float',
|
|
83
|
+
:'vat_rule' => :'String'
|
|
84
|
+
}
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# List of attributes with nullable: true
|
|
88
|
+
def self.openapi_nullable
|
|
89
|
+
Set.new([
|
|
90
|
+
])
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Initializes the object
|
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
|
+
def initialize(attributes = {})
|
|
96
|
+
if (!attributes.is_a?(Hash))
|
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Ifeelgoods::RewardDetailsProduct` initialize method"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
102
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
103
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
104
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Ifeelgoods::RewardDetailsProduct`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
105
|
+
end
|
|
106
|
+
h[k.to_sym] = v
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'id')
|
|
110
|
+
self.id = attributes[:'id']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'name')
|
|
114
|
+
self.name = attributes[:'name']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'deliverable_as_pdf')
|
|
118
|
+
self.deliverable_as_pdf = attributes[:'deliverable_as_pdf']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'vat_rate')
|
|
122
|
+
self.vat_rate = attributes[:'vat_rate']
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'vat_rule')
|
|
126
|
+
self.vat_rule = attributes[:'vat_rule']
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
131
|
+
# @return Array for valid properties with the reasons
|
|
132
|
+
def list_invalid_properties
|
|
133
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
134
|
+
invalid_properties = Array.new
|
|
135
|
+
invalid_properties
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Check to see if the all the properties in the model are valid
|
|
139
|
+
# @return true if the model is valid
|
|
140
|
+
def valid?
|
|
141
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
142
|
+
vat_rule_validator = EnumAttributeValidator.new('String', ["BUU", "BUM"])
|
|
143
|
+
return false unless vat_rule_validator.valid?(@vat_rule)
|
|
144
|
+
true
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
148
|
+
# @param [Object] vat_rule Object to be assigned
|
|
149
|
+
def vat_rule=(vat_rule)
|
|
150
|
+
validator = EnumAttributeValidator.new('String', ["BUU", "BUM"])
|
|
151
|
+
unless validator.valid?(vat_rule)
|
|
152
|
+
fail ArgumentError, "invalid value for \"vat_rule\", must be one of #{validator.allowable_values}."
|
|
153
|
+
end
|
|
154
|
+
@vat_rule = vat_rule
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Checks equality by comparing each attribute.
|
|
158
|
+
# @param [Object] Object to be compared
|
|
159
|
+
def ==(o)
|
|
160
|
+
return true if self.equal?(o)
|
|
161
|
+
self.class == o.class &&
|
|
162
|
+
id == o.id &&
|
|
163
|
+
name == o.name &&
|
|
164
|
+
deliverable_as_pdf == o.deliverable_as_pdf &&
|
|
165
|
+
vat_rate == o.vat_rate &&
|
|
166
|
+
vat_rule == o.vat_rule
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# @see the `==` method
|
|
170
|
+
# @param [Object] Object to be compared
|
|
171
|
+
def eql?(o)
|
|
172
|
+
self == o
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Calculates hash code according to all attributes.
|
|
176
|
+
# @return [Integer] Hash code
|
|
177
|
+
def hash
|
|
178
|
+
[id, name, deliverable_as_pdf, vat_rate, vat_rule].hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Builds the object from hash
|
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
183
|
+
# @return [Object] Returns the model itself
|
|
184
|
+
def self.build_from_hash(attributes)
|
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
|
186
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
187
|
+
transformed_hash = {}
|
|
188
|
+
openapi_types.each_pair do |key, type|
|
|
189
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
190
|
+
transformed_hash["#{key}"] = nil
|
|
191
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
192
|
+
# check to ensure the input is an array given that the attribute
|
|
193
|
+
# is documented as an array but the input is not
|
|
194
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
195
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
196
|
+
end
|
|
197
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
198
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
new(transformed_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
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|