growsurf-ruby 0.6.1 → 0.8.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 +15 -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/participant_cancel_delayed_referral_params.rb +28 -0
- data/lib/growsurf_ruby/models/campaign/participant_cancel_delayed_referral_response.rb +24 -0
- data/lib/growsurf_ruby/models/campaign/participant_refund_transaction_params.rb +130 -0
- data/lib/growsurf_ruby/models/campaign/participant_refund_transaction_response.rb +81 -0
- data/lib/growsurf_ruby/models/campaign/participant_trigger_referral_params.rb +19 -1
- data/lib/growsurf_ruby/models/campaign/reward.rb +166 -0
- data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +189 -0
- data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +182 -0
- data/lib/growsurf_ruby/models/campaign_create_params.rb +82 -0
- data/lib/growsurf_ruby/models/campaign_update_params.rb +112 -0
- data/lib/growsurf_ruby/models.rb +4 -0
- data/lib/growsurf_ruby/resources/campaign/participant.rb +98 -3
- data/lib/growsurf_ruby/resources/campaign/rewards.rb +191 -0
- data/lib/growsurf_ruby/resources/campaign.rb +105 -0
- data/lib/growsurf_ruby/version.rb +1 -1
- data/lib/growsurf_ruby.rb +12 -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/participant_cancel_delayed_referral_params.rbi +48 -0
- data/rbi/growsurf_ruby/models/campaign/participant_cancel_delayed_referral_response.rbi +36 -0
- data/rbi/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbi +234 -0
- data/rbi/growsurf_ruby/models/campaign/participant_refund_transaction_response.rbi +131 -0
- data/rbi/growsurf_ruby/models/campaign/participant_trigger_referral_params.rbi +24 -1
- data/rbi/growsurf_ruby/models/campaign/reward.rbi +252 -0
- data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +330 -0
- data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +281 -0
- data/rbi/growsurf_ruby/models/campaign_create_params.rbi +143 -0
- data/rbi/growsurf_ruby/models/campaign_update_params.rbi +193 -0
- data/rbi/growsurf_ruby/models.rbi +4 -0
- data/rbi/growsurf_ruby/resources/campaign/participant.rbi +94 -0
- data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +200 -0
- data/rbi/growsurf_ruby/resources/campaign.rbi +99 -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/participant_cancel_delayed_referral_params.rbs +30 -0
- data/sig/growsurf_ruby/models/campaign/participant_cancel_delayed_referral_response.rbs +20 -0
- data/sig/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbs +151 -0
- data/sig/growsurf_ruby/models/campaign/participant_refund_transaction_response.rbs +75 -0
- data/sig/growsurf_ruby/models/campaign/participant_trigger_referral_params.rbs +7 -1
- data/sig/growsurf_ruby/models/campaign/reward.rbs +131 -0
- data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +192 -0
- data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +182 -0
- data/sig/growsurf_ruby/models/campaign_create_params.rbs +88 -0
- data/sig/growsurf_ruby/models/campaign_update_params.rbs +119 -0
- data/sig/growsurf_ruby/models.rbs +4 -0
- data/sig/growsurf_ruby/resources/campaign/participant.rbs +28 -0
- data/sig/growsurf_ruby/resources/campaign/rewards.rbs +70 -0
- data/sig/growsurf_ruby/resources/campaign.rbs +35 -0
- metadata +38 -2
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Models
|
|
5
|
+
class CampaignCreateParams < GrowsurfRuby::Internal::Type::BaseModel
|
|
6
|
+
extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include GrowsurfRuby::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
GrowsurfRuby::CampaignCreateParams,
|
|
13
|
+
GrowsurfRuby::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(GrowsurfRuby::CampaignCreateParams::Type::OrSymbol) }
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_reader :company_logo_image_url
|
|
22
|
+
|
|
23
|
+
sig { params(company_logo_image_url: String).void }
|
|
24
|
+
attr_writer :company_logo_image_url
|
|
25
|
+
|
|
26
|
+
sig { returns(T.nilable(String)) }
|
|
27
|
+
attr_reader :company_name
|
|
28
|
+
|
|
29
|
+
sig { params(company_name: String).void }
|
|
30
|
+
attr_writer :company_name
|
|
31
|
+
|
|
32
|
+
sig { returns(T.nilable(String)) }
|
|
33
|
+
attr_reader :currency_iso
|
|
34
|
+
|
|
35
|
+
sig { params(currency_iso: String).void }
|
|
36
|
+
attr_writer :currency_iso
|
|
37
|
+
|
|
38
|
+
sig { returns(T.nilable(String)) }
|
|
39
|
+
attr_reader :goal
|
|
40
|
+
|
|
41
|
+
sig { params(goal: String).void }
|
|
42
|
+
attr_writer :goal
|
|
43
|
+
|
|
44
|
+
sig { returns(T.nilable(String)) }
|
|
45
|
+
attr_reader :name
|
|
46
|
+
|
|
47
|
+
sig { params(name: String).void }
|
|
48
|
+
attr_writer :name
|
|
49
|
+
|
|
50
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
51
|
+
attr_reader :options
|
|
52
|
+
|
|
53
|
+
sig { params(options: T::Hash[Symbol, T.anything]).void }
|
|
54
|
+
attr_writer :options
|
|
55
|
+
|
|
56
|
+
sig do
|
|
57
|
+
returns(T.nilable(T::Array[GrowsurfRuby::Campaign::RewardCreateParams]))
|
|
58
|
+
end
|
|
59
|
+
attr_reader :rewards
|
|
60
|
+
|
|
61
|
+
sig do
|
|
62
|
+
params(
|
|
63
|
+
rewards: T::Array[GrowsurfRuby::Campaign::RewardCreateParams::OrHash]
|
|
64
|
+
).void
|
|
65
|
+
end
|
|
66
|
+
attr_writer :rewards
|
|
67
|
+
|
|
68
|
+
sig do
|
|
69
|
+
params(
|
|
70
|
+
type: GrowsurfRuby::CampaignCreateParams::Type::OrSymbol,
|
|
71
|
+
company_logo_image_url: String,
|
|
72
|
+
company_name: String,
|
|
73
|
+
currency_iso: String,
|
|
74
|
+
goal: String,
|
|
75
|
+
name: String,
|
|
76
|
+
options: T::Hash[Symbol, T.anything],
|
|
77
|
+
rewards: T::Array[GrowsurfRuby::Campaign::RewardCreateParams::OrHash],
|
|
78
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
79
|
+
).returns(T.attached_class)
|
|
80
|
+
end
|
|
81
|
+
def self.new(
|
|
82
|
+
type:,
|
|
83
|
+
company_logo_image_url: nil,
|
|
84
|
+
company_name: nil,
|
|
85
|
+
currency_iso: nil,
|
|
86
|
+
goal: nil,
|
|
87
|
+
name: nil,
|
|
88
|
+
options: nil,
|
|
89
|
+
rewards: nil,
|
|
90
|
+
request_options: {}
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
sig do
|
|
95
|
+
override.returns(
|
|
96
|
+
{
|
|
97
|
+
type: GrowsurfRuby::CampaignCreateParams::Type::OrSymbol,
|
|
98
|
+
company_logo_image_url: String,
|
|
99
|
+
company_name: String,
|
|
100
|
+
currency_iso: String,
|
|
101
|
+
goal: String,
|
|
102
|
+
name: String,
|
|
103
|
+
options: T::Hash[Symbol, T.anything],
|
|
104
|
+
rewards:
|
|
105
|
+
T::Array[GrowsurfRuby::Campaign::RewardCreateParams::OrHash],
|
|
106
|
+
request_options: GrowsurfRuby::RequestOptions
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
def to_hash
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
module Type
|
|
114
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
115
|
+
|
|
116
|
+
TaggedSymbol =
|
|
117
|
+
T.type_alias do
|
|
118
|
+
T.all(Symbol, GrowsurfRuby::CampaignCreateParams::Type)
|
|
119
|
+
end
|
|
120
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
121
|
+
|
|
122
|
+
REFERRAL =
|
|
123
|
+
T.let(
|
|
124
|
+
:REFERRAL,
|
|
125
|
+
GrowsurfRuby::CampaignCreateParams::Type::TaggedSymbol
|
|
126
|
+
)
|
|
127
|
+
AFFILIATE =
|
|
128
|
+
T.let(
|
|
129
|
+
:AFFILIATE,
|
|
130
|
+
GrowsurfRuby::CampaignCreateParams::Type::TaggedSymbol
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
sig do
|
|
134
|
+
override.returns(
|
|
135
|
+
T::Array[GrowsurfRuby::CampaignCreateParams::Type::TaggedSymbol]
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
def self.values
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Models
|
|
5
|
+
class CampaignUpdateParams < GrowsurfRuby::Internal::Type::BaseModel
|
|
6
|
+
extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include GrowsurfRuby::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
GrowsurfRuby::CampaignUpdateParams,
|
|
13
|
+
GrowsurfRuby::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_reader :company_logo_image_url
|
|
22
|
+
|
|
23
|
+
sig { params(company_logo_image_url: String).void }
|
|
24
|
+
attr_writer :company_logo_image_url
|
|
25
|
+
|
|
26
|
+
sig { returns(T.nilable(String)) }
|
|
27
|
+
attr_reader :company_name
|
|
28
|
+
|
|
29
|
+
sig { params(company_name: String).void }
|
|
30
|
+
attr_writer :company_name
|
|
31
|
+
|
|
32
|
+
sig { returns(T.nilable(String)) }
|
|
33
|
+
attr_reader :currency_iso
|
|
34
|
+
|
|
35
|
+
sig { params(currency_iso: String).void }
|
|
36
|
+
attr_writer :currency_iso
|
|
37
|
+
|
|
38
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
39
|
+
attr_reader :design
|
|
40
|
+
|
|
41
|
+
sig { params(design: T::Hash[Symbol, T.anything]).void }
|
|
42
|
+
attr_writer :design
|
|
43
|
+
|
|
44
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
45
|
+
attr_reader :emails
|
|
46
|
+
|
|
47
|
+
sig { params(emails: T::Hash[Symbol, T.anything]).void }
|
|
48
|
+
attr_writer :emails
|
|
49
|
+
|
|
50
|
+
sig { returns(T.nilable(String)) }
|
|
51
|
+
attr_reader :goal
|
|
52
|
+
|
|
53
|
+
sig { params(goal: String).void }
|
|
54
|
+
attr_writer :goal
|
|
55
|
+
|
|
56
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
57
|
+
attr_reader :installation
|
|
58
|
+
|
|
59
|
+
sig { params(installation: T::Hash[Symbol, T.anything]).void }
|
|
60
|
+
attr_writer :installation
|
|
61
|
+
|
|
62
|
+
sig { returns(T.nilable(String)) }
|
|
63
|
+
attr_reader :name
|
|
64
|
+
|
|
65
|
+
sig { params(name: String).void }
|
|
66
|
+
attr_writer :name
|
|
67
|
+
|
|
68
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
69
|
+
attr_reader :notifications
|
|
70
|
+
|
|
71
|
+
sig { params(notifications: T::Hash[Symbol, T.anything]).void }
|
|
72
|
+
attr_writer :notifications
|
|
73
|
+
|
|
74
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
75
|
+
attr_reader :options
|
|
76
|
+
|
|
77
|
+
sig { params(options: T::Hash[Symbol, T.anything]).void }
|
|
78
|
+
attr_writer :options
|
|
79
|
+
|
|
80
|
+
sig do
|
|
81
|
+
returns(T.nilable(GrowsurfRuby::CampaignUpdateParams::Status::OrSymbol))
|
|
82
|
+
end
|
|
83
|
+
attr_reader :status
|
|
84
|
+
|
|
85
|
+
sig do
|
|
86
|
+
params(
|
|
87
|
+
status: GrowsurfRuby::CampaignUpdateParams::Status::OrSymbol
|
|
88
|
+
).void
|
|
89
|
+
end
|
|
90
|
+
attr_writer :status
|
|
91
|
+
|
|
92
|
+
sig do
|
|
93
|
+
params(
|
|
94
|
+
id: String,
|
|
95
|
+
company_logo_image_url: String,
|
|
96
|
+
company_name: String,
|
|
97
|
+
currency_iso: String,
|
|
98
|
+
design: T::Hash[Symbol, T.anything],
|
|
99
|
+
emails: T::Hash[Symbol, T.anything],
|
|
100
|
+
goal: String,
|
|
101
|
+
installation: T::Hash[Symbol, T.anything],
|
|
102
|
+
name: String,
|
|
103
|
+
notifications: T::Hash[Symbol, T.anything],
|
|
104
|
+
options: T::Hash[Symbol, T.anything],
|
|
105
|
+
status: GrowsurfRuby::CampaignUpdateParams::Status::OrSymbol,
|
|
106
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
107
|
+
).returns(T.attached_class)
|
|
108
|
+
end
|
|
109
|
+
def self.new(
|
|
110
|
+
id:,
|
|
111
|
+
company_logo_image_url: nil,
|
|
112
|
+
company_name: nil,
|
|
113
|
+
currency_iso: nil,
|
|
114
|
+
design: nil,
|
|
115
|
+
emails: nil,
|
|
116
|
+
goal: nil,
|
|
117
|
+
installation: nil,
|
|
118
|
+
name: nil,
|
|
119
|
+
notifications: nil,
|
|
120
|
+
options: nil,
|
|
121
|
+
status: nil,
|
|
122
|
+
request_options: {}
|
|
123
|
+
)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
sig do
|
|
127
|
+
override.returns(
|
|
128
|
+
{
|
|
129
|
+
id: String,
|
|
130
|
+
company_logo_image_url: String,
|
|
131
|
+
company_name: String,
|
|
132
|
+
currency_iso: String,
|
|
133
|
+
design: T::Hash[Symbol, T.anything],
|
|
134
|
+
emails: T::Hash[Symbol, T.anything],
|
|
135
|
+
goal: String,
|
|
136
|
+
installation: T::Hash[Symbol, T.anything],
|
|
137
|
+
name: String,
|
|
138
|
+
notifications: T::Hash[Symbol, T.anything],
|
|
139
|
+
options: T::Hash[Symbol, T.anything],
|
|
140
|
+
status: GrowsurfRuby::CampaignUpdateParams::Status::OrSymbol,
|
|
141
|
+
request_options: GrowsurfRuby::RequestOptions
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
def to_hash
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
module Status
|
|
149
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
150
|
+
|
|
151
|
+
TaggedSymbol =
|
|
152
|
+
T.type_alias do
|
|
153
|
+
T.all(Symbol, GrowsurfRuby::CampaignUpdateParams::Status)
|
|
154
|
+
end
|
|
155
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
156
|
+
|
|
157
|
+
DRAFT =
|
|
158
|
+
T.let(
|
|
159
|
+
:DRAFT,
|
|
160
|
+
GrowsurfRuby::CampaignUpdateParams::Status::TaggedSymbol
|
|
161
|
+
)
|
|
162
|
+
PENDING =
|
|
163
|
+
T.let(
|
|
164
|
+
:PENDING,
|
|
165
|
+
GrowsurfRuby::CampaignUpdateParams::Status::TaggedSymbol
|
|
166
|
+
)
|
|
167
|
+
IN_PROGRESS =
|
|
168
|
+
T.let(
|
|
169
|
+
:IN_PROGRESS,
|
|
170
|
+
GrowsurfRuby::CampaignUpdateParams::Status::TaggedSymbol
|
|
171
|
+
)
|
|
172
|
+
COMPLETE =
|
|
173
|
+
T.let(
|
|
174
|
+
:COMPLETE,
|
|
175
|
+
GrowsurfRuby::CampaignUpdateParams::Status::TaggedSymbol
|
|
176
|
+
)
|
|
177
|
+
CANCELLED =
|
|
178
|
+
T.let(
|
|
179
|
+
:CANCELLED,
|
|
180
|
+
GrowsurfRuby::CampaignUpdateParams::Status::TaggedSymbol
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
sig do
|
|
184
|
+
override.returns(
|
|
185
|
+
T::Array[GrowsurfRuby::CampaignUpdateParams::Status::TaggedSymbol]
|
|
186
|
+
)
|
|
187
|
+
end
|
|
188
|
+
def self.values
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
end
|
|
@@ -8,6 +8,8 @@ module GrowsurfRuby
|
|
|
8
8
|
CampaignCreateMobileParticipantTokenParams =
|
|
9
9
|
GrowsurfRuby::Models::CampaignCreateMobileParticipantTokenParams
|
|
10
10
|
|
|
11
|
+
CampaignCreateParams = GrowsurfRuby::Models::CampaignCreateParams
|
|
12
|
+
|
|
11
13
|
CampaignListCommissionsParams =
|
|
12
14
|
GrowsurfRuby::Models::CampaignListCommissionsParams
|
|
13
15
|
|
|
@@ -29,6 +31,8 @@ module GrowsurfRuby
|
|
|
29
31
|
|
|
30
32
|
CampaignRetrieveParams = GrowsurfRuby::Models::CampaignRetrieveParams
|
|
31
33
|
|
|
34
|
+
CampaignUpdateParams = GrowsurfRuby::Models::CampaignUpdateParams
|
|
35
|
+
|
|
32
36
|
CommissionStructure = GrowsurfRuby::Models::CommissionStructure
|
|
33
37
|
|
|
34
38
|
ParticipantCommissionList = GrowsurfRuby::Models::ParticipantCommissionList
|
|
@@ -332,6 +332,73 @@ module GrowsurfRuby
|
|
|
332
332
|
)
|
|
333
333
|
end
|
|
334
334
|
|
|
335
|
+
# Records an amendment (refund, partial refund, refund cancellation, or
|
|
336
|
+
# chargeback) against a previously recorded transaction and reverses or adjusts
|
|
337
|
+
# the referrer's commission.
|
|
338
|
+
sig do
|
|
339
|
+
params(
|
|
340
|
+
participant_id_or_email: String,
|
|
341
|
+
id: String,
|
|
342
|
+
amendment_type:
|
|
343
|
+
GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::AmendmentType::OrSymbol,
|
|
344
|
+
amount: Integer,
|
|
345
|
+
amount_refunded: Integer,
|
|
346
|
+
charge_id: String,
|
|
347
|
+
currency: String,
|
|
348
|
+
description: String,
|
|
349
|
+
external_id: String,
|
|
350
|
+
invoice_id: String,
|
|
351
|
+
order_id: String,
|
|
352
|
+
payment_id: String,
|
|
353
|
+
payment_intent_id: String,
|
|
354
|
+
refund_amount: Integer,
|
|
355
|
+
refund_id: String,
|
|
356
|
+
refund_status: String,
|
|
357
|
+
transaction_id: String,
|
|
358
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
359
|
+
).returns(
|
|
360
|
+
GrowsurfRuby::Models::Campaign::ParticipantRefundTransactionResponse
|
|
361
|
+
)
|
|
362
|
+
end
|
|
363
|
+
def refund_transaction(
|
|
364
|
+
# Path param: GrowSurf participant ID or URL-encoded participant email address.
|
|
365
|
+
participant_id_or_email,
|
|
366
|
+
# Path param: GrowSurf program ID.
|
|
367
|
+
id:,
|
|
368
|
+
# Body param
|
|
369
|
+
amendment_type: nil,
|
|
370
|
+
# Body param
|
|
371
|
+
amount: nil,
|
|
372
|
+
# Body param
|
|
373
|
+
amount_refunded: nil,
|
|
374
|
+
# Body param
|
|
375
|
+
charge_id: nil,
|
|
376
|
+
# Body param
|
|
377
|
+
currency: nil,
|
|
378
|
+
# Body param
|
|
379
|
+
description: nil,
|
|
380
|
+
# Body param
|
|
381
|
+
external_id: nil,
|
|
382
|
+
# Body param
|
|
383
|
+
invoice_id: nil,
|
|
384
|
+
# Body param
|
|
385
|
+
order_id: nil,
|
|
386
|
+
# Body param
|
|
387
|
+
payment_id: nil,
|
|
388
|
+
# Body param
|
|
389
|
+
payment_intent_id: nil,
|
|
390
|
+
# Body param
|
|
391
|
+
refund_amount: nil,
|
|
392
|
+
# Body param
|
|
393
|
+
refund_id: nil,
|
|
394
|
+
# Body param
|
|
395
|
+
refund_status: nil,
|
|
396
|
+
# Body param
|
|
397
|
+
transaction_id: nil,
|
|
398
|
+
request_options: {}
|
|
399
|
+
)
|
|
400
|
+
end
|
|
401
|
+
|
|
335
402
|
# Sends email invites on behalf of a participant to a list of email addresses.
|
|
336
403
|
sig do
|
|
337
404
|
params(
|
|
@@ -366,12 +433,39 @@ module GrowsurfRuby
|
|
|
366
433
|
params(
|
|
367
434
|
participant_id_or_email: String,
|
|
368
435
|
id: String,
|
|
436
|
+
delay_in_days: Integer,
|
|
369
437
|
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
370
438
|
).returns(
|
|
371
439
|
GrowsurfRuby::Models::Campaign::ParticipantTriggerReferralResponse
|
|
372
440
|
)
|
|
373
441
|
end
|
|
374
442
|
def trigger_referral(
|
|
443
|
+
# Path param: GrowSurf participant ID or URL-encoded participant email address.
|
|
444
|
+
participant_id_or_email,
|
|
445
|
+
# Path param: GrowSurf program ID.
|
|
446
|
+
id:,
|
|
447
|
+
# Body param: Number of whole days to hold referral credit before it is awarded.
|
|
448
|
+
# Useful for honoring a refund window before crediting a referrer. Omit this field
|
|
449
|
+
# to award credit immediately. The credit is awarded automatically once the delay
|
|
450
|
+
# elapses, and can be cancelled before then with the Cancel delayed referral
|
|
451
|
+
# trigger request.
|
|
452
|
+
delay_in_days: nil,
|
|
453
|
+
request_options: {}
|
|
454
|
+
)
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
# Cancels a pending delayed referral trigger for an existing referred participant
|
|
458
|
+
# by GrowSurf participant ID or email address.
|
|
459
|
+
sig do
|
|
460
|
+
params(
|
|
461
|
+
participant_id_or_email: String,
|
|
462
|
+
id: String,
|
|
463
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
464
|
+
).returns(
|
|
465
|
+
GrowsurfRuby::Models::Campaign::ParticipantCancelDelayedReferralResponse
|
|
466
|
+
)
|
|
467
|
+
end
|
|
468
|
+
def cancel_delayed_referral(
|
|
375
469
|
# GrowSurf participant ID or URL-encoded participant email address.
|
|
376
470
|
participant_id_or_email,
|
|
377
471
|
# GrowSurf program ID.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Resources
|
|
5
|
+
class Campaign
|
|
6
|
+
class Rewards
|
|
7
|
+
# Retrieves the active, visible, and enabled rewards configured for a program.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
id: String,
|
|
11
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
12
|
+
).returns(GrowsurfRuby::Models::Campaign::CampaignRewardListResponse)
|
|
13
|
+
end
|
|
14
|
+
def list(
|
|
15
|
+
# GrowSurf program ID.
|
|
16
|
+
id,
|
|
17
|
+
request_options: {}
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Creates a reward for a program. The reward `type` must be compatible with the
|
|
22
|
+
# program type.
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
id: String,
|
|
26
|
+
type:
|
|
27
|
+
GrowsurfRuby::Models::Campaign::RewardCreateParams::Type::OrSymbol,
|
|
28
|
+
commission_structure: GrowsurfRuby::CommissionStructure::OrHash,
|
|
29
|
+
conversions_required: Integer,
|
|
30
|
+
coupon_code: String,
|
|
31
|
+
description: String,
|
|
32
|
+
image_url: String,
|
|
33
|
+
is_active: T::Boolean,
|
|
34
|
+
is_unlimited: T::Boolean,
|
|
35
|
+
is_visible: T::Boolean,
|
|
36
|
+
limit: Integer,
|
|
37
|
+
limit_duration:
|
|
38
|
+
GrowsurfRuby::Models::Campaign::RewardCreateParams::LimitDuration::OrSymbol,
|
|
39
|
+
metadata: T::Hash[Symbol, T.anything],
|
|
40
|
+
next_milestone_prefix: String,
|
|
41
|
+
next_milestone_suffix: String,
|
|
42
|
+
number_of_winners: Integer,
|
|
43
|
+
order: Integer,
|
|
44
|
+
referral_coupon_code: String,
|
|
45
|
+
referral_description: String,
|
|
46
|
+
referred_reward_upfront: T::Boolean,
|
|
47
|
+
title: String,
|
|
48
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
49
|
+
).returns(GrowsurfRuby::Models::Campaign::Reward)
|
|
50
|
+
end
|
|
51
|
+
def create(
|
|
52
|
+
# Path param: GrowSurf program ID.
|
|
53
|
+
id,
|
|
54
|
+
# Body param: The reward type. Immutable after creation.
|
|
55
|
+
type:,
|
|
56
|
+
# Body param
|
|
57
|
+
commission_structure: nil,
|
|
58
|
+
# Body param
|
|
59
|
+
conversions_required: nil,
|
|
60
|
+
# Body param
|
|
61
|
+
coupon_code: nil,
|
|
62
|
+
# Body param
|
|
63
|
+
description: nil,
|
|
64
|
+
# Body param
|
|
65
|
+
image_url: nil,
|
|
66
|
+
# Body param
|
|
67
|
+
is_active: nil,
|
|
68
|
+
# Body param
|
|
69
|
+
is_unlimited: nil,
|
|
70
|
+
# Body param
|
|
71
|
+
is_visible: nil,
|
|
72
|
+
# Body param
|
|
73
|
+
limit: nil,
|
|
74
|
+
# Body param
|
|
75
|
+
limit_duration: nil,
|
|
76
|
+
# Body param: Custom key/value metadata (single-level; values are stored as
|
|
77
|
+
# strings).
|
|
78
|
+
metadata: nil,
|
|
79
|
+
# Body param
|
|
80
|
+
next_milestone_prefix: nil,
|
|
81
|
+
# Body param
|
|
82
|
+
next_milestone_suffix: nil,
|
|
83
|
+
# Body param
|
|
84
|
+
number_of_winners: nil,
|
|
85
|
+
# Body param
|
|
86
|
+
order: nil,
|
|
87
|
+
# Body param
|
|
88
|
+
referral_coupon_code: nil,
|
|
89
|
+
# Body param
|
|
90
|
+
referral_description: nil,
|
|
91
|
+
# Body param
|
|
92
|
+
referred_reward_upfront: nil,
|
|
93
|
+
# Body param
|
|
94
|
+
title: nil,
|
|
95
|
+
request_options: {}
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Updates an existing program reward. Only the fields you send are changed; `type`
|
|
100
|
+
# is immutable and must not be supplied.
|
|
101
|
+
sig do
|
|
102
|
+
params(
|
|
103
|
+
reward_id: String,
|
|
104
|
+
id: String,
|
|
105
|
+
commission_structure: GrowsurfRuby::CommissionStructure::OrHash,
|
|
106
|
+
conversions_required: Integer,
|
|
107
|
+
coupon_code: String,
|
|
108
|
+
description: String,
|
|
109
|
+
image_url: String,
|
|
110
|
+
is_active: T::Boolean,
|
|
111
|
+
is_unlimited: T::Boolean,
|
|
112
|
+
is_visible: T::Boolean,
|
|
113
|
+
limit: Integer,
|
|
114
|
+
limit_duration:
|
|
115
|
+
GrowsurfRuby::Models::Campaign::RewardUpdateParams::LimitDuration::OrSymbol,
|
|
116
|
+
metadata: T::Hash[Symbol, T.anything],
|
|
117
|
+
next_milestone_prefix: String,
|
|
118
|
+
next_milestone_suffix: String,
|
|
119
|
+
number_of_winners: Integer,
|
|
120
|
+
order: Integer,
|
|
121
|
+
referral_coupon_code: String,
|
|
122
|
+
referral_description: String,
|
|
123
|
+
referred_reward_upfront: T::Boolean,
|
|
124
|
+
title: String,
|
|
125
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
126
|
+
).returns(GrowsurfRuby::Models::Campaign::Reward)
|
|
127
|
+
end
|
|
128
|
+
def update(
|
|
129
|
+
# Path param: Program reward ID.
|
|
130
|
+
reward_id,
|
|
131
|
+
# Path param: GrowSurf program ID.
|
|
132
|
+
id:,
|
|
133
|
+
# Body param
|
|
134
|
+
commission_structure: nil,
|
|
135
|
+
# Body param
|
|
136
|
+
conversions_required: nil,
|
|
137
|
+
# Body param
|
|
138
|
+
coupon_code: nil,
|
|
139
|
+
# Body param
|
|
140
|
+
description: nil,
|
|
141
|
+
# Body param
|
|
142
|
+
image_url: nil,
|
|
143
|
+
# Body param
|
|
144
|
+
is_active: nil,
|
|
145
|
+
# Body param
|
|
146
|
+
is_unlimited: nil,
|
|
147
|
+
# Body param
|
|
148
|
+
is_visible: nil,
|
|
149
|
+
# Body param
|
|
150
|
+
limit: nil,
|
|
151
|
+
# Body param
|
|
152
|
+
limit_duration: nil,
|
|
153
|
+
# Body param: Custom key/value metadata (single-level; values are stored as
|
|
154
|
+
# strings).
|
|
155
|
+
metadata: nil,
|
|
156
|
+
# Body param
|
|
157
|
+
next_milestone_prefix: nil,
|
|
158
|
+
# Body param
|
|
159
|
+
next_milestone_suffix: nil,
|
|
160
|
+
# Body param
|
|
161
|
+
number_of_winners: nil,
|
|
162
|
+
# Body param
|
|
163
|
+
order: nil,
|
|
164
|
+
# Body param
|
|
165
|
+
referral_coupon_code: nil,
|
|
166
|
+
# Body param
|
|
167
|
+
referral_description: nil,
|
|
168
|
+
# Body param
|
|
169
|
+
referred_reward_upfront: nil,
|
|
170
|
+
# Body param
|
|
171
|
+
title: nil,
|
|
172
|
+
request_options: {}
|
|
173
|
+
)
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Deletes a program reward.
|
|
177
|
+
sig do
|
|
178
|
+
params(
|
|
179
|
+
reward_id: String,
|
|
180
|
+
id: String,
|
|
181
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
182
|
+
).returns(GrowsurfRuby::Models::Campaign::DeleteRewardResponse)
|
|
183
|
+
end
|
|
184
|
+
def delete(
|
|
185
|
+
# Program reward ID.
|
|
186
|
+
reward_id,
|
|
187
|
+
# GrowSurf program ID.
|
|
188
|
+
id:,
|
|
189
|
+
request_options: {}
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# @api private
|
|
194
|
+
sig { params(client: GrowsurfRuby::Client).returns(T.attached_class) }
|
|
195
|
+
def self.new(client:)
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
end
|