growsurf-ruby 1.20.1 → 1.21.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 +14 -0
- data/README.md +1 -1
- data/lib/growsurf_ruby/models/campaign/create.rb +13 -1
- data/lib/growsurf_ruby/models/campaign/delete_reward_group_response.rb +16 -0
- data/lib/growsurf_ruby/models/campaign/participant.rb +22 -1
- data/lib/growsurf_ruby/models/campaign/participant_bulk_delete_response.rb +1 -1
- data/lib/growsurf_ruby/models/campaign/participant_bulk_move_params.rb +20 -0
- data/lib/growsurf_ruby/models/campaign/participant_bulk_move_response.rb +57 -0
- data/lib/growsurf_ruby/models/campaign/participant_email_params.rb +2 -2
- data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rb +3 -3
- data/lib/growsurf_ruby/models/campaign/participant_reward.rb +9 -1
- data/lib/growsurf_ruby/models/campaign/participant_send_invites_params.rb +1 -7
- data/lib/growsurf_ruby/models/campaign/participant_send_invites_response.rb +11 -1
- data/lib/growsurf_ruby/models/campaign/participant_trigger_referral_params.rb +1 -1
- data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +12 -1
- data/lib/growsurf_ruby/models/campaign/reward.rb +10 -1
- data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +12 -1
- data/lib/growsurf_ruby/models/campaign/reward_group.rb +46 -0
- data/lib/growsurf_ruby/models/campaign/reward_group_create_params.rb +18 -0
- data/lib/growsurf_ruby/models/campaign/reward_group_delete_params.rb +14 -0
- data/lib/growsurf_ruby/models/campaign/reward_group_list_response.rb +13 -0
- data/lib/growsurf_ruby/models/campaign/reward_group_retrieve_params.rb +14 -0
- data/lib/growsurf_ruby/models/campaign/reward_group_source.rb +23 -0
- data/lib/growsurf_ruby/models/campaign/reward_group_update_params.rb +21 -0
- data/lib/growsurf_ruby/models/campaign/reward_list_params.rb +18 -0
- data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +14 -3
- data/lib/growsurf_ruby/models/campaign/webhook_test_response.rb +2 -2
- data/lib/growsurf_ruby/models/campaign_list_participants_params.rb +10 -1
- data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +12 -1
- data/lib/growsurf_ruby/resources/campaign/groups.rb +103 -0
- data/lib/growsurf_ruby/resources/campaign/participant.rb +51 -15
- data/lib/growsurf_ruby/resources/campaign/rewards.rb +19 -6
- data/lib/growsurf_ruby/resources/campaign.rb +9 -2
- data/lib/growsurf_ruby/version.rb +1 -1
- data/lib/growsurf_ruby.rb +12 -0
- data/rbi/growsurf_ruby/models/campaign/create.rbi +11 -0
- data/rbi/growsurf_ruby/models/campaign/delete_reward_group_response.rbi +39 -0
- data/rbi/growsurf_ruby/models/campaign/participant.rbi +26 -0
- data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +3 -6
- data/rbi/growsurf_ruby/models/campaign/participant_bulk_move_params.rbi +41 -0
- data/rbi/growsurf_ruby/models/campaign/participant_bulk_move_response.rbi +172 -0
- data/rbi/growsurf_ruby/models/campaign/participant_email_params.rbi +2 -2
- data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbi +2 -2
- data/rbi/growsurf_ruby/models/campaign/participant_reward.rbi +8 -0
- data/rbi/growsurf_ruby/models/campaign/participant_send_invites_params.rbi +0 -6
- data/rbi/growsurf_ruby/models/campaign/participant_send_invites_response.rbi +22 -3
- data/rbi/growsurf_ruby/models/campaign/participant_trigger_referral_params.rbi +2 -2
- data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +10 -0
- data/rbi/growsurf_ruby/models/campaign/reward.rbi +8 -0
- data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +10 -0
- data/rbi/growsurf_ruby/models/campaign/reward_group.rbi +109 -0
- data/rbi/growsurf_ruby/models/campaign/reward_group_create_params.rbi +40 -0
- data/rbi/growsurf_ruby/models/campaign/reward_group_delete_params.rbi +37 -0
- data/rbi/growsurf_ruby/models/campaign/reward_group_list_response.rbi +27 -0
- data/rbi/growsurf_ruby/models/campaign/reward_group_retrieve_params.rbi +37 -0
- data/rbi/growsurf_ruby/models/campaign/reward_group_source.rbi +36 -0
- data/rbi/growsurf_ruby/models/campaign/reward_group_update_params.rbi +48 -0
- data/rbi/growsurf_ruby/models/campaign/reward_list_params.rbi +43 -0
- data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +12 -2
- data/rbi/growsurf_ruby/models/campaign/webhook_test_response.rbi +2 -2
- data/rbi/growsurf_ruby/models/campaign_list_participants_params.rbi +13 -0
- data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +24 -0
- data/rbi/growsurf_ruby/resources/campaign/groups.rbi +93 -0
- data/rbi/growsurf_ruby/resources/campaign/participant.rbi +39 -9
- data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +13 -2
- data/rbi/growsurf_ruby/resources/campaign.rbi +8 -0
- data/sig/growsurf_ruby/models/campaign/create.rbs +5 -0
- data/sig/growsurf_ruby/models/campaign/delete_reward_group_response.rbs +16 -0
- data/sig/growsurf_ruby/models/campaign/participant.rbs +10 -0
- data/sig/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbs +4 -6
- data/sig/growsurf_ruby/models/campaign/participant_bulk_move_params.rbs +24 -0
- data/sig/growsurf_ruby/models/campaign/participant_bulk_move_response.rbs +89 -0
- data/sig/growsurf_ruby/models/campaign/participant_reward.rbs +5 -0
- data/sig/growsurf_ruby/models/campaign/participant_send_invites_params.rbs +1 -6
- data/sig/growsurf_ruby/models/campaign/participant_send_invites_response.rbs +14 -3
- data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +5 -0
- data/sig/growsurf_ruby/models/campaign/reward.rbs +5 -0
- data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +5 -0
- data/sig/growsurf_ruby/models/campaign/reward_group.rbs +55 -0
- data/sig/growsurf_ruby/models/campaign/reward_group_create_params.rbs +22 -0
- data/sig/growsurf_ruby/models/campaign/reward_group_delete_params.rbs +22 -0
- data/sig/growsurf_ruby/models/campaign/reward_group_list_response.rbs +13 -0
- data/sig/growsurf_ruby/models/campaign/reward_group_retrieve_params.rbs +22 -0
- data/sig/growsurf_ruby/models/campaign/reward_group_source.rbs +18 -0
- data/sig/growsurf_ruby/models/campaign/reward_group_update_params.rbs +25 -0
- data/sig/growsurf_ruby/models/campaign/reward_list_params.rbs +23 -0
- data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +5 -0
- data/sig/growsurf_ruby/models/campaign_list_participants_params.rbs +7 -0
- data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +9 -0
- data/sig/growsurf_ruby/resources/campaign/groups.rbs +42 -0
- data/sig/growsurf_ruby/resources/campaign/participant.rbs +9 -1
- data/sig/growsurf_ruby/resources/campaign/rewards.rbs +3 -0
- data/sig/growsurf_ruby/resources/campaign.rbs +3 -0
- metadata +38 -2
|
@@ -57,6 +57,15 @@ module GrowsurfRuby
|
|
|
57
57
|
# @return [String, nil]
|
|
58
58
|
optional :image_url, String, api_name: :imageUrl, nil?: true
|
|
59
59
|
|
|
60
|
+
# @!attribute group_id
|
|
61
|
+
# The group this reward belongs to (`grp_…`), or `null` for Default. A participant
|
|
62
|
+
# earns only their own group's rewards.
|
|
63
|
+
# `LEADERBOARD` rewards apply to the whole program and cannot be in a group. An ID
|
|
64
|
+
# that is not a group in this program returns `400`.
|
|
65
|
+
#
|
|
66
|
+
# @return [String, nil]
|
|
67
|
+
optional :group_id, String, api_name: :groupId, nil?: true
|
|
68
|
+
|
|
60
69
|
# @!attribute image_icon_key
|
|
61
70
|
# The starter icon shown for the reward, or `null` when `imageUrl` is your own
|
|
62
71
|
# image. Participant pages draw this icon in your program's accent color. Also set
|
|
@@ -96,7 +105,7 @@ module GrowsurfRuby
|
|
|
96
105
|
api_name: :limitDuration
|
|
97
106
|
|
|
98
107
|
# @!attribute metadata
|
|
99
|
-
# Custom key/value metadata (single-level; values are stored as strings).
|
|
108
|
+
# Custom key/value metadata (single-level; values are stored as strings). Sending `metadata` replaces the stored object.
|
|
100
109
|
# Each value must be a string, number, or boolean of up to 500 characters.
|
|
101
110
|
# Each key must have 1 to 40 characters once camelCased, and two keys that
|
|
102
111
|
# camelCase to the same key are rejected. Up to 50 keys. An entry that breaks
|
|
@@ -182,7 +191,7 @@ module GrowsurfRuby
|
|
|
182
191
|
# @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
|
|
183
192
|
optional :value, -> { GrowsurfRuby::RewardTaxValuation }, nil?: true
|
|
184
193
|
|
|
185
|
-
# @!method initialize(id:, campaign_reward_id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, image_icon_key: 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: {})
|
|
194
|
+
# @!method initialize(id:, campaign_reward_id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, group_id: nil, image_icon_key: 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: {})
|
|
186
195
|
# Some parameter documentations has been truncated, see
|
|
187
196
|
# {GrowsurfRuby::Models::Campaign::RewardUpdateParams} for more details.
|
|
188
197
|
#
|
|
@@ -202,6 +211,8 @@ module GrowsurfRuby
|
|
|
202
211
|
#
|
|
203
212
|
# @param image_url [String]
|
|
204
213
|
#
|
|
214
|
+
# @param group_id [String, nil]
|
|
215
|
+
#
|
|
205
216
|
# @param image_icon_key [Symbol, GrowsurfRuby::Models::Campaign::RewardUpdateParams::ImageIconKey, nil] The starter icon shown for the reward, or `null` when `imageUrl` is your own image.
|
|
206
217
|
#
|
|
207
218
|
# @param is_unlimited [Boolean] Whether the reward can be earned an unlimited number of times. Defaults to `true
|
|
@@ -212,7 +223,7 @@ module GrowsurfRuby
|
|
|
212
223
|
#
|
|
213
224
|
# @param limit_duration [Symbol, GrowsurfRuby::Models::Campaign::RewardUpdateParams::LimitDuration]
|
|
214
225
|
#
|
|
215
|
-
# @param metadata [Hash{Symbol=>Object}] Custom key/value metadata (single-level; values are stored as strings).
|
|
226
|
+
# @param metadata [Hash{Symbol=>Object}] Custom key/value metadata (single-level; values are stored as strings). Sending `metadata` replaces the stored object.
|
|
216
227
|
#
|
|
217
228
|
# For `DOUBLE_SIDED` rewards in referral programs, `rewardAmount` is the
|
|
218
229
|
# referrer’s amount and `referredRewardAmount` is the friend’s amount. If
|
|
@@ -11,7 +11,7 @@ module GrowsurfRuby
|
|
|
11
11
|
required :success, GrowsurfRuby::Internal::Type::Boolean
|
|
12
12
|
|
|
13
13
|
# @!attribute payload
|
|
14
|
-
# The mock event payload that was sent.
|
|
14
|
+
# The mock event payload that was sent. `id` is the event ID.
|
|
15
15
|
#
|
|
16
16
|
# @return [Hash{Symbol=>Object}, nil]
|
|
17
17
|
optional :payload, GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown]
|
|
@@ -24,7 +24,7 @@ module GrowsurfRuby
|
|
|
24
24
|
# @!method initialize(success:, payload: nil, response: nil)
|
|
25
25
|
# @param success [Boolean]
|
|
26
26
|
#
|
|
27
|
-
# @param payload [Hash{Symbol=>Object}] The mock event payload that was sent.
|
|
27
|
+
# @param payload [Hash{Symbol=>Object}] The mock event payload that was sent. `id` is the event ID.
|
|
28
28
|
#
|
|
29
29
|
# @param response [GrowsurfRuby::Models::Campaign::WebhookTestResponse::Response]
|
|
30
30
|
|
|
@@ -12,6 +12,13 @@ module GrowsurfRuby
|
|
|
12
12
|
# @return [String]
|
|
13
13
|
required :id, String
|
|
14
14
|
|
|
15
|
+
# @!attribute group_id
|
|
16
|
+
# Return only this group's members. Default has no ID, so it cannot be named
|
|
17
|
+
# here. An ID that is not a group in this program returns `404`.
|
|
18
|
+
#
|
|
19
|
+
# @return [String, nil]
|
|
20
|
+
optional :group_id, String
|
|
21
|
+
|
|
15
22
|
# @!attribute limit
|
|
16
23
|
# Number of results to return. Maximum 100.
|
|
17
24
|
#
|
|
@@ -32,9 +39,11 @@ module GrowsurfRuby
|
|
|
32
39
|
# @return [String, nil]
|
|
33
40
|
optional :next_id, String
|
|
34
41
|
|
|
35
|
-
# @!method initialize(id:, limit: nil, metadata: nil, next_id: nil, request_options: {})
|
|
42
|
+
# @!method initialize(id:, group_id: nil, limit: nil, metadata: nil, next_id: nil, request_options: {})
|
|
36
43
|
# @param id [String]
|
|
37
44
|
#
|
|
45
|
+
# @param group_id [String] Return only this group's members. Default has no ID, so it cannot be named here. An ID that is not a group in this program returns `404`.
|
|
46
|
+
#
|
|
38
47
|
# @param limit [Integer] Number of results to return. Maximum 100.
|
|
39
48
|
#
|
|
40
49
|
# @param metadata [Hash{Symbol=>String}] Return only participants whose metadata matches every given key and value exac
|
|
@@ -717,6 +717,15 @@ module GrowsurfRuby
|
|
|
717
717
|
|
|
718
718
|
# @see GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts#payout_status
|
|
719
719
|
class PayoutStatus < GrowsurfRuby::Internal::Type::BaseModel
|
|
720
|
+
# @!attribute attention
|
|
721
|
+
# Queued or issued Wise payouts that are paused until a refund is confirmed.
|
|
722
|
+
#
|
|
723
|
+
# @return [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric, nil]
|
|
724
|
+
optional :attention,
|
|
725
|
+
-> {
|
|
726
|
+
GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric
|
|
727
|
+
}
|
|
728
|
+
|
|
720
729
|
# @!attribute failed
|
|
721
730
|
#
|
|
722
731
|
# @return [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric, nil]
|
|
@@ -757,9 +766,11 @@ module GrowsurfRuby
|
|
|
757
766
|
GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric
|
|
758
767
|
}
|
|
759
768
|
|
|
760
|
-
# @!method initialize(failed: nil, issued: nil, queued: nil, reversed: nil, upcoming: nil)
|
|
769
|
+
# @!method initialize(attention: nil, failed: nil, issued: nil, queued: nil, reversed: nil, upcoming: nil)
|
|
761
770
|
# Affiliate only. Payout counts and amounts by status.
|
|
762
771
|
#
|
|
772
|
+
# @param attention [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric] Queued or issued Wise payouts that are paused until a refund is confirmed.
|
|
773
|
+
#
|
|
763
774
|
# @param failed [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric]
|
|
764
775
|
#
|
|
765
776
|
# @param issued [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric]
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Resources
|
|
5
|
+
class Campaign
|
|
6
|
+
# Group operations. Groups give some participants a different reward list.
|
|
7
|
+
class Groups
|
|
8
|
+
# Lists the program's groups in display order. Groups give some participants a
|
|
9
|
+
# different reward list. Each participant is in one group, and `groupId: null` is
|
|
10
|
+
# Default, which holds the program's standard rewards and is
|
|
11
|
+
# not in this list. A group's rewards replace Default's whole reward list for its
|
|
12
|
+
# members' new referrals. Leaderboard rewards stay program-wide.
|
|
13
|
+
#
|
|
14
|
+
# @overload list(id, request_options: {})
|
|
15
|
+
# @return [GrowsurfRuby::Models::Campaign::RewardGroupListResponse]
|
|
16
|
+
def list(id, params = {})
|
|
17
|
+
@client.request(
|
|
18
|
+
method: :get,
|
|
19
|
+
path: ["campaign/%1$s/groups", id],
|
|
20
|
+
model: GrowsurfRuby::Campaign::RewardGroupListResponse,
|
|
21
|
+
options: params[:request_options]
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Creates an empty group. Add Campaign Rewards with its `groupId` before adding
|
|
26
|
+
# participants or rules. Omit `rules` or send an empty array; nonempty rules return `400`.
|
|
27
|
+
# Group names must be unique, ignoring case. Duplicate names return `409`; "Default" returns `400`.
|
|
28
|
+
#
|
|
29
|
+
# @overload create(id, name:, rules: nil, request_options: {})
|
|
30
|
+
# @return [GrowsurfRuby::Models::Campaign::RewardGroup]
|
|
31
|
+
def create(id, params)
|
|
32
|
+
parsed, options = GrowsurfRuby::Campaign::RewardGroupCreateParams.dump_request(params)
|
|
33
|
+
@client.request(
|
|
34
|
+
method: :post,
|
|
35
|
+
path: ["campaign/%1$s/groups", id],
|
|
36
|
+
body: parsed,
|
|
37
|
+
model: GrowsurfRuby::Campaign::RewardGroup,
|
|
38
|
+
options: options
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Retrieves one of the program's groups.
|
|
43
|
+
#
|
|
44
|
+
# @overload retrieve(group_id, id:, request_options: {})
|
|
45
|
+
# @return [GrowsurfRuby::Models::Campaign::RewardGroup]
|
|
46
|
+
def retrieve(group_id, params)
|
|
47
|
+
parsed, options = GrowsurfRuby::Campaign::RewardGroupRetrieveParams.dump_request(params)
|
|
48
|
+
id = parsed.delete(:id) { raise ArgumentError.new("missing required path argument id") }
|
|
49
|
+
@client.request(
|
|
50
|
+
method: :get,
|
|
51
|
+
path: ["campaign/%1$s/groups/%2$s", id, group_id],
|
|
52
|
+
model: GrowsurfRuby::Campaign::RewardGroup,
|
|
53
|
+
options: options
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Renames, reorders, or changes the rules of a group. Sending `rules` replaces the
|
|
58
|
+
# whole list. An added `PARTICIPANT` rule moves that participant in now; a removed
|
|
59
|
+
# one moves them back to Default if they are still in this group. Email and domain
|
|
60
|
+
# rule changes move no one. To change the group's rewards, update its Campaign
|
|
61
|
+
# Rewards. Group names must be unique in the program, ignoring case. A name that
|
|
62
|
+
# another group uses returns `409`, and "Default" returns `400`.
|
|
63
|
+
#
|
|
64
|
+
# @overload update(group_id, id:, name: nil, order: nil, rules: nil, request_options: {})
|
|
65
|
+
# @return [GrowsurfRuby::Models::Campaign::RewardGroup]
|
|
66
|
+
def update(group_id, params)
|
|
67
|
+
parsed, options = GrowsurfRuby::Campaign::RewardGroupUpdateParams.dump_request(params)
|
|
68
|
+
id = parsed.delete(:id) { raise ArgumentError.new("missing required path argument id") }
|
|
69
|
+
@client.request(
|
|
70
|
+
method: :patch,
|
|
71
|
+
path: ["campaign/%1$s/groups/%2$s", id, group_id],
|
|
72
|
+
body: parsed,
|
|
73
|
+
model: GrowsurfRuby::Campaign::RewardGroup,
|
|
74
|
+
options: options
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Deletes a group. Its members move to Default, and its Campaign Rewards are
|
|
79
|
+
# removed from the program, so they no longer appear in
|
|
80
|
+
# `GET /campaign/{id}/reward-configs`. Rewards already earned keep their amounts
|
|
81
|
+
# and can still be sent.
|
|
82
|
+
#
|
|
83
|
+
# @overload delete(group_id, id:, request_options: {})
|
|
84
|
+
# @return [GrowsurfRuby::Models::Campaign::DeleteRewardGroupResponse]
|
|
85
|
+
def delete(group_id, params)
|
|
86
|
+
parsed, options = GrowsurfRuby::Campaign::RewardGroupDeleteParams.dump_request(params)
|
|
87
|
+
id = parsed.delete(:id) { raise ArgumentError.new("missing required path argument id") }
|
|
88
|
+
@client.request(
|
|
89
|
+
method: :delete,
|
|
90
|
+
path: ["campaign/%1$s/groups/%2$s", id, group_id],
|
|
91
|
+
model: GrowsurfRuby::Campaign::DeleteRewardGroupResponse,
|
|
92
|
+
options: options
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# @api private
|
|
97
|
+
def initialize(client:)
|
|
98
|
+
@client = client
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -37,7 +37,7 @@ module GrowsurfRuby
|
|
|
37
37
|
# require an existing affiliate. This endpoint does not accept `isAffiliate`, and
|
|
38
38
|
# affiliate enrollment cannot be removed through REST.
|
|
39
39
|
#
|
|
40
|
-
# @overload update(participant_id_or_email, id:, affiliate_status: nil, email: nil, first_name: nil, language: nil, last_name: nil, metadata: nil, notes: nil, referral_status: nil, referred_by: nil, unsubscribed: nil, vanity_keys: nil, request_options: {})
|
|
40
|
+
# @overload update(participant_id_or_email, id:, affiliate_status: nil, email: nil, first_name: nil, group_id: nil, language: nil, last_name: nil, metadata: nil, notes: nil, referral_status: nil, referred_by: nil, unsubscribed: nil, vanity_keys: nil, request_options: {})
|
|
41
41
|
#
|
|
42
42
|
# @param participant_id_or_email [String] Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
|
|
43
43
|
#
|
|
@@ -49,6 +49,8 @@ module GrowsurfRuby
|
|
|
49
49
|
#
|
|
50
50
|
# @param first_name [String] Body param
|
|
51
51
|
#
|
|
52
|
+
# @param group_id [String, nil] Body param: Moves the participant to this group (`grp_…`), or to Default with `null`.
|
|
53
|
+
#
|
|
52
54
|
# @param language [Symbol, GrowsurfRuby::Models::Campaign::Language, nil] Body param: The language of the participant's portal and program emails. Must be one of the program's languages (see `languages` in the program options). Send the base language or `null` to use the program's base language.
|
|
53
55
|
#
|
|
54
56
|
# @param last_name [String] Body param
|
|
@@ -85,7 +87,7 @@ module GrowsurfRuby
|
|
|
85
87
|
)
|
|
86
88
|
end
|
|
87
89
|
|
|
88
|
-
# Removes participant access immediately by GrowSurf participant ID or email address. Related record cleanup completes automatically. Do not repeat a successful deletion to finish cleanup.
|
|
90
|
+
# Removes participant access immediately by GrowSurf participant ID or email address. Related record cleanup completes automatically. Do not repeat a successful deletion to finish cleanup. A `202` response includes pending analytics erasure details.
|
|
89
91
|
#
|
|
90
92
|
# @overload delete(participant_id_or_email, id:, request_options: {})
|
|
91
93
|
#
|
|
@@ -119,7 +121,7 @@ module GrowsurfRuby
|
|
|
119
121
|
# `participants` is a GrowSurf participant ID or an email address (mixed lists are
|
|
120
122
|
# allowed). Up to `200` entries per request — chunk larger lists across multiple
|
|
121
123
|
# calls. The response reports a per-row `status` for every submitted entry, so a
|
|
122
|
-
# `200` can include rows that were `NOT_FOUND` or failed. Deletion is permanent. Successful rows lose participant access immediately; related record cleanup completes automatically, subject to required financial record retention.
|
|
124
|
+
# `200` can include rows that were `NOT_FOUND` or failed. Deletion is permanent. Successful rows lose participant access immediately; related record cleanup completes automatically, subject to required financial record retention. A `202` response also includes `analyticsErasure` when analytics erasure is pending.
|
|
123
125
|
#
|
|
124
126
|
# @overload bulk_delete(id, participants:, request_options: {})
|
|
125
127
|
#
|
|
@@ -143,6 +145,40 @@ module GrowsurfRuby
|
|
|
143
145
|
)
|
|
144
146
|
end
|
|
145
147
|
|
|
148
|
+
# Moves a list of participants to a group, or to Default with `groupId: null`.
|
|
149
|
+
# Each entry in `participants` is a GrowSurf participant ID or an email address
|
|
150
|
+
# (mixed lists are allowed). Up to `200` entries per request. The response reports
|
|
151
|
+
# a per-row `status` for every submitted entry, so a `200` can include rows that
|
|
152
|
+
# were `NOT_FOUND`. All found participants move together: if the move fails, no one
|
|
153
|
+
# moves. A move is a manual placement, so the group's email and domain rules do not
|
|
154
|
+
# override it later, and it removes the participant from any other group's
|
|
155
|
+
# `PARTICIPANT` rules. A move applies to new referrals only. Rewards already earned
|
|
156
|
+
# keep their amounts. An ID that is not a group in this program returns `400`.
|
|
157
|
+
#
|
|
158
|
+
# @overload bulk_move(id, participants:, group_id:, request_options: {})
|
|
159
|
+
#
|
|
160
|
+
# @param id [String] GrowSurf program ID.
|
|
161
|
+
#
|
|
162
|
+
# @param participants [Array<String>] GrowSurf participant IDs and/or email addresses to move. Mixed entries are allowed. 1 to 200 entries.
|
|
163
|
+
#
|
|
164
|
+
# @param group_id [String, nil] The group to move them to (`grp_…`), or `nil` for Default.
|
|
165
|
+
#
|
|
166
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
167
|
+
#
|
|
168
|
+
# @return [GrowsurfRuby::Models::Campaign::ParticipantBulkMoveResponse]
|
|
169
|
+
#
|
|
170
|
+
# @see GrowsurfRuby::Models::Campaign::ParticipantBulkMoveParams
|
|
171
|
+
def bulk_move(id, params)
|
|
172
|
+
parsed, options = GrowsurfRuby::Campaign::ParticipantBulkMoveParams.dump_request(params)
|
|
173
|
+
@client.request(
|
|
174
|
+
method: :post,
|
|
175
|
+
path: ["campaign/%1$s/participants/bulk-move", id],
|
|
176
|
+
body: parsed,
|
|
177
|
+
model: GrowsurfRuby::Models::Campaign::ParticipantBulkMoveResponse,
|
|
178
|
+
options: options
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
|
|
146
182
|
# Some parameter documentations has been truncated, see
|
|
147
183
|
# {GrowsurfRuby::Models::Campaign::ParticipantAddParams} for more details.
|
|
148
184
|
#
|
|
@@ -158,7 +194,7 @@ module GrowsurfRuby
|
|
|
158
194
|
# `isAffiliate: true` to keep the referral attribution and enroll the participant
|
|
159
195
|
# as an affiliate.
|
|
160
196
|
#
|
|
161
|
-
# @overload add(id, email:, fingerprint: nil, first_name: nil, ip_address: nil, is_affiliate: nil, language: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_at: nil, referred_by: nil, request_options: {})
|
|
197
|
+
# @overload add(id, email:, fingerprint: nil, first_name: nil, group_id: nil, ip_address: nil, is_affiliate: nil, language: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_at: nil, referred_by: nil, request_options: {})
|
|
162
198
|
#
|
|
163
199
|
# @param id [String] GrowSurf program ID.
|
|
164
200
|
#
|
|
@@ -168,6 +204,8 @@ module GrowsurfRuby
|
|
|
168
204
|
#
|
|
169
205
|
# @param first_name [String]
|
|
170
206
|
#
|
|
207
|
+
# @param group_id [String, nil] Places the new participant in this group (`grp_…`), or in Default with `null`.
|
|
208
|
+
#
|
|
171
209
|
# @param ip_address [String]
|
|
172
210
|
#
|
|
173
211
|
# @param is_affiliate [Boolean] Affiliate programs only. Controls affiliate enrollment for a new participant. `true` enrolls the participant with `affiliateStatus: APPROVED`; `false` creates a non-affiliate without `affiliateStatus`. Existing participants are returned unchanged.
|
|
@@ -224,11 +262,11 @@ module GrowsurfRuby
|
|
|
224
262
|
# @see GrowsurfRuby::Models::Campaign::ParticipantListCommissionsParams
|
|
225
263
|
def list_commissions(participant_id_or_email, params)
|
|
226
264
|
parsed, options = GrowsurfRuby::Campaign::ParticipantListCommissionsParams.dump_request(params)
|
|
227
|
-
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
228
265
|
id =
|
|
229
266
|
parsed.delete(:id) do
|
|
230
267
|
raise ArgumentError.new("missing required path argument #{_1}")
|
|
231
268
|
end
|
|
269
|
+
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
232
270
|
@client.request(
|
|
233
271
|
method: :get,
|
|
234
272
|
path: ["campaign/%1$s/participant/%2$s/commissions", id, participant_id_or_email],
|
|
@@ -260,11 +298,11 @@ module GrowsurfRuby
|
|
|
260
298
|
# @see GrowsurfRuby::Models::Campaign::ParticipantListPayoutsParams
|
|
261
299
|
def list_payouts(participant_id_or_email, params)
|
|
262
300
|
parsed, options = GrowsurfRuby::Campaign::ParticipantListPayoutsParams.dump_request(params)
|
|
263
|
-
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
264
301
|
id =
|
|
265
302
|
parsed.delete(:id) do
|
|
266
303
|
raise ArgumentError.new("missing required path argument #{_1}")
|
|
267
304
|
end
|
|
305
|
+
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
268
306
|
@client.request(
|
|
269
307
|
method: :get,
|
|
270
308
|
path: ["campaign/%1$s/participant/%2$s/payouts", id, participant_id_or_email],
|
|
@@ -307,11 +345,11 @@ module GrowsurfRuby
|
|
|
307
345
|
# @see GrowsurfRuby::Models::Campaign::ParticipantListReferralsParams
|
|
308
346
|
def list_referrals(participant_id_or_email, params)
|
|
309
347
|
parsed, options = GrowsurfRuby::Campaign::ParticipantListReferralsParams.dump_request(params)
|
|
310
|
-
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
311
348
|
id =
|
|
312
349
|
parsed.delete(:id) do
|
|
313
350
|
raise ArgumentError.new("missing required path argument #{_1}")
|
|
314
351
|
end
|
|
352
|
+
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
315
353
|
@client.request(
|
|
316
354
|
method: :get,
|
|
317
355
|
path: ["campaign/%1$s/participant/%2$s/referrals", id, participant_id_or_email],
|
|
@@ -346,11 +384,11 @@ module GrowsurfRuby
|
|
|
346
384
|
# @see GrowsurfRuby::Models::Campaign::ParticipantListRewardsParams
|
|
347
385
|
def list_rewards(participant_id_or_email, params)
|
|
348
386
|
parsed, options = GrowsurfRuby::Campaign::ParticipantListRewardsParams.dump_request(params)
|
|
349
|
-
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
350
387
|
id =
|
|
351
388
|
parsed.delete(:id) do
|
|
352
389
|
raise ArgumentError.new("missing required path argument #{_1}")
|
|
353
390
|
end
|
|
391
|
+
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
354
392
|
@client.request(
|
|
355
393
|
method: :get,
|
|
356
394
|
path: ["campaign/%1$s/participant/%2$s/rewards", id, participant_id_or_email],
|
|
@@ -505,9 +543,9 @@ module GrowsurfRuby
|
|
|
505
543
|
|
|
506
544
|
# Sends email invites on behalf of a participant to a list of email addresses.
|
|
507
545
|
# Sending invites via the API requires a **verified custom email domain** on the
|
|
508
|
-
# program
|
|
546
|
+
# program. Until one is verified, it returns `success: false`.
|
|
509
547
|
#
|
|
510
|
-
# @overload send_invites(participant_id_or_email, id:, email_addresses:, message_text:,
|
|
548
|
+
# @overload send_invites(participant_id_or_email, id:, email_addresses:, message_text:, request_options: {})
|
|
511
549
|
#
|
|
512
550
|
# @param participant_id_or_email [String] Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
|
|
513
551
|
#
|
|
@@ -517,8 +555,6 @@ module GrowsurfRuby
|
|
|
517
555
|
#
|
|
518
556
|
# @param message_text [String] Body param
|
|
519
557
|
#
|
|
520
|
-
# @param subject_text [String] Body param
|
|
521
|
-
#
|
|
522
558
|
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
523
559
|
#
|
|
524
560
|
# @return [GrowsurfRuby::Models::Campaign::ParticipantSendInvitesResponse]
|
|
@@ -623,7 +659,7 @@ module GrowsurfRuby
|
|
|
623
659
|
#
|
|
624
660
|
# @param id [String] Path param: GrowSurf program ID.
|
|
625
661
|
#
|
|
626
|
-
# @param body [String] Body param: HTML body for a free-form email. You can personalize it with dynamic text, inserting `{{...}}` tokens like `{{firstName}}` or `{{shareUrl}}`. See [Guide to using dynamic text in GrowSurf emails](https://support.growsurf.com/article/213-guide-to-using-dynamic-text-in-growsurf-emails).
|
|
662
|
+
# @param body [String] Body param: HTML body for a free-form email. When `settings.design.layoutMode` is `INLINE`, include `{{emailFooter}}` in the body; `{{emailHeader}}` is optional. You can personalize it with dynamic text, inserting `{{...}}` tokens like `{{firstName}}` or `{{shareUrl}}`. See [Guide to using dynamic text in GrowSurf emails](https://support.growsurf.com/article/213-guide-to-using-dynamic-text-in-growsurf-emails).
|
|
627
663
|
#
|
|
628
664
|
# @param email_type [String] Body param: The program email template to trigger (template mode). Send the camelC
|
|
629
665
|
#
|
|
@@ -671,11 +707,11 @@ module GrowsurfRuby
|
|
|
671
707
|
# @see GrowsurfRuby::Models::Campaign::ParticipantListActivityLogsParams
|
|
672
708
|
def list_activity_logs(participant_id_or_email, params)
|
|
673
709
|
parsed, options = GrowsurfRuby::Campaign::ParticipantListActivityLogsParams.dump_request(params)
|
|
674
|
-
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
675
710
|
id =
|
|
676
711
|
parsed.delete(:id) do
|
|
677
712
|
raise ArgumentError.new("missing required path argument #{_1}")
|
|
678
713
|
end
|
|
714
|
+
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
679
715
|
@client.request(
|
|
680
716
|
method: :get,
|
|
681
717
|
path: ["campaign/%1$s/participant/%2$s/activity-logs", id, participant_id_or_email],
|
|
@@ -779,7 +815,7 @@ module GrowsurfRuby
|
|
|
779
815
|
#
|
|
780
816
|
# @param id [String] Path param: GrowSurf program ID.
|
|
781
817
|
#
|
|
782
|
-
# @param provider [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationParams::Provider] Body param: The payout provider the participant should confirm a destination for.
|
|
818
|
+
# @param provider [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationParams::Provider] Body param: The payout provider the participant should confirm a destination for. `VENMO` uses a confirmed email and is available only when connected PayPal Payouts and payout-email confirmation are enabled in a USD program. Venmo recipients must be in the United States.
|
|
783
819
|
#
|
|
784
820
|
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
785
821
|
#
|
|
@@ -5,23 +5,32 @@ module GrowsurfRuby
|
|
|
5
5
|
class Campaign
|
|
6
6
|
class Rewards
|
|
7
7
|
# Retrieves configured Campaign Rewards, including switched-off rewards and rewards
|
|
8
|
-
# whose
|
|
8
|
+
# whose reward type is not selected. Deleted rewards are excluded. The campaign response's
|
|
9
9
|
# embedded `rewards` array includes only enabled, visible rewards. A reward can be earned only
|
|
10
|
-
# when it also appears in the campaign response's embedded `rewards` array.
|
|
10
|
+
# when it also appears in the campaign response's embedded `rewards` array. The list includes
|
|
11
|
+
# every group's rewards. Each reward's `groupId` names its group (`null` is Default). Pass
|
|
12
|
+
# `group_id` to return one group's rewards.
|
|
11
13
|
#
|
|
12
|
-
# @overload list(id, request_options: {})
|
|
14
|
+
# @overload list(id, group_id: nil, request_options: {})
|
|
13
15
|
#
|
|
14
16
|
# @param id [String] GrowSurf program ID.
|
|
15
17
|
#
|
|
18
|
+
# @param group_id [String] Return only this group's rewards. To get Default's rewards, omit `groupId` and keep the rewards whose `groupId` is `null`. An ID that is not a group in this program returns `404`.
|
|
19
|
+
#
|
|
16
20
|
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
17
21
|
#
|
|
18
22
|
# @return [GrowsurfRuby::Models::Campaign::CampaignRewardListResponse]
|
|
23
|
+
#
|
|
24
|
+
# @see GrowsurfRuby::Models::Campaign::RewardListParams
|
|
19
25
|
def list(id, params = {})
|
|
26
|
+
parsed, options = GrowsurfRuby::Campaign::RewardListParams.dump_request(params)
|
|
27
|
+
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
20
28
|
@client.request(
|
|
21
29
|
method: :get,
|
|
22
30
|
path: ["campaign/%1$s/reward-configs", id],
|
|
31
|
+
query: query.transform_keys(group_id: "groupId"),
|
|
23
32
|
model: GrowsurfRuby::Models::Campaign::CampaignRewardListResponse,
|
|
24
|
-
options:
|
|
33
|
+
options: options
|
|
25
34
|
)
|
|
26
35
|
end
|
|
27
36
|
|
|
@@ -33,7 +42,7 @@ module GrowsurfRuby
|
|
|
33
42
|
# requires a `FIXED` commission with a positive `amount`.
|
|
34
43
|
# A concurrent edit can return `409`; reload the program before retrying.
|
|
35
44
|
#
|
|
36
|
-
# @overload create(id, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, image_icon_key: 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: {})
|
|
45
|
+
# @overload create(id, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, group_id: nil, image_icon_key: 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: {})
|
|
37
46
|
#
|
|
38
47
|
# @param id [String] Path param: GrowSurf program ID.
|
|
39
48
|
#
|
|
@@ -51,6 +60,8 @@ module GrowsurfRuby
|
|
|
51
60
|
#
|
|
52
61
|
# @param image_url [String] Body param
|
|
53
62
|
#
|
|
63
|
+
# @param group_id [String, nil] Body param: The group this reward belongs to (`grp_…`), or `null` for Default.
|
|
64
|
+
#
|
|
54
65
|
# @param image_icon_key [Symbol, GrowsurfRuby::Models::Campaign::RewardCreateParams::ImageIconKey, nil] Body param: The starter icon shown for the reward, or `null` when `imageUrl` is your own image. Participant pages draw this icon in your program's accent color. Also set `imageUrl` to the icon's image so the iOS and Android SDKs can show it. Sending `imageUrl` without `imageIconKey` clears it.
|
|
55
66
|
#
|
|
56
67
|
# @param is_unlimited [Boolean] Body param: Whether the reward can be earned an unlimited number of times. Defaul
|
|
@@ -117,7 +128,7 @@ module GrowsurfRuby
|
|
|
117
128
|
# returns `400` and is not saved. A concurrent edit can return `409`; reload the
|
|
118
129
|
# program before retrying.
|
|
119
130
|
#
|
|
120
|
-
# @overload update(campaign_reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, image_icon_key: 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: {})
|
|
131
|
+
# @overload update(campaign_reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, group_id: nil, image_icon_key: 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: {})
|
|
121
132
|
#
|
|
122
133
|
# @param campaign_reward_id [String] Path param: Campaign reward ID.
|
|
123
134
|
#
|
|
@@ -135,6 +146,8 @@ module GrowsurfRuby
|
|
|
135
146
|
#
|
|
136
147
|
# @param image_url [String] Body param
|
|
137
148
|
#
|
|
149
|
+
# @param group_id [String, nil] Body param: The group this reward belongs to (`grp_…`), or `null` for Default.
|
|
150
|
+
#
|
|
138
151
|
# @param image_icon_key [Symbol, GrowsurfRuby::Models::Campaign::RewardUpdateParams::ImageIconKey, nil] Body param: The starter icon shown for the reward, or `null` when `imageUrl` is your own image. Participant pages draw this icon in your program's accent color. Also set `imageUrl` to the icon's image so the iOS and Android SDKs can show it. Sending `imageUrl` without `imageIconKey` clears it.
|
|
139
152
|
#
|
|
140
153
|
# @param is_unlimited [Boolean] Body param: Whether the reward can be earned an unlimited number of times. Defaul
|
|
@@ -22,6 +22,10 @@ module GrowsurfRuby
|
|
|
22
22
|
# @return [GrowsurfRuby::Resources::Campaign::ProgramResources]
|
|
23
23
|
attr_reader :resources
|
|
24
24
|
|
|
25
|
+
# Group operations. Groups give some participants a different reward list.
|
|
26
|
+
# @return [GrowsurfRuby::Resources::Campaign::Groups]
|
|
27
|
+
attr_reader :groups
|
|
28
|
+
|
|
25
29
|
# Program Editor "Design" tab configuration operations.
|
|
26
30
|
# @return [GrowsurfRuby::Resources::Campaign::Design]
|
|
27
31
|
attr_reader :design
|
|
@@ -413,10 +417,12 @@ module GrowsurfRuby
|
|
|
413
417
|
|
|
414
418
|
# Retrieves a paged list of participants in a program.
|
|
415
419
|
#
|
|
416
|
-
# @overload list_participants(id, limit: nil, metadata: nil, next_id: nil, request_options: {})
|
|
420
|
+
# @overload list_participants(id, group_id: nil, limit: nil, metadata: nil, next_id: nil, request_options: {})
|
|
417
421
|
#
|
|
418
422
|
# @param id [String] GrowSurf program ID.
|
|
419
423
|
#
|
|
424
|
+
# @param group_id [String] Return only this group's members. Default has no ID, so it cannot be named here. An ID that is not a group in this program returns `404`.
|
|
425
|
+
#
|
|
420
426
|
# @param limit [Integer] Number of results to return. Maximum 100.
|
|
421
427
|
#
|
|
422
428
|
# @param metadata [Hash{Symbol=>String}] Return only participants whose metadata matches every given key and value exac
|
|
@@ -434,7 +440,7 @@ module GrowsurfRuby
|
|
|
434
440
|
@client.request(
|
|
435
441
|
method: :get,
|
|
436
442
|
path: ["campaign/%1$s/participants", id],
|
|
437
|
-
query: query.transform_keys(next_id: "nextId"),
|
|
443
|
+
query: query.transform_keys(group_id: "groupId", next_id: "nextId"),
|
|
438
444
|
model: GrowsurfRuby::ParticipantList,
|
|
439
445
|
options: options
|
|
440
446
|
)
|
|
@@ -736,6 +742,7 @@ module GrowsurfRuby
|
|
|
736
742
|
@commission = GrowsurfRuby::Resources::Campaign::Commission.new(client: client)
|
|
737
743
|
@rewards = GrowsurfRuby::Resources::Campaign::Rewards.new(client: client)
|
|
738
744
|
@resources = GrowsurfRuby::Resources::Campaign::ProgramResources.new(client: client)
|
|
745
|
+
@groups = GrowsurfRuby::Resources::Campaign::Groups.new(client: client)
|
|
739
746
|
@design = GrowsurfRuby::Resources::Campaign::Design.new(client: client)
|
|
740
747
|
@custom_domain = GrowsurfRuby::Resources::Campaign::CustomDomain.new(client: client)
|
|
741
748
|
@emails = GrowsurfRuby::Resources::Campaign::Emails.new(client: client)
|
data/lib/growsurf_ruby.rb
CHANGED
|
@@ -69,6 +69,7 @@ require_relative "growsurf_ruby/models/campaign/commission_delete_params"
|
|
|
69
69
|
require_relative "growsurf_ruby/models/campaign/commission_delete_response"
|
|
70
70
|
require_relative "growsurf_ruby/models/campaign/delete_reward_response"
|
|
71
71
|
require_relative "growsurf_ruby/models/campaign/fraud_risk_level"
|
|
72
|
+
require_relative "growsurf_ruby/models/campaign/reward_group_source"
|
|
72
73
|
require_relative "growsurf_ruby/models/campaign/language"
|
|
73
74
|
require_relative "growsurf_ruby/models/campaign/participant_activity_logs_response"
|
|
74
75
|
require_relative "growsurf_ruby/models/campaign/participant_add_params"
|
|
@@ -77,6 +78,8 @@ require_relative "growsurf_ruby/models/email_analytics"
|
|
|
77
78
|
require_relative "growsurf_ruby/models/campaign/participant_analytics_response"
|
|
78
79
|
require_relative "growsurf_ruby/models/campaign/participant_bulk_delete_params"
|
|
79
80
|
require_relative "growsurf_ruby/models/campaign/participant_bulk_delete_response"
|
|
81
|
+
require_relative "growsurf_ruby/models/campaign/participant_bulk_move_params"
|
|
82
|
+
require_relative "growsurf_ruby/models/campaign/participant_bulk_move_response"
|
|
80
83
|
require_relative "growsurf_ruby/models/campaign/participant_cancel_delayed_referral_params"
|
|
81
84
|
require_relative "growsurf_ruby/models/campaign/participant_cancel_delayed_referral_response"
|
|
82
85
|
require_relative "growsurf_ruby/models/campaign/participant_delete_params"
|
|
@@ -115,6 +118,14 @@ require_relative "growsurf_ruby/models/campaign/program_resource_update_params"
|
|
|
115
118
|
require_relative "growsurf_ruby/models/campaign/program_resource_upload_ticket"
|
|
116
119
|
require_relative "growsurf_ruby/models/campaign/program_resource_upload_ticket_params"
|
|
117
120
|
require_relative "growsurf_ruby/models/campaign/delete_program_resource_response"
|
|
121
|
+
require_relative "growsurf_ruby/models/campaign/reward_group"
|
|
122
|
+
require_relative "growsurf_ruby/models/campaign/reward_group_list_response"
|
|
123
|
+
require_relative "growsurf_ruby/models/campaign/reward_group_create_params"
|
|
124
|
+
require_relative "growsurf_ruby/models/campaign/reward_group_retrieve_params"
|
|
125
|
+
require_relative "growsurf_ruby/models/campaign/reward_group_update_params"
|
|
126
|
+
require_relative "growsurf_ruby/models/campaign/reward_group_delete_params"
|
|
127
|
+
require_relative "growsurf_ruby/models/campaign/delete_reward_group_response"
|
|
128
|
+
require_relative "growsurf_ruby/models/campaign/reward_list_params"
|
|
118
129
|
require_relative "growsurf_ruby/models/campaign/referral_source"
|
|
119
130
|
require_relative "growsurf_ruby/models/campaign/referral_status"
|
|
120
131
|
require_relative "growsurf_ruby/models/campaign/reward"
|
|
@@ -188,5 +199,6 @@ require_relative "growsurf_ruby/resources/campaign/participant"
|
|
|
188
199
|
require_relative "growsurf_ruby/resources/campaign/reward"
|
|
189
200
|
require_relative "growsurf_ruby/resources/campaign/rewards"
|
|
190
201
|
require_relative "growsurf_ruby/resources/campaign/program_resources"
|
|
202
|
+
require_relative "growsurf_ruby/resources/campaign/groups"
|
|
191
203
|
require_relative "growsurf_ruby/resources/campaign/integrations"
|
|
192
204
|
require_relative "growsurf_ruby/resources/campaign/webhooks"
|
|
@@ -27,6 +27,14 @@ module GrowsurfRuby
|
|
|
27
27
|
sig { params(first_name: String).void }
|
|
28
28
|
attr_writer :first_name
|
|
29
29
|
|
|
30
|
+
# Places the new participant in this group (`grp_…`), or in Default with `null`.
|
|
31
|
+
# This is a manual placement, so the groups' email and domain rules do not apply
|
|
32
|
+
# to them. Applied only when this request creates the participant; to move an
|
|
33
|
+
# existing participant, use Update participant. An ID that is not a group in this
|
|
34
|
+
# program returns `400` and adds no one.
|
|
35
|
+
sig { returns(T.nilable(String)) }
|
|
36
|
+
attr_accessor :group_id
|
|
37
|
+
|
|
30
38
|
sig { returns(T.nilable(String)) }
|
|
31
39
|
attr_reader :ip_address
|
|
32
40
|
|
|
@@ -116,6 +124,7 @@ module GrowsurfRuby
|
|
|
116
124
|
email: String,
|
|
117
125
|
fingerprint: String,
|
|
118
126
|
first_name: String,
|
|
127
|
+
group_id: T.nilable(String),
|
|
119
128
|
ip_address: String,
|
|
120
129
|
is_affiliate: T::Boolean,
|
|
121
130
|
language: GrowsurfRuby::Campaign::Language::OrSymbol,
|
|
@@ -132,6 +141,7 @@ module GrowsurfRuby
|
|
|
132
141
|
email:,
|
|
133
142
|
fingerprint: nil,
|
|
134
143
|
first_name: nil,
|
|
144
|
+
group_id: nil,
|
|
135
145
|
ip_address: nil,
|
|
136
146
|
# Affiliate programs only. Controls affiliate enrollment for a new participant.
|
|
137
147
|
# `true` enrolls the participant with `affiliateStatus: APPROVED`; `false` creates
|
|
@@ -172,6 +182,7 @@ module GrowsurfRuby
|
|
|
172
182
|
email: String,
|
|
173
183
|
fingerprint: String,
|
|
174
184
|
first_name: String,
|
|
185
|
+
group_id: T.nilable(String),
|
|
175
186
|
ip_address: String,
|
|
176
187
|
is_affiliate: T::Boolean,
|
|
177
188
|
language: GrowsurfRuby::Campaign::Language::OrSymbol,
|