growsurf-ruby 0.7.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +1 -1
- data/lib/growsurf_ruby/models/campaign/campaign_reward_list_response.rb +21 -0
- data/lib/growsurf_ruby/models/campaign/delete_reward_response.rb +26 -0
- data/lib/growsurf_ruby/models/campaign/reward.rb +193 -0
- data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +212 -0
- data/lib/growsurf_ruby/models/campaign/reward_delete_params.rb +4 -4
- data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +205 -0
- data/lib/growsurf_ruby/models/campaign.rb +28 -1
- data/lib/growsurf_ruby/models/campaign_create_params.rb +68 -0
- data/lib/growsurf_ruby/models/campaign_update_params.rb +63 -0
- data/lib/growsurf_ruby/models/reward_tax_valuation.rb +35 -0
- data/lib/growsurf_ruby/models.rb +6 -0
- data/lib/growsurf_ruby/resources/campaign/design.rb +66 -0
- data/lib/growsurf_ruby/resources/campaign/emails.rb +63 -0
- data/lib/growsurf_ruby/resources/campaign/installation.rb +65 -0
- data/lib/growsurf_ruby/resources/campaign/options.rb +63 -0
- data/lib/growsurf_ruby/resources/campaign/rewards.rb +199 -0
- data/lib/growsurf_ruby/resources/campaign.rb +112 -0
- data/lib/growsurf_ruby/version.rb +1 -1
- data/lib/growsurf_ruby.rb +13 -0
- data/rbi/growsurf_ruby/models/campaign/campaign_reward_list_response.rbi +41 -0
- data/rbi/growsurf_ruby/models/campaign/delete_reward_response.rbi +38 -0
- data/rbi/growsurf_ruby/models/campaign/reward.rbi +291 -0
- data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +358 -0
- data/rbi/growsurf_ruby/models/campaign/reward_delete_params.rbi +4 -4
- data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +309 -0
- data/rbi/growsurf_ruby/models/campaign.rbi +42 -3
- data/rbi/growsurf_ruby/models/campaign_create_params.rbi +125 -0
- data/rbi/growsurf_ruby/models/campaign_update_params.rbi +130 -0
- data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +56 -0
- data/rbi/growsurf_ruby/models.rbi +6 -0
- data/rbi/growsurf_ruby/resources/campaign/design.rbi +50 -0
- data/rbi/growsurf_ruby/resources/campaign/emails.rbi +49 -0
- data/rbi/growsurf_ruby/resources/campaign/installation.rbi +50 -0
- data/rbi/growsurf_ruby/resources/campaign/options.rbi +49 -0
- data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +216 -0
- data/rbi/growsurf_ruby/resources/campaign.rbi +94 -0
- data/sig/growsurf_ruby/models/campaign/campaign_reward_list_response.rbs +18 -0
- data/sig/growsurf_ruby/models/campaign/delete_reward_response.rbs +17 -0
- data/sig/growsurf_ruby/models/campaign/reward.rbs +146 -0
- data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +210 -0
- data/sig/growsurf_ruby/models/campaign/reward_delete_params.rbs +4 -4
- data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +200 -0
- data/sig/growsurf_ruby/models/campaign.rbs +18 -3
- data/sig/growsurf_ruby/models/campaign_create_params.rbs +74 -0
- data/sig/growsurf_ruby/models/campaign_update_params.rbs +70 -0
- data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +19 -0
- data/sig/growsurf_ruby/models.rbs +6 -0
- data/sig/growsurf_ruby/resources/campaign/design.rbs +20 -0
- data/sig/growsurf_ruby/resources/campaign/emails.rbs +20 -0
- data/sig/growsurf_ruby/resources/campaign/installation.rbs +20 -0
- data/sig/growsurf_ruby/resources/campaign/options.rbs +20 -0
- data/sig/growsurf_ruby/resources/campaign/rewards.rbs +74 -0
- data/sig/growsurf_ruby/resources/campaign.rbs +34 -0
- metadata +41 -2
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Models
|
|
5
|
+
module Campaign
|
|
6
|
+
# @see GrowsurfRuby::Resources::Campaign::Rewards#update
|
|
7
|
+
class RewardUpdateParams < GrowsurfRuby::Internal::Type::BaseModel
|
|
8
|
+
extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include GrowsurfRuby::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute campaign_reward_id
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :campaign_reward_id, String
|
|
20
|
+
|
|
21
|
+
# @!attribute commission_structure
|
|
22
|
+
#
|
|
23
|
+
# @return [GrowsurfRuby::Models::CommissionStructure, nil]
|
|
24
|
+
optional :commission_structure,
|
|
25
|
+
-> { GrowsurfRuby::CommissionStructure },
|
|
26
|
+
api_name: :commissionStructure
|
|
27
|
+
|
|
28
|
+
# @!attribute conversions_required
|
|
29
|
+
#
|
|
30
|
+
# @return [Integer, nil]
|
|
31
|
+
optional :conversions_required, Integer, api_name: :conversionsRequired
|
|
32
|
+
|
|
33
|
+
# @!attribute coupon_code
|
|
34
|
+
#
|
|
35
|
+
# @return [String, nil]
|
|
36
|
+
optional :coupon_code, String, api_name: :couponCode
|
|
37
|
+
|
|
38
|
+
# @!attribute description
|
|
39
|
+
#
|
|
40
|
+
# @return [String, nil]
|
|
41
|
+
optional :description, String
|
|
42
|
+
|
|
43
|
+
# @!attribute image_url
|
|
44
|
+
#
|
|
45
|
+
# @return [String, nil]
|
|
46
|
+
optional :image_url, String, api_name: :imageUrl
|
|
47
|
+
|
|
48
|
+
# @!attribute is_active
|
|
49
|
+
#
|
|
50
|
+
# @return [Boolean, nil]
|
|
51
|
+
optional :is_active, GrowsurfRuby::Internal::Type::Boolean, api_name: :isActive
|
|
52
|
+
|
|
53
|
+
# @!attribute is_unlimited
|
|
54
|
+
#
|
|
55
|
+
# @return [Boolean, nil]
|
|
56
|
+
optional :is_unlimited, GrowsurfRuby::Internal::Type::Boolean, api_name: :isUnlimited
|
|
57
|
+
|
|
58
|
+
# @!attribute is_visible
|
|
59
|
+
#
|
|
60
|
+
# @return [Boolean, nil]
|
|
61
|
+
optional :is_visible, GrowsurfRuby::Internal::Type::Boolean, api_name: :isVisible
|
|
62
|
+
|
|
63
|
+
# @!attribute limit
|
|
64
|
+
#
|
|
65
|
+
# @return [Integer, nil]
|
|
66
|
+
optional :limit, Integer
|
|
67
|
+
|
|
68
|
+
# @!attribute limit_duration
|
|
69
|
+
#
|
|
70
|
+
# @return [Symbol, GrowsurfRuby::Models::Campaign::RewardUpdateParams::LimitDuration, nil]
|
|
71
|
+
optional :limit_duration,
|
|
72
|
+
enum: -> { GrowsurfRuby::Campaign::RewardUpdateParams::LimitDuration },
|
|
73
|
+
api_name: :limitDuration
|
|
74
|
+
|
|
75
|
+
# @!attribute metadata
|
|
76
|
+
# Custom key/value metadata (single-level; values are stored as strings).
|
|
77
|
+
#
|
|
78
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
79
|
+
optional :metadata, GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown]
|
|
80
|
+
|
|
81
|
+
# @!attribute next_milestone_prefix
|
|
82
|
+
#
|
|
83
|
+
# @return [String, nil]
|
|
84
|
+
optional :next_milestone_prefix, String, api_name: :nextMilestonePrefix
|
|
85
|
+
|
|
86
|
+
# @!attribute next_milestone_suffix
|
|
87
|
+
#
|
|
88
|
+
# @return [String, nil]
|
|
89
|
+
optional :next_milestone_suffix, String, api_name: :nextMilestoneSuffix
|
|
90
|
+
|
|
91
|
+
# @!attribute number_of_winners
|
|
92
|
+
#
|
|
93
|
+
# @return [Integer, nil]
|
|
94
|
+
optional :number_of_winners, Integer, api_name: :numberOfWinners
|
|
95
|
+
|
|
96
|
+
# @!attribute order
|
|
97
|
+
#
|
|
98
|
+
# @return [Integer, nil]
|
|
99
|
+
optional :order, Integer
|
|
100
|
+
|
|
101
|
+
# @!attribute referral_coupon_code
|
|
102
|
+
#
|
|
103
|
+
# @return [String, nil]
|
|
104
|
+
optional :referral_coupon_code, String, api_name: :referralCouponCode
|
|
105
|
+
|
|
106
|
+
# @!attribute referral_description
|
|
107
|
+
#
|
|
108
|
+
# @return [String, nil]
|
|
109
|
+
optional :referral_description, String, api_name: :referralDescription
|
|
110
|
+
|
|
111
|
+
# @!attribute referred_reward_upfront
|
|
112
|
+
#
|
|
113
|
+
# @return [Boolean, nil]
|
|
114
|
+
optional :referred_reward_upfront,
|
|
115
|
+
GrowsurfRuby::Internal::Type::Boolean,
|
|
116
|
+
api_name: :referredRewardUpfront
|
|
117
|
+
|
|
118
|
+
# @!attribute referred_value
|
|
119
|
+
# Tax valuation for the referred friend's side of a double-sided reward.
|
|
120
|
+
# Defaults to not tax-reportable (a purchase rebate).
|
|
121
|
+
#
|
|
122
|
+
# @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
|
|
123
|
+
optional :referred_value,
|
|
124
|
+
-> { GrowsurfRuby::RewardTaxValuation },
|
|
125
|
+
api_name: :referredValue
|
|
126
|
+
|
|
127
|
+
# @!attribute title
|
|
128
|
+
#
|
|
129
|
+
# @return [String, nil]
|
|
130
|
+
optional :title, String
|
|
131
|
+
|
|
132
|
+
# @!attribute value
|
|
133
|
+
# Tax valuation for the reward (the referrer's side of a double-sided reward).
|
|
134
|
+
# Used by tax documentation / 1099 reporting.
|
|
135
|
+
#
|
|
136
|
+
# @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
|
|
137
|
+
optional :value, -> { GrowsurfRuby::RewardTaxValuation }
|
|
138
|
+
|
|
139
|
+
# @!method initialize(id:, campaign_reward_id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_active: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
|
|
140
|
+
# Some parameter documentations has been truncated, see
|
|
141
|
+
# {GrowsurfRuby::Models::Campaign::RewardUpdateParams} for more details.
|
|
142
|
+
#
|
|
143
|
+
# @param id [String]
|
|
144
|
+
#
|
|
145
|
+
# @param campaign_reward_id [String]
|
|
146
|
+
#
|
|
147
|
+
# @param commission_structure [GrowsurfRuby::Models::CommissionStructure]
|
|
148
|
+
#
|
|
149
|
+
# @param conversions_required [Integer]
|
|
150
|
+
#
|
|
151
|
+
# @param coupon_code [String]
|
|
152
|
+
#
|
|
153
|
+
# @param description [String]
|
|
154
|
+
#
|
|
155
|
+
# @param image_url [String]
|
|
156
|
+
#
|
|
157
|
+
# @param is_active [Boolean]
|
|
158
|
+
#
|
|
159
|
+
# @param is_unlimited [Boolean]
|
|
160
|
+
#
|
|
161
|
+
# @param is_visible [Boolean]
|
|
162
|
+
#
|
|
163
|
+
# @param limit [Integer]
|
|
164
|
+
#
|
|
165
|
+
# @param limit_duration [Symbol, GrowsurfRuby::Models::Campaign::RewardUpdateParams::LimitDuration]
|
|
166
|
+
#
|
|
167
|
+
# @param metadata [Hash{Symbol=>Object}] Custom key/value metadata (single-level; values are stored as strings).
|
|
168
|
+
#
|
|
169
|
+
# @param next_milestone_prefix [String]
|
|
170
|
+
#
|
|
171
|
+
# @param next_milestone_suffix [String]
|
|
172
|
+
#
|
|
173
|
+
# @param number_of_winners [Integer]
|
|
174
|
+
#
|
|
175
|
+
# @param order [Integer]
|
|
176
|
+
#
|
|
177
|
+
# @param referral_coupon_code [String]
|
|
178
|
+
#
|
|
179
|
+
# @param referral_description [String]
|
|
180
|
+
#
|
|
181
|
+
# @param referred_reward_upfront [Boolean]
|
|
182
|
+
#
|
|
183
|
+
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Tax valuation for the referred friend's side of a double-sided reward. Defaults
|
|
184
|
+
#
|
|
185
|
+
# @param title [String]
|
|
186
|
+
#
|
|
187
|
+
# @param value [GrowsurfRuby::Models::RewardTaxValuation] Tax valuation for the reward (the referrer's side of a double-sided reward). Use
|
|
188
|
+
#
|
|
189
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
|
|
190
|
+
|
|
191
|
+
# @see GrowsurfRuby::Models::Campaign::RewardUpdateParams#limit_duration
|
|
192
|
+
module LimitDuration
|
|
193
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
194
|
+
|
|
195
|
+
IN_TOTAL = :IN_TOTAL
|
|
196
|
+
PER_MONTH = :PER_MONTH
|
|
197
|
+
PER_YEAR = :PER_YEAR
|
|
198
|
+
|
|
199
|
+
# @!method self.values
|
|
200
|
+
# @return [Array<Symbol>]
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
end
|
|
@@ -156,6 +156,12 @@ module GrowsurfRuby
|
|
|
156
156
|
# @return [Integer, nil]
|
|
157
157
|
optional :order, Integer, nil?: true
|
|
158
158
|
|
|
159
|
+
# @!attribute referral_coupon_code
|
|
160
|
+
# The coupon code delivered to the referred friend (double-sided rewards).
|
|
161
|
+
#
|
|
162
|
+
# @return [String, nil]
|
|
163
|
+
optional :referral_coupon_code, String, api_name: :referralCouponCode, nil?: true
|
|
164
|
+
|
|
159
165
|
# @!attribute referral_description
|
|
160
166
|
#
|
|
161
167
|
# @return [String, nil]
|
|
@@ -168,7 +174,22 @@ module GrowsurfRuby
|
|
|
168
174
|
GrowsurfRuby::Internal::Type::Boolean,
|
|
169
175
|
api_name: :referredRewardUpfront
|
|
170
176
|
|
|
171
|
-
# @!
|
|
177
|
+
# @!attribute referred_value
|
|
178
|
+
# Tax valuation for the referred friend's side of a double-sided reward.
|
|
179
|
+
#
|
|
180
|
+
# @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
|
|
181
|
+
optional :referred_value,
|
|
182
|
+
-> { GrowsurfRuby::RewardTaxValuation },
|
|
183
|
+
api_name: :referredValue,
|
|
184
|
+
nil?: true
|
|
185
|
+
|
|
186
|
+
# @!attribute value
|
|
187
|
+
# Tax valuation for the reward (the referrer's side of a double-sided reward).
|
|
188
|
+
#
|
|
189
|
+
# @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
|
|
190
|
+
optional :value, -> { GrowsurfRuby::RewardTaxValuation }, nil?: true
|
|
191
|
+
|
|
192
|
+
# @!method initialize(id:, is_unlimited:, metadata:, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, limit: nil, limit_duration: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, value: nil)
|
|
172
193
|
# @param id [String]
|
|
173
194
|
#
|
|
174
195
|
# @param is_unlimited [Boolean]
|
|
@@ -199,9 +220,15 @@ module GrowsurfRuby
|
|
|
199
220
|
#
|
|
200
221
|
# @param order [Integer, nil]
|
|
201
222
|
#
|
|
223
|
+
# @param referral_coupon_code [String, nil] The coupon code delivered to the referred friend (double-sided rewards).
|
|
224
|
+
#
|
|
202
225
|
# @param referral_description [String, nil]
|
|
203
226
|
#
|
|
204
227
|
# @param referred_reward_upfront [Boolean]
|
|
228
|
+
#
|
|
229
|
+
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation, nil] Tax valuation for the referred friend's side of a double-sided reward.
|
|
230
|
+
#
|
|
231
|
+
# @param value [GrowsurfRuby::Models::RewardTaxValuation, nil] Tax valuation for the reward (the referrer's side of a double-sided reward).
|
|
205
232
|
|
|
206
233
|
# @see GrowsurfRuby::Models::CampaignAPI::Reward#type
|
|
207
234
|
module Type
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Models
|
|
5
|
+
# @see GrowsurfRuby::Resources::Campaign#create
|
|
6
|
+
class CampaignCreateParams < GrowsurfRuby::Internal::Type::BaseModel
|
|
7
|
+
extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include GrowsurfRuby::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute type
|
|
11
|
+
#
|
|
12
|
+
# @return [Symbol, GrowsurfRuby::Models::CampaignCreateParams::Type]
|
|
13
|
+
required :type, enum: -> { GrowsurfRuby::CampaignCreateParams::Type }
|
|
14
|
+
|
|
15
|
+
# @!attribute company_logo_image_url
|
|
16
|
+
#
|
|
17
|
+
# @return [String, nil]
|
|
18
|
+
optional :company_logo_image_url, String, api_name: :companyLogoImageUrl
|
|
19
|
+
|
|
20
|
+
# @!attribute company_name
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :company_name, String, api_name: :companyName
|
|
24
|
+
|
|
25
|
+
# @!attribute currency_iso
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :currency_iso, String, api_name: :currencyISO
|
|
29
|
+
|
|
30
|
+
# @!attribute name
|
|
31
|
+
#
|
|
32
|
+
# @return [String, nil]
|
|
33
|
+
optional :name, String
|
|
34
|
+
|
|
35
|
+
# @!attribute rewards
|
|
36
|
+
#
|
|
37
|
+
# @return [Array<GrowsurfRuby::Models::Campaign::RewardCreateParams>, nil]
|
|
38
|
+
optional :rewards,
|
|
39
|
+
-> { GrowsurfRuby::Internal::Type::ArrayOf[GrowsurfRuby::Campaign::RewardCreateParams] }
|
|
40
|
+
|
|
41
|
+
# @!method initialize(type:, company_logo_image_url: nil, company_name: nil, currency_iso: nil, name: nil, rewards: nil, request_options: {})
|
|
42
|
+
# @param type [Symbol, GrowsurfRuby::Models::CampaignCreateParams::Type]
|
|
43
|
+
#
|
|
44
|
+
# @param company_logo_image_url [String]
|
|
45
|
+
#
|
|
46
|
+
# @param company_name [String]
|
|
47
|
+
#
|
|
48
|
+
# @param currency_iso [String]
|
|
49
|
+
#
|
|
50
|
+
# @param name [String]
|
|
51
|
+
#
|
|
52
|
+
# @param rewards [Array<GrowsurfRuby::Models::Campaign::RewardCreateParams>]
|
|
53
|
+
#
|
|
54
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
|
|
55
|
+
|
|
56
|
+
# @see GrowsurfRuby::Models::CampaignCreateParams#type
|
|
57
|
+
module Type
|
|
58
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
59
|
+
|
|
60
|
+
REFERRAL = :REFERRAL
|
|
61
|
+
AFFILIATE = :AFFILIATE
|
|
62
|
+
|
|
63
|
+
# @!method self.values
|
|
64
|
+
# @return [Array<Symbol>]
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Models
|
|
5
|
+
# @see GrowsurfRuby::Resources::Campaign#update
|
|
6
|
+
class CampaignUpdateParams < GrowsurfRuby::Internal::Type::BaseModel
|
|
7
|
+
extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include GrowsurfRuby::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!attribute company_logo_image_url
|
|
16
|
+
#
|
|
17
|
+
# @return [String, nil]
|
|
18
|
+
optional :company_logo_image_url, String, api_name: :companyLogoImageUrl
|
|
19
|
+
|
|
20
|
+
# @!attribute company_name
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :company_name, String, api_name: :companyName
|
|
24
|
+
|
|
25
|
+
# @!attribute name
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :name, String
|
|
29
|
+
|
|
30
|
+
# @!attribute status
|
|
31
|
+
#
|
|
32
|
+
# @return [Symbol, GrowsurfRuby::Models::CampaignUpdateParams::Status, nil]
|
|
33
|
+
optional :status, enum: -> { GrowsurfRuby::CampaignUpdateParams::Status }
|
|
34
|
+
|
|
35
|
+
# @!method initialize(id:, company_logo_image_url: nil, company_name: nil, name: nil, status: nil, request_options: {})
|
|
36
|
+
# @param id [String]
|
|
37
|
+
#
|
|
38
|
+
# @param company_logo_image_url [String]
|
|
39
|
+
#
|
|
40
|
+
# @param company_name [String]
|
|
41
|
+
#
|
|
42
|
+
# @param name [String]
|
|
43
|
+
#
|
|
44
|
+
# @param status [Symbol, GrowsurfRuby::Models::CampaignUpdateParams::Status]
|
|
45
|
+
#
|
|
46
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
|
|
47
|
+
|
|
48
|
+
# @see GrowsurfRuby::Models::CampaignUpdateParams#status
|
|
49
|
+
module Status
|
|
50
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
51
|
+
|
|
52
|
+
DRAFT = :DRAFT
|
|
53
|
+
PENDING = :PENDING
|
|
54
|
+
IN_PROGRESS = :IN_PROGRESS
|
|
55
|
+
COMPLETE = :COMPLETE
|
|
56
|
+
CANCELLED = :CANCELLED
|
|
57
|
+
|
|
58
|
+
# @!method self.values
|
|
59
|
+
# @return [Array<Symbol>]
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Models
|
|
5
|
+
class RewardTaxValuation < GrowsurfRuby::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute fair_market_value_usd
|
|
7
|
+
# Manual fair-market value in USD (major units) used as the fallback when the
|
|
8
|
+
# reward value cannot be resolved automatically. `null` = no manual value.
|
|
9
|
+
#
|
|
10
|
+
# @return [Float, nil]
|
|
11
|
+
optional :fair_market_value_usd, Float, api_name: :fairMarketValueUSD, nil?: true
|
|
12
|
+
|
|
13
|
+
# @!attribute is_tax_reportable
|
|
14
|
+
# Whether the reward's value counts toward 1099 thresholds/totals. `null` = use
|
|
15
|
+
# the smart default for the reward's source.
|
|
16
|
+
#
|
|
17
|
+
# @return [Boolean, nil]
|
|
18
|
+
optional :is_tax_reportable,
|
|
19
|
+
GrowsurfRuby::Internal::Type::Boolean,
|
|
20
|
+
api_name: :isTaxReportable,
|
|
21
|
+
nil?: true
|
|
22
|
+
|
|
23
|
+
# @!method initialize(fair_market_value_usd: nil, is_tax_reportable: nil)
|
|
24
|
+
# Some parameter documentations has been truncated, see
|
|
25
|
+
# {GrowsurfRuby::Models::RewardTaxValuation} for more details.
|
|
26
|
+
#
|
|
27
|
+
# Tax valuation settings for a reward. Only relevant when the program collects
|
|
28
|
+
# tax documentation.
|
|
29
|
+
#
|
|
30
|
+
# @param fair_market_value_usd [Float, nil] Manual fair-market value in USD (major units) used as the fallback when the rewa
|
|
31
|
+
#
|
|
32
|
+
# @param is_tax_reportable [Boolean, nil] Whether the reward's value counts toward 1099 thresholds/totals. `null` = use th
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/lib/growsurf_ruby/models.rb
CHANGED
|
@@ -46,6 +46,8 @@ module GrowsurfRuby
|
|
|
46
46
|
CampaignCreateMobileParticipantTokenParams =
|
|
47
47
|
GrowsurfRuby::Models::CampaignCreateMobileParticipantTokenParams
|
|
48
48
|
|
|
49
|
+
CampaignCreateParams = GrowsurfRuby::Models::CampaignCreateParams
|
|
50
|
+
|
|
49
51
|
CampaignListCommissionsParams = GrowsurfRuby::Models::CampaignListCommissionsParams
|
|
50
52
|
|
|
51
53
|
CampaignListLeaderboardParams = GrowsurfRuby::Models::CampaignListLeaderboardParams
|
|
@@ -62,6 +64,8 @@ module GrowsurfRuby
|
|
|
62
64
|
|
|
63
65
|
CampaignRetrieveParams = GrowsurfRuby::Models::CampaignRetrieveParams
|
|
64
66
|
|
|
67
|
+
CampaignUpdateParams = GrowsurfRuby::Models::CampaignUpdateParams
|
|
68
|
+
|
|
65
69
|
CommissionStructure = GrowsurfRuby::Models::CommissionStructure
|
|
66
70
|
|
|
67
71
|
ParticipantCommissionList = GrowsurfRuby::Models::ParticipantCommissionList
|
|
@@ -71,4 +75,6 @@ module GrowsurfRuby
|
|
|
71
75
|
ParticipantPayoutList = GrowsurfRuby::Models::ParticipantPayoutList
|
|
72
76
|
|
|
73
77
|
ReferralList = GrowsurfRuby::Models::ReferralList
|
|
78
|
+
|
|
79
|
+
RewardTaxValuation = GrowsurfRuby::Models::RewardTaxValuation
|
|
74
80
|
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Resources
|
|
5
|
+
class Campaign
|
|
6
|
+
class Design
|
|
7
|
+
# Retrieves a program's design configuration — the same surface as the dashboard
|
|
8
|
+
# Program Editor's **Design** tab (window layout, header, share channels, signup
|
|
9
|
+
# form, portal/landing pages, theme styling, and summary/status sections).
|
|
10
|
+
#
|
|
11
|
+
# This is a large, deeply nested object whose available fields depend on the
|
|
12
|
+
# program type. See the API reference for the full field list.
|
|
13
|
+
#
|
|
14
|
+
# @overload retrieve(id, request_options: {})
|
|
15
|
+
#
|
|
16
|
+
# @param id [String] GrowSurf program ID.
|
|
17
|
+
#
|
|
18
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
19
|
+
#
|
|
20
|
+
# @return [Hash{Symbol=>Object}]
|
|
21
|
+
def retrieve(id, params = {})
|
|
22
|
+
@client.request(
|
|
23
|
+
method: :get,
|
|
24
|
+
path: ["campaign/%1$s/design", id],
|
|
25
|
+
model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
|
|
26
|
+
options: params[:request_options]
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Updates a program's design configuration. Only the fields you send are changed (a
|
|
31
|
+
# surgical merge; arrays such as `signup.fields` replace wholesale). Unknown
|
|
32
|
+
# fields, fields not available for the program type, and invalid values return a
|
|
33
|
+
# `400`.
|
|
34
|
+
#
|
|
35
|
+
# The request body is a partial {CampaignDesign} object — see the API reference for
|
|
36
|
+
# the full field list.
|
|
37
|
+
#
|
|
38
|
+
# @overload update(id, body, request_options: {})
|
|
39
|
+
#
|
|
40
|
+
# @param id [String] GrowSurf program ID.
|
|
41
|
+
#
|
|
42
|
+
# @param body [Hash{Symbol=>Object}] Partial design configuration to merge.
|
|
43
|
+
#
|
|
44
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
45
|
+
#
|
|
46
|
+
# @return [Hash{Symbol=>Object}]
|
|
47
|
+
def update(id, body, params = {})
|
|
48
|
+
@client.request(
|
|
49
|
+
method: :patch,
|
|
50
|
+
path: ["campaign/%1$s/design", id],
|
|
51
|
+
body: body,
|
|
52
|
+
model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
|
|
53
|
+
options: params[:request_options]
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# @api private
|
|
58
|
+
#
|
|
59
|
+
# @param client [GrowsurfRuby::Client]
|
|
60
|
+
def initialize(client:)
|
|
61
|
+
@client = client
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Resources
|
|
5
|
+
class Campaign
|
|
6
|
+
class Emails
|
|
7
|
+
# Retrieves a program's email configuration — the same surface as the dashboard
|
|
8
|
+
# Program Editor's **Emails** tab (per-email templates plus sender, contact, and
|
|
9
|
+
# design settings).
|
|
10
|
+
#
|
|
11
|
+
# This is a large, nested object. See the API reference for the full field list.
|
|
12
|
+
#
|
|
13
|
+
# @overload retrieve(id, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param id [String] GrowSurf program ID.
|
|
16
|
+
#
|
|
17
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
18
|
+
#
|
|
19
|
+
# @return [Hash{Symbol=>Object}]
|
|
20
|
+
def retrieve(id, params = {})
|
|
21
|
+
@client.request(
|
|
22
|
+
method: :get,
|
|
23
|
+
path: ["campaign/%1$s/emails", id],
|
|
24
|
+
model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
|
|
25
|
+
options: params[:request_options]
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Updates a program's email configuration. Only the fields you send are changed.
|
|
30
|
+
# Unknown fields and invalid values return a `400`.
|
|
31
|
+
#
|
|
32
|
+
# The request body is a partial {CampaignEmails} object — see the API reference for
|
|
33
|
+
# the full field list.
|
|
34
|
+
#
|
|
35
|
+
# @overload update(id, body, request_options: {})
|
|
36
|
+
#
|
|
37
|
+
# @param id [String] GrowSurf program ID.
|
|
38
|
+
#
|
|
39
|
+
# @param body [Hash{Symbol=>Object}] Partial email configuration to merge.
|
|
40
|
+
#
|
|
41
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
42
|
+
#
|
|
43
|
+
# @return [Hash{Symbol=>Object}]
|
|
44
|
+
def update(id, body, params = {})
|
|
45
|
+
@client.request(
|
|
46
|
+
method: :patch,
|
|
47
|
+
path: ["campaign/%1$s/emails", id],
|
|
48
|
+
body: body,
|
|
49
|
+
model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
|
|
50
|
+
options: params[:request_options]
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# @api private
|
|
55
|
+
#
|
|
56
|
+
# @param client [GrowsurfRuby::Client]
|
|
57
|
+
def initialize(client:)
|
|
58
|
+
@client = client
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Resources
|
|
5
|
+
class Campaign
|
|
6
|
+
class Installation
|
|
7
|
+
# Retrieves a program's installation configuration — the same surface as the
|
|
8
|
+
# dashboard Program Editor's **Installation** tab (signup and mobile SDK
|
|
9
|
+
# installation settings).
|
|
10
|
+
#
|
|
11
|
+
# This is a nested object whose available fields depend on the program type. See
|
|
12
|
+
# the API reference for the full field list.
|
|
13
|
+
#
|
|
14
|
+
# @overload retrieve(id, request_options: {})
|
|
15
|
+
#
|
|
16
|
+
# @param id [String] GrowSurf program ID.
|
|
17
|
+
#
|
|
18
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
19
|
+
#
|
|
20
|
+
# @return [Hash{Symbol=>Object}]
|
|
21
|
+
def retrieve(id, params = {})
|
|
22
|
+
@client.request(
|
|
23
|
+
method: :get,
|
|
24
|
+
path: ["campaign/%1$s/installation", id],
|
|
25
|
+
model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
|
|
26
|
+
options: params[:request_options]
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Updates a program's installation configuration. Only the fields you send are
|
|
31
|
+
# changed. Unknown fields, fields not available for the program type, and invalid
|
|
32
|
+
# values return a `400`.
|
|
33
|
+
#
|
|
34
|
+
# The request body is a partial {CampaignInstallation} object — see the API
|
|
35
|
+
# reference for the full field list.
|
|
36
|
+
#
|
|
37
|
+
# @overload update(id, body, request_options: {})
|
|
38
|
+
#
|
|
39
|
+
# @param id [String] GrowSurf program ID.
|
|
40
|
+
#
|
|
41
|
+
# @param body [Hash{Symbol=>Object}] Partial installation configuration to merge.
|
|
42
|
+
#
|
|
43
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
44
|
+
#
|
|
45
|
+
# @return [Hash{Symbol=>Object}]
|
|
46
|
+
def update(id, body, params = {})
|
|
47
|
+
@client.request(
|
|
48
|
+
method: :patch,
|
|
49
|
+
path: ["campaign/%1$s/installation", id],
|
|
50
|
+
body: body,
|
|
51
|
+
model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
|
|
52
|
+
options: params[:request_options]
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# @api private
|
|
57
|
+
#
|
|
58
|
+
# @param client [GrowsurfRuby::Client]
|
|
59
|
+
def initialize(client:)
|
|
60
|
+
@client = client
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|