growsurf-ruby 1.3.0 → 1.5.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.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +10 -7
  4. data/lib/growsurf_ruby/internal/transport/base_client.rb +6 -1
  5. data/lib/growsurf_ruby/internal/type/base_model.rb +26 -0
  6. data/lib/growsurf_ruby/internal/type/base_page.rb +6 -0
  7. data/lib/growsurf_ruby/models/account_create_response.rb +3 -3
  8. data/lib/growsurf_ruby/models/analytics_availability.rb +16 -0
  9. data/lib/growsurf_ruby/models/analytics_unavailable_reason.rb +20 -0
  10. data/lib/growsurf_ruby/models/campaign/delete_program_resource_response.rb +12 -0
  11. data/lib/growsurf_ruby/models/campaign/integration.rb +69 -0
  12. data/lib/growsurf_ruby/models/campaign/integration_list_response.rb +24 -0
  13. data/lib/growsurf_ruby/models/campaign/participant_activation_analytics.rb +75 -0
  14. data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +11 -0
  15. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rb +17 -17
  16. data/lib/growsurf_ruby/models/campaign/participant_record_transaction_params.rb +9 -1
  17. data/lib/growsurf_ruby/models/campaign/participant_refund_transaction_params.rb +17 -1
  18. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rb +8 -8
  19. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +15 -11
  20. data/lib/growsurf_ruby/models/campaign/participant_reward.rb +16 -3
  21. data/lib/growsurf_ruby/models/campaign/program_resource.rb +51 -0
  22. data/lib/growsurf_ruby/models/campaign/program_resource_create_params.rb +32 -0
  23. data/lib/growsurf_ruby/models/campaign/program_resource_delete_params.rb +14 -0
  24. data/lib/growsurf_ruby/models/campaign/program_resource_list_response.rb +12 -0
  25. data/lib/growsurf_ruby/models/campaign/program_resource_update_params.rb +35 -0
  26. data/lib/growsurf_ruby/models/campaign/program_resource_upload_result.rb +33 -0
  27. data/lib/growsurf_ruby/models/campaign/program_resource_upload_ticket.rb +26 -0
  28. data/lib/growsurf_ruby/models/campaign/program_resource_upload_ticket_params.rb +17 -0
  29. data/lib/growsurf_ruby/models/campaign/reward.rb +22 -1
  30. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +32 -9
  31. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +32 -9
  32. data/lib/growsurf_ruby/models/campaign.rb +25 -2
  33. data/lib/growsurf_ruby/models/campaign_activation_analytics_response.rb +186 -0
  34. data/lib/growsurf_ruby/models/campaign_create_params.rb +37 -1
  35. data/lib/growsurf_ruby/models/campaign_engagement_analytics.rb +174 -0
  36. data/lib/growsurf_ruby/models/campaign_retrieve_activation_analytics_params.rb +35 -0
  37. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +37 -4
  38. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +3 -0
  39. data/lib/growsurf_ruby/models/commission_structure.rb +19 -3
  40. data/lib/growsurf_ruby/models/participant_commission_list.rb +24 -6
  41. data/lib/growsurf_ruby/models/participant_payout_list.rb +5 -5
  42. data/lib/growsurf_ruby/models.rb +7 -0
  43. data/lib/growsurf_ruby/resources/account.rb +17 -11
  44. data/lib/growsurf_ruby/resources/campaign/design.rb +11 -5
  45. data/lib/growsurf_ruby/resources/campaign/emails.rb +2 -1
  46. data/lib/growsurf_ruby/resources/campaign/integrations.rb +41 -0
  47. data/lib/growsurf_ruby/resources/campaign/participant.rb +28 -25
  48. data/lib/growsurf_ruby/resources/campaign/program_resources.rb +112 -0
  49. data/lib/growsurf_ruby/resources/campaign/rewards.rb +12 -6
  50. data/lib/growsurf_ruby/resources/campaign.rb +53 -7
  51. data/lib/growsurf_ruby/resources/team.rb +7 -5
  52. data/lib/growsurf_ruby/version.rb +1 -1
  53. data/lib/growsurf_ruby.rb +19 -0
  54. data/rbi/growsurf_ruby/internal/type/base_model.rbi +10 -0
  55. data/rbi/growsurf_ruby/internal/type/base_page.rbi +3 -0
  56. data/rbi/growsurf_ruby/models/analytics_availability.rbi +19 -0
  57. data/rbi/growsurf_ruby/models/analytics_unavailable_reason.rbi +23 -0
  58. data/rbi/growsurf_ruby/models/campaign/delete_program_resource_response.rbi +33 -0
  59. data/rbi/growsurf_ruby/models/campaign/integration.rbi +93 -0
  60. data/rbi/growsurf_ruby/models/campaign/integration_list_response.rbi +46 -0
  61. data/rbi/growsurf_ruby/models/campaign/participant_activation_analytics.rbi +133 -0
  62. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +35 -0
  63. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbi +17 -23
  64. data/rbi/growsurf_ruby/models/campaign/participant_record_transaction_params.rbi +18 -0
  65. data/rbi/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbi +18 -0
  66. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbi +7 -9
  67. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +16 -10
  68. data/rbi/growsurf_ruby/models/campaign/participant_reward.rbi +29 -6
  69. data/rbi/growsurf_ruby/models/campaign/program_resource.rbi +186 -0
  70. data/rbi/growsurf_ruby/models/campaign/program_resource_create_params.rbi +95 -0
  71. data/rbi/growsurf_ruby/models/campaign/program_resource_delete_params.rbi +37 -0
  72. data/rbi/growsurf_ruby/models/campaign/program_resource_list_response.rbi +29 -0
  73. data/rbi/growsurf_ruby/models/campaign/program_resource_update_params.rbi +105 -0
  74. data/rbi/growsurf_ruby/models/campaign/program_resource_upload_result.rbi +94 -0
  75. data/rbi/growsurf_ruby/models/campaign/program_resource_upload_ticket.rbi +57 -0
  76. data/rbi/growsurf_ruby/models/campaign/program_resource_upload_ticket_params.rbi +53 -0
  77. data/rbi/growsurf_ruby/models/campaign/reward.rbi +55 -0
  78. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +97 -24
  79. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +97 -24
  80. data/rbi/growsurf_ruby/models/campaign.rbi +52 -3
  81. data/rbi/growsurf_ruby/models/campaign_activation_analytics_response.rbi +325 -0
  82. data/rbi/growsurf_ruby/models/campaign_create_params.rbi +91 -0
  83. data/rbi/growsurf_ruby/models/campaign_engagement_analytics.rbi +369 -0
  84. data/rbi/growsurf_ruby/models/campaign_retrieve_activation_analytics_params.rbi +59 -0
  85. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +56 -3
  86. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +27 -7
  87. data/rbi/growsurf_ruby/models/commission_structure.rbi +36 -3
  88. data/rbi/growsurf_ruby/models/participant_commission_list.rbi +63 -15
  89. data/rbi/growsurf_ruby/models/participant_payout_list.rbi +15 -15
  90. data/rbi/growsurf_ruby/models.rbi +7 -0
  91. data/rbi/growsurf_ruby/resources/account.rbi +9 -6
  92. data/rbi/growsurf_ruby/resources/campaign/design.rbi +32 -4
  93. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +2 -1
  94. data/rbi/growsurf_ruby/resources/campaign/integrations.rbi +35 -0
  95. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +38 -24
  96. data/rbi/growsurf_ruby/resources/campaign/program_resources.rbi +116 -0
  97. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +35 -16
  98. data/rbi/growsurf_ruby/resources/campaign.rbi +53 -5
  99. data/rbi/growsurf_ruby/resources/team.rbi +7 -5
  100. data/sig/growsurf_ruby/internal/type/base_model.rbs +6 -0
  101. data/sig/growsurf_ruby/internal/type/base_page.rbs +2 -0
  102. data/sig/growsurf_ruby/models/analytics_availability.rbs +15 -0
  103. data/sig/growsurf_ruby/models/analytics_unavailable_reason.rbs +26 -0
  104. data/sig/growsurf_ruby/models/campaign/delete_program_resource_response.rbs +14 -0
  105. data/sig/growsurf_ruby/models/campaign/integration.rbs +47 -0
  106. data/sig/growsurf_ruby/models/campaign/integration_list_response.rbs +20 -0
  107. data/sig/growsurf_ruby/models/campaign/participant_activation_analytics.rbs +96 -0
  108. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +22 -1
  109. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbs +17 -22
  110. data/sig/growsurf_ruby/models/campaign/participant_record_transaction_params.rbs +15 -1
  111. data/sig/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbs +15 -1
  112. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbs +8 -10
  113. data/sig/growsurf_ruby/models/campaign/participant_reward.rbs +24 -9
  114. data/sig/growsurf_ruby/models/campaign/program_resource.rbs +94 -0
  115. data/sig/growsurf_ruby/models/campaign/program_resource_create_params.rbs +45 -0
  116. data/sig/growsurf_ruby/models/campaign/program_resource_delete_params.rbs +22 -0
  117. data/sig/growsurf_ruby/models/campaign/program_resource_list_response.rbs +14 -0
  118. data/sig/growsurf_ruby/models/campaign/program_resource_update_params.rbs +48 -0
  119. data/sig/growsurf_ruby/models/campaign/program_resource_upload_result.rbs +58 -0
  120. data/sig/growsurf_ruby/models/campaign/program_resource_upload_ticket.rbs +29 -0
  121. data/sig/growsurf_ruby/models/campaign/program_resource_upload_ticket_params.rbs +29 -0
  122. data/sig/growsurf_ruby/models/campaign/reward.rbs +16 -0
  123. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +54 -34
  124. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +54 -34
  125. data/sig/growsurf_ruby/models/campaign.rbs +23 -5
  126. data/sig/growsurf_ruby/models/campaign_activation_analytics_response.rbs +202 -0
  127. data/sig/growsurf_ruby/models/campaign_create_params.rbs +29 -0
  128. data/sig/growsurf_ruby/models/campaign_engagement_analytics.rbs +186 -0
  129. data/sig/growsurf_ruby/models/campaign_retrieve_activation_analytics_params.rbs +45 -0
  130. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_params.rbs +30 -1
  131. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +21 -3
  132. data/sig/growsurf_ruby/models/commission_structure.rbs +16 -4
  133. data/sig/growsurf_ruby/models/participant_commission_list.rbs +36 -20
  134. data/sig/growsurf_ruby/models/participant_payout_list.rbs +20 -20
  135. data/sig/growsurf_ruby/models.rbs +6 -0
  136. data/sig/growsurf_ruby/resources/campaign/design.rbs +19 -0
  137. data/sig/growsurf_ruby/resources/campaign/integrations.rbs +14 -0
  138. data/sig/growsurf_ruby/resources/campaign/participant.rbs +4 -0
  139. data/sig/growsurf_ruby/resources/campaign/program_resources.rbs +58 -0
  140. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +14 -12
  141. data/sig/growsurf_ruby/resources/campaign.rbs +17 -0
  142. metadata +59 -2
@@ -0,0 +1,116 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ class ProgramResources
7
+ sig do
8
+ params(
9
+ id: String,
10
+ request_options: GrowsurfRuby::RequestOptions::OrHash
11
+ ).returns(GrowsurfRuby::Campaign::ProgramResourceListResponse)
12
+ end
13
+ def list(id, request_options: {})
14
+ end
15
+
16
+ sig do
17
+ params(
18
+ id: String,
19
+ type:
20
+ GrowsurfRuby::Campaign::ProgramResourceCreateParams::Type::OrSymbol,
21
+ title: String,
22
+ description: T.nilable(String),
23
+ category: T.nilable(String),
24
+ is_published: T::Boolean,
25
+ url: String,
26
+ text: String,
27
+ upload_ticket: String,
28
+ upload_result: GrowsurfRuby::Campaign::ProgramResourceUploadResult::OrHash,
29
+ request_options: GrowsurfRuby::RequestOptions::OrHash
30
+ ).returns(GrowsurfRuby::Campaign::ProgramResource)
31
+ end
32
+ def create(
33
+ id,
34
+ type:,
35
+ title:,
36
+ description: nil,
37
+ category: nil,
38
+ is_published: nil,
39
+ url: nil,
40
+ text: nil,
41
+ upload_ticket: nil,
42
+ upload_result: nil,
43
+ request_options: {}
44
+ )
45
+ end
46
+
47
+ sig do
48
+ params(
49
+ resource_id: String,
50
+ id: String,
51
+ type:
52
+ GrowsurfRuby::Campaign::ProgramResourceUpdateParams::Type::OrSymbol,
53
+ title: String,
54
+ description: T.nilable(String),
55
+ category: T.nilable(String),
56
+ is_published: T::Boolean,
57
+ position: Integer,
58
+ url: String,
59
+ text: String,
60
+ upload_ticket: String,
61
+ upload_result: GrowsurfRuby::Campaign::ProgramResourceUploadResult::OrHash,
62
+ request_options: GrowsurfRuby::RequestOptions::OrHash
63
+ ).returns(GrowsurfRuby::Campaign::ProgramResource)
64
+ end
65
+ def update(
66
+ resource_id,
67
+ id:,
68
+ type: nil,
69
+ title: nil,
70
+ description: nil,
71
+ category: nil,
72
+ is_published: nil,
73
+ position: nil,
74
+ url: nil,
75
+ text: nil,
76
+ upload_ticket: nil,
77
+ upload_result: nil,
78
+ request_options: {}
79
+ )
80
+ end
81
+
82
+ sig do
83
+ params(
84
+ resource_id: String,
85
+ id: String,
86
+ request_options: GrowsurfRuby::RequestOptions::OrHash
87
+ ).returns(GrowsurfRuby::Campaign::DeleteProgramResourceResponse)
88
+ end
89
+ def delete(resource_id, id:, request_options: {})
90
+ end
91
+
92
+ sig do
93
+ params(
94
+ id: String,
95
+ file_name: String,
96
+ mime_type: String,
97
+ bytes: Integer,
98
+ request_options: GrowsurfRuby::RequestOptions::OrHash
99
+ ).returns(GrowsurfRuby::Campaign::ProgramResourceUploadTicket)
100
+ end
101
+ def create_upload_ticket(
102
+ id,
103
+ file_name:,
104
+ mime_type:,
105
+ bytes:,
106
+ request_options: {}
107
+ )
108
+ end
109
+
110
+ sig { params(client: GrowsurfRuby::Client).returns(T.attached_class) }
111
+ def self.new(client:)
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
@@ -24,7 +24,8 @@ module GrowsurfRuby
24
24
  # The reward type must be compatible with the program type (affiliate programs
25
25
  # support only `AFFILIATE` rewards; referral programs support all other types).
26
26
  # Enabling an active reward of a type automatically enables that reward type on
27
- # the program.
27
+ # the program. For an affiliate reward, `commissionStructure.event: LEAD`
28
+ # requires a `FIXED` commission with a positive `amount`.
28
29
  sig do
29
30
  params(
30
31
  id: String,
@@ -32,21 +33,23 @@ module GrowsurfRuby
32
33
  GrowsurfRuby::Models::Campaign::RewardCreateParams::Type::OrSymbol,
33
34
  commission_structure: GrowsurfRuby::CommissionStructure::OrHash,
34
35
  conversions_required: Integer,
35
- coupon_code: String,
36
+ coupon_code: T.nilable(String),
36
37
  description: String,
37
- image_url: String,
38
+ event:
39
+ GrowsurfRuby::Models::Campaign::RewardCreateParams::Event::OrSymbol,
40
+ image_url: T.nilable(String),
38
41
  is_unlimited: T::Boolean,
39
42
  is_visible: T::Boolean,
40
43
  limit: Integer,
41
44
  limit_duration:
42
45
  GrowsurfRuby::Models::Campaign::RewardCreateParams::LimitDuration::OrSymbol,
43
46
  metadata: T::Hash[Symbol, T.anything],
44
- next_milestone_prefix: String,
45
- next_milestone_suffix: String,
47
+ next_milestone_prefix: T.nilable(String),
48
+ next_milestone_suffix: T.nilable(String),
46
49
  number_of_winners: Integer,
47
50
  order: Integer,
48
- referral_coupon_code: String,
49
- referral_description: String,
51
+ referral_coupon_code: T.nilable(String),
52
+ referral_description: T.nilable(String),
50
53
  referred_reward_upfront: T::Boolean,
51
54
  referred_value: GrowsurfRuby::RewardTaxValuation::OrHash,
52
55
  title: String,
@@ -59,7 +62,9 @@ module GrowsurfRuby
59
62
  id,
60
63
  # Body param: The reward type. Immutable after creation.
61
64
  type:,
62
- # Body param
65
+ # Body param: The affiliate commission structure. Required when creating an
66
+ # `AFFILIATE` reward. A `FIXED` commission requires `amount`; a `PERCENT`
67
+ # commission requires `percent`.
63
68
  commission_structure: nil,
64
69
  # Body param
65
70
  conversions_required: nil,
@@ -69,6 +74,11 @@ module GrowsurfRuby
69
74
  coupon_code: nil,
70
75
  # Body param
71
76
  description: nil,
77
+ # Body param: The referral event that earns this Campaign Reward. Use `LEAD` or
78
+ # `CONVERSION`. `LEAD` requires the program installation's `referralTrigger` to
79
+ # be `CUSTOM`. This field applies only to `SINGLE_SIDED`, `DOUBLE_SIDED`, and
80
+ # `MILESTONE` rewards. When omitted, it defaults to `CONVERSION`.
81
+ event: nil,
72
82
  # Body param
73
83
  image_url: nil,
74
84
  # Body param: Whether the reward can be earned an unlimited number of times.
@@ -121,28 +131,31 @@ module GrowsurfRuby
121
131
  # immutable and cannot be changed. When the update replaces `metadata`, renamed
122
132
  # keys automatically rewrite any `{{campaignReward[…]}}` references in campaign
123
133
  # copy; removing a key that campaign copy still references returns a `409` listing
124
- # the referencing fields.
134
+ # the referencing fields. For an affiliate reward, `commissionStructure.event:
135
+ # LEAD` requires a `FIXED` commission with a positive `amount`.
125
136
  sig do
126
137
  params(
127
138
  campaign_reward_id: String,
128
139
  id: String,
129
140
  commission_structure: GrowsurfRuby::CommissionStructure::OrHash,
130
141
  conversions_required: Integer,
131
- coupon_code: String,
142
+ coupon_code: T.nilable(String),
132
143
  description: String,
133
- image_url: String,
144
+ event:
145
+ GrowsurfRuby::Models::Campaign::RewardUpdateParams::Event::OrSymbol,
146
+ image_url: T.nilable(String),
134
147
  is_unlimited: T::Boolean,
135
148
  is_visible: T::Boolean,
136
149
  limit: Integer,
137
150
  limit_duration:
138
151
  GrowsurfRuby::Models::Campaign::RewardUpdateParams::LimitDuration::OrSymbol,
139
152
  metadata: T::Hash[Symbol, T.anything],
140
- next_milestone_prefix: String,
141
- next_milestone_suffix: String,
153
+ next_milestone_prefix: T.nilable(String),
154
+ next_milestone_suffix: T.nilable(String),
142
155
  number_of_winners: Integer,
143
156
  order: Integer,
144
- referral_coupon_code: String,
145
- referral_description: String,
157
+ referral_coupon_code: T.nilable(String),
158
+ referral_description: T.nilable(String),
146
159
  referred_reward_upfront: T::Boolean,
147
160
  referred_value: GrowsurfRuby::RewardTaxValuation::OrHash,
148
161
  title: String,
@@ -155,7 +168,8 @@ module GrowsurfRuby
155
168
  campaign_reward_id,
156
169
  # Path param: GrowSurf program ID.
157
170
  id:,
158
- # Body param
171
+ # Body param: The affiliate commission structure. A `FIXED` commission requires
172
+ # `amount`; a `PERCENT` commission requires `percent`.
159
173
  commission_structure: nil,
160
174
  # Body param
161
175
  conversions_required: nil,
@@ -165,6 +179,11 @@ module GrowsurfRuby
165
179
  coupon_code: nil,
166
180
  # Body param
167
181
  description: nil,
182
+ # Body param: The referral event that earns this Campaign Reward. Use `LEAD` or
183
+ # `CONVERSION`. `LEAD` requires the program installation's `referralTrigger` to
184
+ # be `CUSTOM`. This field applies only to `SINGLE_SIDED`, `DOUBLE_SIDED`, and
185
+ # `MILESTONE` rewards. When omitted, the stored event is preserved.
186
+ event: nil,
168
187
  # Body param
169
188
  image_url: nil,
170
189
  # Body param: Whether the reward can be earned an unlimited number of times.
@@ -18,6 +18,10 @@ module GrowsurfRuby
18
18
  sig { returns(GrowsurfRuby::Resources::Campaign::Rewards) }
19
19
  attr_reader :rewards
20
20
 
21
+ # Program Resource management and secure FILE upload operations.
22
+ sig { returns(GrowsurfRuby::Resources::Campaign::ProgramResources) }
23
+ attr_reader :resources
24
+
21
25
  # Program Editor "Design" tab configuration operations.
22
26
  sig { returns(GrowsurfRuby::Resources::Campaign::Design) }
23
27
  attr_reader :design
@@ -34,6 +38,10 @@ module GrowsurfRuby
34
38
  sig { returns(GrowsurfRuby::Resources::Campaign::Installation) }
35
39
  attr_reader :installation
36
40
 
41
+ # Integration status operations.
42
+ sig { returns(GrowsurfRuby::Resources::Campaign::Integrations) }
43
+ attr_reader :integrations
44
+
37
45
  # Program webhook configuration operations.
38
46
  sig { returns(GrowsurfRuby::Resources::Campaign::Webhooks) }
39
47
  attr_reader :webhooks
@@ -69,6 +77,7 @@ module GrowsurfRuby
69
77
  company_logo_image_url: String,
70
78
  company_name: String,
71
79
  currency_iso: String,
80
+ goal: GrowsurfRuby::CampaignCreateParams::Goal::OrSymbol,
72
81
  name: String,
73
82
  rewards: T::Array[GrowsurfRuby::Campaign::RewardCreateParams::OrHash],
74
83
  request_options: GrowsurfRuby::RequestOptions::OrHash
@@ -82,6 +91,11 @@ module GrowsurfRuby
82
91
  # ISO 4217 currency code. Defaults to USD. Chosen when the program is created and
83
92
  # immutable afterward — it cannot be changed on update.
84
93
  currency_iso: nil,
94
+ # What the program is for, which seeds share settings that suit that audience.
95
+ # Programs selling to businesses start with the LinkedIn share button visible;
96
+ # consumer, financial, education, insurance, newsletter, and waitlist programs
97
+ # start with it hidden. Set only when the program is created.
98
+ goal: nil,
85
99
  # The program name. Defaults to a generated friendly label plus the creation date.
86
100
  name: nil,
87
101
  # Optional inline rewards to create with the program.
@@ -428,10 +442,9 @@ module GrowsurfRuby
428
442
 
429
443
  # Retrieves analytics for a program. Pass `interval` to also get a time-series (`series`)
430
444
  # alongside the totals, and `include` to add previous-period totals, status breakdowns,
431
- # derived rates, or email performance. Add `email` to `include` for `sent` (accepted for
432
- # delivery), `delivered`, `opened`, `clicked`, `bounced`, and `spamComplaints` metrics plus
433
- # per-email-type breakdowns. Email rates are ratios from `0` to `1`, and `isPartial`
434
- # identifies windows that begin before complete coverage.
445
+ # derived rates, email performance, or participant engagement. Add `engagement` for
446
+ # covered activity totals, comparisons, series, and breakdowns. Unknown coverage returns
447
+ # explicit unavailable states rather than zeroes.
435
448
  sig do
436
449
  params(
437
450
  id: String,
@@ -440,7 +453,10 @@ module GrowsurfRuby
440
453
  include: String,
441
454
  interval:
442
455
  GrowsurfRuby::CampaignRetrieveAnalyticsParams::Interval::OrSymbol,
456
+ platform:
457
+ GrowsurfRuby::CampaignRetrieveAnalyticsParams::Platform::OrSymbol,
443
458
  start_date: Integer,
459
+ timezone: String,
444
460
  request_options: GrowsurfRuby::RequestOptions::OrHash
445
461
  ).returns(GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse)
446
462
  end
@@ -462,11 +478,43 @@ module GrowsurfRuby
462
478
  # windows.
463
479
  include: nil,
464
480
  # When set to `day`, `week`, or `month`, the response also includes a `series` array
465
- # with per-period totals. Defaults to `total` (no series).
481
+ # with per-period totals and uses the same bucket size for `engagement.series`.
482
+ # Defaults to `total` (no legacy series); `engagement.series` uses daily buckets when
483
+ # `interval` is `total` or omitted.
466
484
  interval: nil,
485
+ # Participant platform used for `engagement`. Defaults to `ALL`.
486
+ platform: nil,
467
487
  # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
468
488
  # Required if `days` is not set.
469
489
  start_date: nil,
490
+ # IANA timezone used for engagement periods and buckets. Defaults to `UTC`.
491
+ timezone: nil,
492
+ request_options: {}
493
+ )
494
+ end
495
+
496
+ # Retrieves activation cohorts for a program. Coverage states distinguish unknown values
497
+ # from zeroes.
498
+ sig do
499
+ params(
500
+ id: String,
501
+ cohort_from: Integer,
502
+ cohort_to: Integer,
503
+ cohort_interval:
504
+ GrowsurfRuby::CampaignRetrieveActivationAnalyticsParams::CohortInterval::OrSymbol,
505
+ observation_window_days:
506
+ GrowsurfRuby::CampaignRetrieveActivationAnalyticsParams::ObservationWindowDays::OrInteger,
507
+ timezone: String,
508
+ request_options: GrowsurfRuby::RequestOptions::OrHash
509
+ ).returns(GrowsurfRuby::Models::CampaignActivationAnalyticsResponse)
510
+ end
511
+ def retrieve_activation_analytics(
512
+ id,
513
+ cohort_from: nil,
514
+ cohort_to: nil,
515
+ cohort_interval: nil,
516
+ observation_window_days: nil,
517
+ timezone: nil,
470
518
  request_options: {}
471
519
  )
472
520
  end
@@ -54,11 +54,13 @@ module GrowsurfRuby
54
54
  def request_verification(request_options: {})
55
55
  end
56
56
 
57
- # Resends the email-verification message to the bound team's owner. The response
58
- # never reveals the owner's email address. A `200` with `status: SENT` is returned
59
- # only when an email was actually dispatched. Returns `400` if the email is
60
- # already verified, and `429` if a verification email was sent too recently wait
61
- # a moment, then retry.
57
+ # Resends the email-verification message to the owner of the account the API key
58
+ # belongs to. This is the recovery path for a `403` with error code
59
+ # `EMAIL_NOT_VERIFIED_ERROR`, so it stays callable with any GrowSurf API key while the
60
+ # rest of the API is locked. The response never reveals the owner's email address. A
61
+ # `200` with `status: SENT` is returned only when an email was actually dispatched.
62
+ # Returns `400` if the email is already verified, and `429` if a verification email was
63
+ # sent too recently — wait a moment, then retry.
62
64
  sig do
63
65
  params(request_options: GrowsurfRuby::RequestOptions::OrHash).returns(
64
66
  GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse
@@ -85,6 +85,12 @@ module GrowsurfRuby
85
85
 
86
86
  def deep_to_h: -> ::Hash[Symbol, top]
87
87
 
88
+ attr_reader response_headers: ::Hash[String, String]
89
+
90
+ def attach_response_headers: (
91
+ ::Hash[String, String] headers
92
+ ) -> instance
93
+
88
94
  def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top]
89
95
 
90
96
  def to_json: (*top a) -> String
@@ -12,6 +12,8 @@ module GrowsurfRuby
12
12
 
13
13
  alias enum_for to_enum
14
14
 
15
+ attr_reader response_headers: ::Hash[String, String]
16
+
15
17
  def initialize: (
16
18
  client: GrowsurfRuby::Internal::Transport::BaseClient,
17
19
  req: GrowsurfRuby::Internal::Transport::BaseClient::request_components,
@@ -0,0 +1,15 @@
1
+ module GrowsurfRuby
2
+ module Models
3
+ type analytics_availability = :AVAILABLE | :PARTIAL | :UNAVAILABLE
4
+
5
+ module AnalyticsAvailability
6
+ extend GrowsurfRuby::Internal::Type::Enum
7
+
8
+ AVAILABLE: :AVAILABLE
9
+ PARTIAL: :PARTIAL
10
+ UNAVAILABLE: :UNAVAILABLE
11
+
12
+ def self?.values: -> ::Array[GrowsurfRuby::Models::analytics_availability]
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ module GrowsurfRuby
2
+ module Models
3
+ type analytics_unavailable_reason =
4
+ :COVERAGE_UNAVAILABLE
5
+ | :PRE_COVERAGE
6
+ | :PARTIAL_COVERAGE
7
+ | :INSUFFICIENT_COVERAGE
8
+ | :EMPTY_DENOMINATOR
9
+ | :QUERY_LIMIT_EXCEEDED
10
+ | :PARTICIPANT_NOT_ELIGIBLE
11
+
12
+ module AnalyticsUnavailableReason
13
+ extend GrowsurfRuby::Internal::Type::Enum
14
+
15
+ COVERAGE_UNAVAILABLE: :COVERAGE_UNAVAILABLE
16
+ PRE_COVERAGE: :PRE_COVERAGE
17
+ PARTIAL_COVERAGE: :PARTIAL_COVERAGE
18
+ INSUFFICIENT_COVERAGE: :INSUFFICIENT_COVERAGE
19
+ EMPTY_DENOMINATOR: :EMPTY_DENOMINATOR
20
+ QUERY_LIMIT_EXCEEDED: :QUERY_LIMIT_EXCEEDED
21
+ PARTICIPANT_NOT_ELIGIBLE: :PARTICIPANT_NOT_ELIGIBLE
22
+
23
+ def self?.values: -> ::Array[GrowsurfRuby::Models::analytics_unavailable_reason]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,14 @@
1
+ module GrowsurfRuby
2
+ module Models
3
+ module Campaign
4
+ type delete_program_resource_response = { id: String, success: bool }
5
+
6
+ class DeleteProgramResourceResponse < GrowsurfRuby::Internal::Type::BaseModel
7
+ attr_accessor id: String
8
+ attr_accessor success: bool
9
+ def initialize: (id: String, success: bool) -> void
10
+ def to_hash: -> delete_program_resource_response
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,47 @@
1
+ module GrowsurfRuby
2
+ module Models
3
+ module Campaign
4
+ type integration =
5
+ {
6
+ id: String,
7
+ auto_disabled: bool,
8
+ connect_url: String,
9
+ connected: bool,
10
+ enabled: bool,
11
+ name: String
12
+ }
13
+
14
+ class Integration < GrowsurfRuby::Internal::Type::BaseModel
15
+ attr_accessor id: String
16
+
17
+ attr_accessor auto_disabled: bool
18
+
19
+ attr_accessor connect_url: String
20
+
21
+ attr_accessor connected: bool
22
+
23
+ attr_accessor enabled: bool
24
+
25
+ attr_accessor name: String
26
+
27
+ def initialize: (
28
+ id: String,
29
+ auto_disabled: bool,
30
+ connect_url: String,
31
+ connected: bool,
32
+ enabled: bool,
33
+ name: String
34
+ ) -> void
35
+
36
+ def to_hash: -> {
37
+ id: String,
38
+ auto_disabled: bool,
39
+ connect_url: String,
40
+ connected: bool,
41
+ enabled: bool,
42
+ name: String
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,20 @@
1
+ module GrowsurfRuby
2
+ module Models
3
+ module Campaign
4
+ type integration_list_response =
5
+ { integrations: ::Array[GrowsurfRuby::Campaign::Integration] }
6
+
7
+ class IntegrationListResponse < GrowsurfRuby::Internal::Type::BaseModel
8
+ attr_accessor integrations: ::Array[GrowsurfRuby::Campaign::Integration]
9
+
10
+ def initialize: (
11
+ integrations: ::Array[GrowsurfRuby::Campaign::Integration]
12
+ ) -> void
13
+
14
+ def to_hash: -> {
15
+ integrations: ::Array[GrowsurfRuby::Campaign::Integration]
16
+ }
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,96 @@
1
+ module GrowsurfRuby
2
+ module Models
3
+ module Campaign
4
+ class ParticipantActivationAnalytics < GrowsurfRuby::Internal::Type::BaseModel
5
+ type program_type = :REFERRAL | :AFFILIATE
6
+ type anchor_field = :enrolledAsAdvocateAt | :approvedAsAffiliateAt
7
+ type share_channel =
8
+ :email
9
+ | :facebook
10
+ | :twitter
11
+ | :linkedin
12
+ | :pinterest
13
+ | :threads
14
+ | :bluesky
15
+ | :sms
16
+ | :messenger
17
+ | :whatsapp
18
+ | :wechat
19
+ | :telegram
20
+ | :reddit
21
+ | :tumblr
22
+ | :qrcode
23
+ | :copyRefLink
24
+ | :iosNativeShare
25
+ | :androidNativeShare
26
+
27
+ attr_accessor coverage_start_at: Integer?
28
+ attr_accessor metric_contract_version: Integer
29
+ attr_accessor program_type: GrowsurfRuby::Models::Campaign::ParticipantActivationAnalytics::program_type
30
+ attr_accessor state: GrowsurfRuby::Models::analytics_availability
31
+ attr_accessor reason: GrowsurfRuby::Models::analytics_unavailable_reason?
32
+ attr_accessor cohort: GrowsurfRuby::Models::Campaign::ParticipantActivationAnalytics::Cohort
33
+ attr_accessor enrolled_as_advocate_at: Integer?
34
+ attr_accessor milestones: GrowsurfRuby::Models::Campaign::ParticipantActivationAnalytics::Milestones
35
+ def initialize: (**untyped) -> void
36
+
37
+ module ProgramType
38
+ extend GrowsurfRuby::Internal::Type::Enum
39
+ REFERRAL: :REFERRAL
40
+ AFFILIATE: :AFFILIATE
41
+ def self?.values: -> ::Array[GrowsurfRuby::Models::Campaign::ParticipantActivationAnalytics::program_type]
42
+ end
43
+
44
+ module AnchorField
45
+ extend GrowsurfRuby::Internal::Type::Enum
46
+ ENROLLED_AS_ADVOCATE_AT: :enrolledAsAdvocateAt
47
+ APPROVED_AS_AFFILIATE_AT: :approvedAsAffiliateAt
48
+ def self?.values: -> ::Array[GrowsurfRuby::Models::Campaign::ParticipantActivationAnalytics::anchor_field]
49
+ end
50
+
51
+ module ShareChannel
52
+ extend GrowsurfRuby::Internal::Type::Enum
53
+ EMAIL: :email
54
+ FACEBOOK: :facebook
55
+ TWITTER: :twitter
56
+ LINKEDIN: :linkedin
57
+ PINTEREST: :pinterest
58
+ THREADS: :threads
59
+ BLUESKY: :bluesky
60
+ SMS: :sms
61
+ MESSENGER: :messenger
62
+ WHATSAPP: :whatsapp
63
+ WECHAT: :wechat
64
+ TELEGRAM: :telegram
65
+ REDDIT: :reddit
66
+ TUMBLR: :tumblr
67
+ QRCODE: :qrcode
68
+ COPY_REF_LINK: :copyRefLink
69
+ IOS_NATIVE_SHARE: :iosNativeShare
70
+ ANDROID_NATIVE_SHARE: :androidNativeShare
71
+ def self?.values: -> ::Array[GrowsurfRuby::Models::Campaign::ParticipantActivationAnalytics::share_channel]
72
+ end
73
+
74
+ class Cohort < GrowsurfRuby::Internal::Type::BaseModel
75
+ attr_accessor anchor_field: GrowsurfRuby::Models::Campaign::ParticipantActivationAnalytics::anchor_field
76
+ attr_accessor anchor_at: Integer?
77
+ def initialize: (**untyped) -> void
78
+ end
79
+
80
+ class Milestones < GrowsurfRuby::Internal::Type::BaseModel
81
+ attr_accessor first_portal_viewed_at: Integer?
82
+ attr_accessor first_referral_link_copied_at: Integer?
83
+ attr_accessor first_share_at: Integer?
84
+ attr_accessor first_share_channel: GrowsurfRuby::Models::Campaign::ParticipantActivationAnalytics::share_channel?
85
+ attr_accessor first_unique_click_at: Integer?
86
+ attr_accessor first_lead_at: Integer?
87
+ attr_accessor first_referral_at: Integer?
88
+ attr_accessor first_reward_at: Integer?
89
+ attr_accessor first_commission_at: Integer?
90
+ attr_accessor payout_setup_completed_at: Integer?
91
+ def initialize: (**untyped) -> void
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end