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,166 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Ifeelgoods
|
|
16
|
+
class RewardsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get a Reward
|
|
23
|
+
# Use this function to retrieve detailed description about a reward
|
|
24
|
+
# @param sku [String] The reward SKU
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [GetRewardBySKU200Response]
|
|
27
|
+
def get_reward_by_sku(sku, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_reward_by_sku_with_http_info(sku, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get a Reward
|
|
33
|
+
# Use this function to retrieve detailed description about a reward
|
|
34
|
+
# @param sku [String] The reward SKU
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(GetRewardBySKU200Response, Integer, Hash)>] GetRewardBySKU200Response data, response status code and response headers
|
|
37
|
+
def get_reward_by_sku_with_http_info(sku, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: RewardsApi.get_reward_by_sku ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'sku' is set
|
|
42
|
+
if @api_client.config.client_side_validation && sku.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'sku' when calling RewardsApi.get_reward_by_sku"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/fulfillment/v2/rewards/{sku}'.sub('{sku}', CGI.escape(sku.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'GetRewardBySKU200Response'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['api_key', 'bearer_auth', 'api_secret']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"RewardsApi.get_reward_by_sku",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: RewardsApi#get_reward_by_sku\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List all Rewards
|
|
86
|
+
# Use this function to list all the rewards from the Ifeelgoods Catalog
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @option opts [String] :sku Comma-separated list of reward SKUs to filter by
|
|
89
|
+
# @option opts [String] :client_id Unique Client identifier (used to retrieve cost with discount)
|
|
90
|
+
# @option opts [Integer] :page (default to 1)
|
|
91
|
+
# @option opts [Integer] :per_page (default to 20)
|
|
92
|
+
# @return [ListRewards200Response]
|
|
93
|
+
def list_rewards(opts = {})
|
|
94
|
+
data, _status_code, _headers = list_rewards_with_http_info(opts)
|
|
95
|
+
data
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# List all Rewards
|
|
99
|
+
# Use this function to list all the rewards from the Ifeelgoods Catalog
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @option opts [String] :sku Comma-separated list of reward SKUs to filter by
|
|
102
|
+
# @option opts [String] :client_id Unique Client identifier (used to retrieve cost with discount)
|
|
103
|
+
# @option opts [Integer] :page (default to 1)
|
|
104
|
+
# @option opts [Integer] :per_page (default to 20)
|
|
105
|
+
# @return [Array<(ListRewards200Response, Integer, Hash)>] ListRewards200Response data, response status code and response headers
|
|
106
|
+
def list_rewards_with_http_info(opts = {})
|
|
107
|
+
if @api_client.config.debugging
|
|
108
|
+
@api_client.config.logger.debug 'Calling API: RewardsApi.list_rewards ...'
|
|
109
|
+
end
|
|
110
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
111
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling RewardsApi.list_rewards, must be greater than or equal to 1.'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 10000
|
|
115
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling RewardsApi.list_rewards, must be smaller than or equal to 10000.'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
|
119
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling RewardsApi.list_rewards, must be greater than or equal to 1.'
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# resource path
|
|
123
|
+
local_var_path = '/fulfillment/v2/rewards'
|
|
124
|
+
|
|
125
|
+
# query parameters
|
|
126
|
+
query_params = opts[:query_params] || {}
|
|
127
|
+
query_params[:'sku'] = opts[:'sku'] if !opts[:'sku'].nil?
|
|
128
|
+
query_params[:'client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
|
|
129
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
130
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
131
|
+
|
|
132
|
+
# header parameters
|
|
133
|
+
header_params = opts[:header_params] || {}
|
|
134
|
+
# HTTP header 'Accept' (if needed)
|
|
135
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
136
|
+
|
|
137
|
+
# form parameters
|
|
138
|
+
form_params = opts[:form_params] || {}
|
|
139
|
+
|
|
140
|
+
# http body (model)
|
|
141
|
+
post_body = opts[:debug_body]
|
|
142
|
+
|
|
143
|
+
# return_type
|
|
144
|
+
return_type = opts[:debug_return_type] || 'ListRewards200Response'
|
|
145
|
+
|
|
146
|
+
# auth_names
|
|
147
|
+
auth_names = opts[:debug_auth_names] || ['api_key', 'bearer_auth', 'api_secret']
|
|
148
|
+
|
|
149
|
+
new_options = opts.merge(
|
|
150
|
+
:operation => :"RewardsApi.list_rewards",
|
|
151
|
+
:header_params => header_params,
|
|
152
|
+
:query_params => query_params,
|
|
153
|
+
:form_params => form_params,
|
|
154
|
+
:body => post_body,
|
|
155
|
+
:auth_names => auth_names,
|
|
156
|
+
:return_type => return_type
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
160
|
+
if @api_client.config.debugging
|
|
161
|
+
@api_client.config.logger.debug "API called: RewardsApi#list_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
162
|
+
end
|
|
163
|
+
return data, status_code, headers
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
end
|
|
@@ -0,0 +1,111 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Ifeelgoods
|
|
16
|
+
class StatsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get Redemption Stats
|
|
23
|
+
# Use this function to access data relative to the reward delivery activity for a specific client
|
|
24
|
+
# @param client_id [String] The client identifier
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :promotion_id
|
|
27
|
+
# @option opts [String] :reward_sku
|
|
28
|
+
# @option opts [Time] :start_date ISO-8601 String representing the start date for the date range for which activity stats are extracted
|
|
29
|
+
# @option opts [Time] :end_date ISO-8601 String representing the end date for the date range for which activity stats are extracted
|
|
30
|
+
# @option opts [String] :interval Aggregation granularity - daily, monthly and yearly
|
|
31
|
+
# @option opts [String] :states Filter to specify the state of the redemptions to include in the stats
|
|
32
|
+
# @return [GetRedemptionStats200Response]
|
|
33
|
+
def get_redemption_stats(client_id, opts = {})
|
|
34
|
+
data, _status_code, _headers = get_redemption_stats_with_http_info(client_id, opts)
|
|
35
|
+
data
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Get Redemption Stats
|
|
39
|
+
# Use this function to access data relative to the reward delivery activity for a specific client
|
|
40
|
+
# @param client_id [String] The client identifier
|
|
41
|
+
# @param [Hash] opts the optional parameters
|
|
42
|
+
# @option opts [String] :promotion_id
|
|
43
|
+
# @option opts [String] :reward_sku
|
|
44
|
+
# @option opts [Time] :start_date ISO-8601 String representing the start date for the date range for which activity stats are extracted
|
|
45
|
+
# @option opts [Time] :end_date ISO-8601 String representing the end date for the date range for which activity stats are extracted
|
|
46
|
+
# @option opts [String] :interval Aggregation granularity - daily, monthly and yearly
|
|
47
|
+
# @option opts [String] :states Filter to specify the state of the redemptions to include in the stats
|
|
48
|
+
# @return [Array<(GetRedemptionStats200Response, Integer, Hash)>] GetRedemptionStats200Response data, response status code and response headers
|
|
49
|
+
def get_redemption_stats_with_http_info(client_id, opts = {})
|
|
50
|
+
if @api_client.config.debugging
|
|
51
|
+
@api_client.config.logger.debug 'Calling API: StatsApi.get_redemption_stats ...'
|
|
52
|
+
end
|
|
53
|
+
# verify the required parameter 'client_id' is set
|
|
54
|
+
if @api_client.config.client_side_validation && client_id.nil?
|
|
55
|
+
fail ArgumentError, "Missing the required parameter 'client_id' when calling StatsApi.get_redemption_stats"
|
|
56
|
+
end
|
|
57
|
+
allowable_values = ["daily", "monthly", "yearly"]
|
|
58
|
+
if @api_client.config.client_side_validation && opts[:'interval'] && !allowable_values.include?(opts[:'interval'])
|
|
59
|
+
fail ArgumentError, "invalid value for \"interval\", must be one of #{allowable_values}"
|
|
60
|
+
end
|
|
61
|
+
allowable_values = ["all", "redeemed"]
|
|
62
|
+
if @api_client.config.client_side_validation && opts[:'states'] && !allowable_values.include?(opts[:'states'])
|
|
63
|
+
fail ArgumentError, "invalid value for \"states\", must be one of #{allowable_values}"
|
|
64
|
+
end
|
|
65
|
+
# resource path
|
|
66
|
+
local_var_path = '/fulfillment/v2/clients/{client_id}/stats'.sub('{client_id}', CGI.escape(client_id.to_s))
|
|
67
|
+
|
|
68
|
+
# query parameters
|
|
69
|
+
query_params = opts[:query_params] || {}
|
|
70
|
+
query_params[:'promotion_id'] = opts[:'promotion_id'] if !opts[:'promotion_id'].nil?
|
|
71
|
+
query_params[:'reward_sku'] = opts[:'reward_sku'] if !opts[:'reward_sku'].nil?
|
|
72
|
+
query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
|
|
73
|
+
query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
|
|
74
|
+
query_params[:'interval'] = opts[:'interval'] if !opts[:'interval'].nil?
|
|
75
|
+
query_params[:'states'] = opts[:'states'] if !opts[:'states'].nil?
|
|
76
|
+
|
|
77
|
+
# header parameters
|
|
78
|
+
header_params = opts[:header_params] || {}
|
|
79
|
+
# HTTP header 'Accept' (if needed)
|
|
80
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
81
|
+
|
|
82
|
+
# form parameters
|
|
83
|
+
form_params = opts[:form_params] || {}
|
|
84
|
+
|
|
85
|
+
# http body (model)
|
|
86
|
+
post_body = opts[:debug_body]
|
|
87
|
+
|
|
88
|
+
# return_type
|
|
89
|
+
return_type = opts[:debug_return_type] || 'GetRedemptionStats200Response'
|
|
90
|
+
|
|
91
|
+
# auth_names
|
|
92
|
+
auth_names = opts[:debug_auth_names] || ['api_key', 'bearer_auth', 'api_secret']
|
|
93
|
+
|
|
94
|
+
new_options = opts.merge(
|
|
95
|
+
:operation => :"StatsApi.get_redemption_stats",
|
|
96
|
+
:header_params => header_params,
|
|
97
|
+
:query_params => query_params,
|
|
98
|
+
:form_params => form_params,
|
|
99
|
+
:body => post_body,
|
|
100
|
+
:auth_names => auth_names,
|
|
101
|
+
:return_type => return_type
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
105
|
+
if @api_client.config.debugging
|
|
106
|
+
@api_client.config.logger.debug "API called: StatsApi#get_redemption_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
107
|
+
end
|
|
108
|
+
return data, status_code, headers
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
@@ -0,0 +1,109 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Ifeelgoods
|
|
16
|
+
class VendorPlacesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# List all vendor places
|
|
23
|
+
# Use this function to list vendor places for a specific client. This endpoint is available only to clients subscribed to Vendor Places API access.
|
|
24
|
+
# @param client_id [String] The client identifier
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [Array<String>] :skus Filter by a list of brand SKUs
|
|
27
|
+
# @option opts [String] :zip_code
|
|
28
|
+
# @option opts [Integer] :page (default to 1)
|
|
29
|
+
# @option opts [Integer] :per_page (default to 20)
|
|
30
|
+
# @return [ListClientVendorPlaces200Response]
|
|
31
|
+
def list_client_vendor_places(client_id, opts = {})
|
|
32
|
+
data, _status_code, _headers = list_client_vendor_places_with_http_info(client_id, opts)
|
|
33
|
+
data
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# List all vendor places
|
|
37
|
+
# Use this function to list vendor places for a specific client. This endpoint is available only to clients subscribed to Vendor Places API access.
|
|
38
|
+
# @param client_id [String] The client identifier
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @option opts [Array<String>] :skus Filter by a list of brand SKUs
|
|
41
|
+
# @option opts [String] :zip_code
|
|
42
|
+
# @option opts [Integer] :page (default to 1)
|
|
43
|
+
# @option opts [Integer] :per_page (default to 20)
|
|
44
|
+
# @return [Array<(ListClientVendorPlaces200Response, Integer, Hash)>] ListClientVendorPlaces200Response data, response status code and response headers
|
|
45
|
+
def list_client_vendor_places_with_http_info(client_id, opts = {})
|
|
46
|
+
if @api_client.config.debugging
|
|
47
|
+
@api_client.config.logger.debug 'Calling API: VendorPlacesApi.list_client_vendor_places ...'
|
|
48
|
+
end
|
|
49
|
+
# verify the required parameter 'client_id' is set
|
|
50
|
+
if @api_client.config.client_side_validation && client_id.nil?
|
|
51
|
+
fail ArgumentError, "Missing the required parameter 'client_id' when calling VendorPlacesApi.list_client_vendor_places"
|
|
52
|
+
end
|
|
53
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
54
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VendorPlacesApi.list_client_vendor_places, must be greater than or equal to 1.'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 10000
|
|
58
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling VendorPlacesApi.list_client_vendor_places, must be smaller than or equal to 10000.'
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
|
62
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling VendorPlacesApi.list_client_vendor_places, must be greater than or equal to 1.'
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# resource path
|
|
66
|
+
local_var_path = '/fulfillment/v2/clients/{client_id}/vendor_places'.sub('{client_id}', CGI.escape(client_id.to_s))
|
|
67
|
+
|
|
68
|
+
# query parameters
|
|
69
|
+
query_params = opts[:query_params] || {}
|
|
70
|
+
query_params[:'skus'] = @api_client.build_collection_param(opts[:'skus'], :multi) if !opts[:'skus'].nil?
|
|
71
|
+
query_params[:'zip_code'] = opts[:'zip_code'] if !opts[:'zip_code'].nil?
|
|
72
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
73
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
74
|
+
|
|
75
|
+
# header parameters
|
|
76
|
+
header_params = opts[:header_params] || {}
|
|
77
|
+
# HTTP header 'Accept' (if needed)
|
|
78
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
79
|
+
|
|
80
|
+
# form parameters
|
|
81
|
+
form_params = opts[:form_params] || {}
|
|
82
|
+
|
|
83
|
+
# http body (model)
|
|
84
|
+
post_body = opts[:debug_body]
|
|
85
|
+
|
|
86
|
+
# return_type
|
|
87
|
+
return_type = opts[:debug_return_type] || 'ListClientVendorPlaces200Response'
|
|
88
|
+
|
|
89
|
+
# auth_names
|
|
90
|
+
auth_names = opts[:debug_auth_names] || ['api_key', 'bearer_auth', 'api_secret']
|
|
91
|
+
|
|
92
|
+
new_options = opts.merge(
|
|
93
|
+
:operation => :"VendorPlacesApi.list_client_vendor_places",
|
|
94
|
+
:header_params => header_params,
|
|
95
|
+
:query_params => query_params,
|
|
96
|
+
:form_params => form_params,
|
|
97
|
+
:body => post_body,
|
|
98
|
+
:auth_names => auth_names,
|
|
99
|
+
:return_type => return_type
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
103
|
+
if @api_client.config.debugging
|
|
104
|
+
@api_client.config.logger.debug "API called: VendorPlacesApi#list_client_vendor_places\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
105
|
+
end
|
|
106
|
+
return data, status_code, headers
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|