growsurf-ruby 1.4.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 (137) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -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 +4 -3
  20. data/lib/growsurf_ruby/models/campaign/participant_reward.rb +15 -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_create_params.rb +9 -8
  30. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +9 -8
  31. data/lib/growsurf_ruby/models/campaign.rb +3 -1
  32. data/lib/growsurf_ruby/models/campaign_activation_analytics_response.rb +186 -0
  33. data/lib/growsurf_ruby/models/campaign_create_params.rb +37 -1
  34. data/lib/growsurf_ruby/models/campaign_engagement_analytics.rb +174 -0
  35. data/lib/growsurf_ruby/models/campaign_retrieve_activation_analytics_params.rb +35 -0
  36. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +37 -4
  37. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +3 -0
  38. data/lib/growsurf_ruby/models/commission_structure.rb +4 -1
  39. data/lib/growsurf_ruby/models/participant_commission_list.rb +5 -5
  40. data/lib/growsurf_ruby/models/participant_payout_list.rb +5 -5
  41. data/lib/growsurf_ruby/models.rb +7 -0
  42. data/lib/growsurf_ruby/resources/account.rb +17 -11
  43. data/lib/growsurf_ruby/resources/campaign/design.rb +11 -5
  44. data/lib/growsurf_ruby/resources/campaign/emails.rb +2 -1
  45. data/lib/growsurf_ruby/resources/campaign/integrations.rb +41 -0
  46. data/lib/growsurf_ruby/resources/campaign/participant.rb +25 -24
  47. data/lib/growsurf_ruby/resources/campaign/program_resources.rb +112 -0
  48. data/lib/growsurf_ruby/resources/campaign/rewards.rb +6 -4
  49. data/lib/growsurf_ruby/resources/campaign.rb +53 -7
  50. data/lib/growsurf_ruby/resources/team.rb +7 -5
  51. data/lib/growsurf_ruby/version.rb +1 -1
  52. data/lib/growsurf_ruby.rb +19 -0
  53. data/rbi/growsurf_ruby/internal/type/base_model.rbi +10 -0
  54. data/rbi/growsurf_ruby/internal/type/base_page.rbi +3 -0
  55. data/rbi/growsurf_ruby/models/analytics_availability.rbi +19 -0
  56. data/rbi/growsurf_ruby/models/analytics_unavailable_reason.rbi +23 -0
  57. data/rbi/growsurf_ruby/models/campaign/delete_program_resource_response.rbi +33 -0
  58. data/rbi/growsurf_ruby/models/campaign/integration.rbi +93 -0
  59. data/rbi/growsurf_ruby/models/campaign/integration_list_response.rbi +46 -0
  60. data/rbi/growsurf_ruby/models/campaign/participant_activation_analytics.rbi +133 -0
  61. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +35 -0
  62. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbi +17 -23
  63. data/rbi/growsurf_ruby/models/campaign/participant_record_transaction_params.rbi +18 -0
  64. data/rbi/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbi +18 -0
  65. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbi +7 -9
  66. data/rbi/growsurf_ruby/models/campaign/participant_reward.rbi +24 -6
  67. data/rbi/growsurf_ruby/models/campaign/program_resource.rbi +186 -0
  68. data/rbi/growsurf_ruby/models/campaign/program_resource_create_params.rbi +95 -0
  69. data/rbi/growsurf_ruby/models/campaign/program_resource_delete_params.rbi +37 -0
  70. data/rbi/growsurf_ruby/models/campaign/program_resource_list_response.rbi +29 -0
  71. data/rbi/growsurf_ruby/models/campaign/program_resource_update_params.rbi +105 -0
  72. data/rbi/growsurf_ruby/models/campaign/program_resource_upload_result.rbi +94 -0
  73. data/rbi/growsurf_ruby/models/campaign/program_resource_upload_ticket.rbi +57 -0
  74. data/rbi/growsurf_ruby/models/campaign/program_resource_upload_ticket_params.rbi +53 -0
  75. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +33 -24
  76. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +33 -24
  77. data/rbi/growsurf_ruby/models/campaign.rbi +6 -3
  78. data/rbi/growsurf_ruby/models/campaign_activation_analytics_response.rbi +325 -0
  79. data/rbi/growsurf_ruby/models/campaign_create_params.rbi +91 -0
  80. data/rbi/growsurf_ruby/models/campaign_engagement_analytics.rbi +369 -0
  81. data/rbi/growsurf_ruby/models/campaign_retrieve_activation_analytics_params.rbi +59 -0
  82. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +56 -3
  83. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +27 -7
  84. data/rbi/growsurf_ruby/models/commission_structure.rbi +3 -1
  85. data/rbi/growsurf_ruby/models/participant_commission_list.rbi +15 -15
  86. data/rbi/growsurf_ruby/models/participant_payout_list.rbi +15 -15
  87. data/rbi/growsurf_ruby/models.rbi +7 -0
  88. data/rbi/growsurf_ruby/resources/account.rbi +9 -6
  89. data/rbi/growsurf_ruby/resources/campaign/design.rbi +32 -4
  90. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +2 -1
  91. data/rbi/growsurf_ruby/resources/campaign/integrations.rbi +35 -0
  92. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +27 -18
  93. data/rbi/growsurf_ruby/resources/campaign/program_resources.rbi +116 -0
  94. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +21 -16
  95. data/rbi/growsurf_ruby/resources/campaign.rbi +53 -5
  96. data/rbi/growsurf_ruby/resources/team.rbi +7 -5
  97. data/sig/growsurf_ruby/internal/type/base_model.rbs +6 -0
  98. data/sig/growsurf_ruby/internal/type/base_page.rbs +2 -0
  99. data/sig/growsurf_ruby/models/analytics_availability.rbs +15 -0
  100. data/sig/growsurf_ruby/models/analytics_unavailable_reason.rbs +26 -0
  101. data/sig/growsurf_ruby/models/campaign/delete_program_resource_response.rbs +14 -0
  102. data/sig/growsurf_ruby/models/campaign/integration.rbs +47 -0
  103. data/sig/growsurf_ruby/models/campaign/integration_list_response.rbs +20 -0
  104. data/sig/growsurf_ruby/models/campaign/participant_activation_analytics.rbs +96 -0
  105. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +22 -1
  106. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbs +17 -22
  107. data/sig/growsurf_ruby/models/campaign/participant_record_transaction_params.rbs +15 -1
  108. data/sig/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbs +15 -1
  109. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbs +8 -10
  110. data/sig/growsurf_ruby/models/campaign/participant_reward.rbs +22 -8
  111. data/sig/growsurf_ruby/models/campaign/program_resource.rbs +94 -0
  112. data/sig/growsurf_ruby/models/campaign/program_resource_create_params.rbs +45 -0
  113. data/sig/growsurf_ruby/models/campaign/program_resource_delete_params.rbs +22 -0
  114. data/sig/growsurf_ruby/models/campaign/program_resource_list_response.rbs +14 -0
  115. data/sig/growsurf_ruby/models/campaign/program_resource_update_params.rbs +48 -0
  116. data/sig/growsurf_ruby/models/campaign/program_resource_upload_result.rbs +58 -0
  117. data/sig/growsurf_ruby/models/campaign/program_resource_upload_ticket.rbs +29 -0
  118. data/sig/growsurf_ruby/models/campaign/program_resource_upload_ticket_params.rbs +29 -0
  119. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +34 -34
  120. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +34 -34
  121. data/sig/growsurf_ruby/models/campaign.rbs +7 -5
  122. data/sig/growsurf_ruby/models/campaign_activation_analytics_response.rbs +202 -0
  123. data/sig/growsurf_ruby/models/campaign_create_params.rbs +29 -0
  124. data/sig/growsurf_ruby/models/campaign_engagement_analytics.rbs +186 -0
  125. data/sig/growsurf_ruby/models/campaign_retrieve_activation_analytics_params.rbs +45 -0
  126. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_params.rbs +30 -1
  127. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +21 -3
  128. data/sig/growsurf_ruby/models/participant_commission_list.rbs +20 -20
  129. data/sig/growsurf_ruby/models/participant_payout_list.rbs +20 -20
  130. data/sig/growsurf_ruby/models.rbs +6 -0
  131. data/sig/growsurf_ruby/resources/campaign/design.rbs +19 -0
  132. data/sig/growsurf_ruby/resources/campaign/integrations.rbs +14 -0
  133. data/sig/growsurf_ruby/resources/campaign/participant.rbs +4 -0
  134. data/sig/growsurf_ruby/resources/campaign/program_resources.rbs +58 -0
  135. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +12 -12
  136. data/sig/growsurf_ruby/resources/campaign.rbs +17 -0
  137. metadata +59 -2
@@ -27,6 +27,19 @@ module GrowsurfRuby
27
27
  # @return [String, nil]
28
28
  optional :currency_iso, String, api_name: :currencyISO
29
29
 
30
+ # @!attribute goal
31
+ # What the program is for, which seeds share settings that suit that audience.
32
+ # Programs selling to businesses (`CUSTOMERS`, `USERS`, `B2B_SAAS_SELF_SERVICE`,
33
+ # `B2B_SAAS_ENTERPRISE`) start with the LinkedIn share button visible; consumer,
34
+ # financial, education, insurance, newsletter, and waitlist programs
35
+ # (`B2C_SUBSCRIPTIONS`, `FINANCIAL_SERVICES`, `ONLINE_EDUCATION`,
36
+ # `ONLINE_INSURANCE`, `SUBSCRIBERS`, `WAITLIST`) start with it hidden. Omit it and
37
+ # every share button keeps its standard default. Set only when the program is
38
+ # created; it is not accepted on update.
39
+ #
40
+ # @return [Symbol, GrowsurfRuby::Models::CampaignCreateParams::Goal, nil]
41
+ optional :goal, enum: -> { GrowsurfRuby::CampaignCreateParams::Goal }
42
+
30
43
  # @!attribute name
31
44
  #
32
45
  # @return [String, nil]
@@ -38,7 +51,7 @@ module GrowsurfRuby
38
51
  optional :rewards,
39
52
  -> { GrowsurfRuby::Internal::Type::ArrayOf[GrowsurfRuby::Campaign::RewardCreateParams] }
40
53
 
41
- # @!method initialize(type:, company_logo_image_url: nil, company_name: nil, currency_iso: nil, name: nil, rewards: nil, request_options: {})
54
+ # @!method initialize(type:, company_logo_image_url: nil, company_name: nil, currency_iso: nil, goal: nil, name: nil, rewards: nil, request_options: {})
42
55
  # @param type [Symbol, GrowsurfRuby::Models::CampaignCreateParams::Type]
43
56
  #
44
57
  # @param company_logo_image_url [String]
@@ -47,6 +60,8 @@ module GrowsurfRuby
47
60
  #
48
61
  # @param currency_iso [String]
49
62
  #
63
+ # @param goal [Symbol, GrowsurfRuby::Models::CampaignCreateParams::Goal] What the program is for, which seeds share settings that suit that audience.
64
+ #
50
65
  # @param name [String]
51
66
  #
52
67
  # @param rewards [Array<GrowsurfRuby::Models::Campaign::RewardCreateParams>]
@@ -63,6 +78,27 @@ module GrowsurfRuby
63
78
  # @!method self.values
64
79
  # @return [Array<Symbol>]
65
80
  end
81
+
82
+ # What the program is for, which seeds share settings that suit that audience.
83
+ #
84
+ # @see GrowsurfRuby::Models::CampaignCreateParams#goal
85
+ module Goal
86
+ extend GrowsurfRuby::Internal::Type::Enum
87
+
88
+ CUSTOMERS = :CUSTOMERS
89
+ USERS = :USERS
90
+ SUBSCRIBERS = :SUBSCRIBERS
91
+ WAITLIST = :WAITLIST
92
+ B2B_SAAS_SELF_SERVICE = :B2B_SAAS_SELF_SERVICE
93
+ B2B_SAAS_ENTERPRISE = :B2B_SAAS_ENTERPRISE
94
+ B2C_SUBSCRIPTIONS = :B2C_SUBSCRIPTIONS
95
+ FINANCIAL_SERVICES = :FINANCIAL_SERVICES
96
+ ONLINE_EDUCATION = :ONLINE_EDUCATION
97
+ ONLINE_INSURANCE = :ONLINE_INSURANCE
98
+
99
+ # @!method self.values
100
+ # @return [Array<Symbol>]
101
+ end
66
102
  end
67
103
  end
68
104
  end
@@ -0,0 +1,174 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # Current participant engagement for the selected program, period, and platform.
6
+ class CampaignEngagementAnalytics < GrowsurfRuby::Internal::Type::BaseModel
7
+ required :coverage_start_at, Integer, api_name: :coverageStartAt, nil?: true
8
+ required :metric_contract_version, Integer, api_name: :metricContractVersion
9
+ required :program_type, enum: -> { GrowsurfRuby::Models::CampaignEngagementAnalytics::ProgramType }, api_name: :programType
10
+ required :timezone, String
11
+ required :interval, enum: -> { GrowsurfRuby::Models::CampaignEngagementAnalytics::Interval }
12
+ required :platform, -> { GrowsurfRuby::Models::CampaignEngagementAnalytics::PlatformFilter }
13
+ required :period, -> { GrowsurfRuby::Models::CampaignEngagementAnalytics::Period }
14
+ required :state, enum: -> { GrowsurfRuby::Models::AnalyticsAvailability }
15
+ required :reason, enum: -> { GrowsurfRuby::Models::AnalyticsUnavailableReason }, nil?: true
16
+ required :totals, -> { GrowsurfRuby::Models::CampaignEngagementAnalytics::Totals }
17
+ required :previous_period,
18
+ -> { GrowsurfRuby::Models::CampaignEngagementAnalytics::PreviousPeriod },
19
+ api_name: :previousPeriod
20
+ required :comparison, -> { GrowsurfRuby::Models::CampaignEngagementAnalytics::Comparison }
21
+ required :series,
22
+ -> {
23
+ GrowsurfRuby::Internal::Type::ArrayOf[
24
+ GrowsurfRuby::Models::CampaignEngagementAnalytics::SeriesPoint
25
+ ]
26
+ }
27
+ required :breakdowns, -> { GrowsurfRuby::Models::CampaignEngagementAnalytics::Breakdowns }
28
+
29
+ module ProgramType
30
+ extend GrowsurfRuby::Internal::Type::Enum
31
+
32
+ REFERRAL = :REFERRAL
33
+ AFFILIATE = :AFFILIATE
34
+ end
35
+
36
+ module Interval
37
+ extend GrowsurfRuby::Internal::Type::Enum
38
+
39
+ DAY = :day
40
+ WEEK = :week
41
+ MONTH = :month
42
+ end
43
+
44
+ module Platform
45
+ extend GrowsurfRuby::Internal::Type::Enum
46
+
47
+ ALL = :ALL
48
+ WEB = :WEB
49
+ IOS = :IOS
50
+ ANDROID = :ANDROID
51
+ end
52
+
53
+ module BreakdownPlatform
54
+ extend GrowsurfRuby::Internal::Type::Enum
55
+
56
+ WEB = :WEB
57
+ IOS = :IOS
58
+ ANDROID = :ANDROID
59
+ end
60
+
61
+ class Metric < GrowsurfRuby::Internal::Type::BaseModel
62
+ required :state, enum: -> { GrowsurfRuby::Models::AnalyticsAvailability }
63
+ required :value, Float, nil?: true
64
+ required :reason, enum: -> { GrowsurfRuby::Models::AnalyticsUnavailableReason }, nil?: true
65
+ optional :delta, Float
66
+ end
67
+
68
+ class Totals < GrowsurfRuby::Internal::Type::BaseModel
69
+ required :active_participants, -> { Metric }, api_name: :activeParticipants
70
+ required :sharing_participants, -> { Metric }, api_name: :sharingParticipants
71
+ required :sharing_rate, -> { Metric }, api_name: :sharingRate
72
+ required :repeat_active_participants, -> { Metric }, api_name: :repeatActiveParticipants
73
+ required :repeat_sharing_participants, -> { Metric }, api_name: :repeatSharingParticipants
74
+ required :retained_active_participants, -> { Metric }, api_name: :retainedActiveParticipants
75
+ required :portal_views, -> { Metric }, api_name: :portalViews
76
+ required :share_actions, -> { Metric }, api_name: :shareActions
77
+ end
78
+
79
+ class Period < GrowsurfRuby::Internal::Type::BaseModel
80
+ required :from, Integer
81
+ required :to, Integer
82
+ required :effective_from, Integer, api_name: :effectiveFrom, nil?: true
83
+ required :previous_from, Integer, api_name: :previousFrom
84
+ required :previous_to, Integer, api_name: :previousTo
85
+ end
86
+
87
+ class PlatformFilter < GrowsurfRuby::Internal::Type::BaseModel
88
+ required :requested, enum: -> { Platform }
89
+ required :applied, enum: -> { Platform }
90
+ required :state, enum: -> { GrowsurfRuby::Models::AnalyticsAvailability }
91
+ end
92
+
93
+ class PreviousPeriod < GrowsurfRuby::Internal::Type::BaseModel
94
+ required :state, enum: -> { GrowsurfRuby::Models::AnalyticsAvailability }
95
+ required :reason, enum: -> { GrowsurfRuby::Models::AnalyticsUnavailableReason }, nil?: true
96
+ required :totals, -> { Totals }, nil?: true
97
+ end
98
+
99
+ class ComparisonMetrics < GrowsurfRuby::Internal::Type::BaseModel
100
+ optional :active_participants, -> { Metric }, api_name: :activeParticipants
101
+ optional :sharing_participants, -> { Metric }, api_name: :sharingParticipants
102
+ optional :repeat_active_participants, -> { Metric }, api_name: :repeatActiveParticipants
103
+ optional :repeat_sharing_participants, -> { Metric }, api_name: :repeatSharingParticipants
104
+ optional :portal_views, -> { Metric }, api_name: :portalViews
105
+ optional :share_actions, -> { Metric }, api_name: :shareActions
106
+ end
107
+
108
+ class Comparison < GrowsurfRuby::Internal::Type::BaseModel
109
+ required :state, enum: -> { GrowsurfRuby::Models::AnalyticsAvailability }
110
+ required :reason, enum: -> { GrowsurfRuby::Models::AnalyticsUnavailableReason }, nil?: true
111
+ required :metrics, -> { ComparisonMetrics }, nil?: true
112
+ end
113
+
114
+ class SeriesPoint < GrowsurfRuby::Internal::Type::BaseModel
115
+ required :from, Integer
116
+ required :to, Integer
117
+ required :active_participants, Integer, api_name: :activeParticipants
118
+ required :sharing_participants, Integer, api_name: :sharingParticipants
119
+ required :portal_views, Integer, api_name: :portalViews
120
+ required :share_actions, Integer, api_name: :shareActions
121
+ end
122
+
123
+ class PlatformBreakdown < GrowsurfRuby::Internal::Type::BaseModel
124
+ required :key, enum: -> { BreakdownPlatform }
125
+ required :active_participants, Integer, api_name: :activeParticipants
126
+ required :sharing_participants, Integer, api_name: :sharingParticipants
127
+ required :portal_views, Integer, api_name: :portalViews
128
+ required :share_actions, Integer, api_name: :shareActions
129
+ end
130
+
131
+ module PortalSource
132
+ extend GrowsurfRuby::Internal::Type::Enum
133
+
134
+ DEFAULT_LAUNCHER = :DEFAULT_LAUNCHER
135
+ SDK_OPEN = :SDK_OPEN
136
+ CSS_CLASS = :CSS_CLASS
137
+ EMBEDDABLE_ELEMENT = :EMBEDDABLE_ELEMENT
138
+ HOSTED_PORTAL = :HOSTED_PORTAL
139
+ NATIVE_WINDOW = :NATIVE_WINDOW
140
+ UNKNOWN = :UNKNOWN
141
+ end
142
+
143
+ class PortalSourceBreakdown < GrowsurfRuby::Internal::Type::BaseModel
144
+ required :key, enum: -> { PortalSource }
145
+ required :active_participants, Integer, api_name: :activeParticipants
146
+ required :portal_views, Integer, api_name: :portalViews
147
+ end
148
+
149
+ class ShareChannelBreakdown < GrowsurfRuby::Internal::Type::BaseModel
150
+ required :key, String
151
+ required :sharing_participants, Integer, api_name: :sharingParticipants
152
+ required :share_actions, Integer, api_name: :shareActions
153
+ end
154
+
155
+ class FirstShareChannelBreakdown < GrowsurfRuby::Internal::Type::BaseModel
156
+ required :key, String
157
+ required :sharing_participants, Integer, api_name: :sharingParticipants
158
+ end
159
+
160
+ class Breakdowns < GrowsurfRuby::Internal::Type::BaseModel
161
+ required :platforms, -> { GrowsurfRuby::Internal::Type::ArrayOf[PlatformBreakdown] }
162
+ required :portal_view_sources,
163
+ -> { GrowsurfRuby::Internal::Type::ArrayOf[PortalSourceBreakdown] },
164
+ api_name: :portalViewSources
165
+ required :share_channels,
166
+ -> { GrowsurfRuby::Internal::Type::ArrayOf[ShareChannelBreakdown] },
167
+ api_name: :shareChannels
168
+ required :first_share_channels,
169
+ -> { GrowsurfRuby::Internal::Type::ArrayOf[FirstShareChannelBreakdown] },
170
+ api_name: :firstShareChannels
171
+ end
172
+ end
173
+ end
174
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Campaign#retrieve_activation_analytics
6
+ class CampaignRetrieveActivationAnalyticsParams < GrowsurfRuby::Internal::Type::BaseModel
7
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
8
+ include GrowsurfRuby::Internal::Type::RequestParameters
9
+
10
+ required :id, String
11
+ optional :cohort_from, Integer
12
+ optional :cohort_to, Integer
13
+ optional :cohort_interval,
14
+ enum: -> { GrowsurfRuby::Models::CampaignRetrieveActivationAnalyticsParams::CohortInterval }
15
+ optional :observation_window_days,
16
+ enum: -> { GrowsurfRuby::Models::CampaignRetrieveActivationAnalyticsParams::ObservationWindowDays }
17
+ optional :timezone, String
18
+
19
+ module CohortInterval
20
+ extend GrowsurfRuby::Internal::Type::Enum
21
+
22
+ DAY = :day
23
+ WEEK = :week
24
+ MONTH = :month
25
+ end
26
+
27
+ module ObservationWindowDays
28
+ extend GrowsurfRuby::Internal::Type::Enum
29
+
30
+ SEVEN = 7
31
+ THIRTY = 30
32
+ end
33
+ end
34
+ end
35
+ end
@@ -33,18 +33,27 @@ module GrowsurfRuby
33
33
  # `clicked`, `bounced`, `spamComplaints`, and per-email-type metrics. When `email` and
34
34
  # an interval are both requested, each `series` item also contains counts for emails
35
35
  # sent during that period. Combine `email` with `previousPeriod` to include the same
36
- # email metrics in both windows.
36
+ # email metrics in both windows. `engagement` adds covered participant activity
37
+ # totals, comparisons, series, and breakdowns.
37
38
  #
38
39
  # @return [String, nil]
39
40
  optional :include, String
40
41
 
41
42
  # @!attribute interval
42
43
  # When set to `day`, `week`, or `month`, the response also includes a `series` array
43
- # with per-period totals. Defaults to `total` (no series).
44
+ # with per-period totals and uses the same bucket size for `engagement.series`.
45
+ # Defaults to `total` (no legacy series); `engagement.series` uses daily buckets when
46
+ # `interval` is `total` or omitted.
44
47
  #
45
48
  # @return [Symbol, GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams::Interval, nil]
46
49
  optional :interval, enum: -> { GrowsurfRuby::CampaignRetrieveAnalyticsParams::Interval }
47
50
 
51
+ # @!attribute platform
52
+ # Participant platform used for `engagement`. Defaults to `ALL`.
53
+ #
54
+ # @return [Symbol, GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams::Platform, nil]
55
+ optional :platform, enum: -> { GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams::Platform }
56
+
48
57
  # @!attribute start_date
49
58
  # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
50
59
  # Required if `days` is not set.
@@ -52,7 +61,13 @@ module GrowsurfRuby
52
61
  # @return [Integer, nil]
53
62
  optional :start_date, Integer
54
63
 
55
- # @!method initialize(id:, days: nil, end_date: nil, include: nil, interval: nil, start_date: nil, request_options: {})
64
+ # @!attribute timezone
65
+ # IANA timezone used for engagement periods and buckets. Defaults to `UTC`.
66
+ #
67
+ # @return [String, nil]
68
+ optional :timezone, String
69
+
70
+ # @!method initialize(id:, days: nil, end_date: nil, include: nil, interval: nil, platform: nil, start_date: nil, timezone: nil, request_options: {})
56
71
  # Some parameter documentations has been truncated, see
57
72
  # {GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams} for more details.
58
73
  #
@@ -66,12 +81,18 @@ module GrowsurfRuby
66
81
  #
67
82
  # @param interval [Symbol, GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams::Interval] When set to `day`, `week`, or `month`, the response also includes a `series` array
68
83
  #
84
+ # @param platform [Symbol, GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams::Platform] Participant platform used for `engagement`. Defaults to `ALL`.
85
+ #
69
86
  # @param start_date [Integer] Start date of the analytics timeframe as a Unix timestamp in milliseconds. Requi
70
87
  #
88
+ # @param timezone [String] IANA timezone used for engagement periods and buckets. Defaults to `UTC`.
89
+ #
71
90
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
72
91
 
73
92
  # When set to `day`, `week`, or `month`, the response also includes a `series` array
74
- # with per-period totals. Defaults to `total` (no series).
93
+ # with per-period totals and uses the same bucket size for `engagement.series`.
94
+ # Defaults to `total` (no legacy series); `engagement.series` uses daily buckets when
95
+ # `interval` is `total` or omitted.
75
96
  module Interval
76
97
  extend GrowsurfRuby::Internal::Type::Enum
77
98
 
@@ -83,6 +104,18 @@ module GrowsurfRuby
83
104
  # @!method self.values
84
105
  # @return [Array<Symbol>]
85
106
  end
107
+
108
+ module Platform
109
+ extend GrowsurfRuby::Internal::Type::Enum
110
+
111
+ ALL = :ALL
112
+ WEB = :WEB
113
+ IOS = :IOS
114
+ ANDROID = :ANDROID
115
+
116
+ # @!method self.values
117
+ # @return [Array<Symbol>]
118
+ end
86
119
  end
87
120
  end
88
121
  end
@@ -22,6 +22,9 @@ module GrowsurfRuby
22
22
  # Present only when `include` contains `email`.
23
23
  optional :email, -> { GrowsurfRuby::Models::EmailAnalytics }
24
24
 
25
+ # Present only when `include` contains `engagement`.
26
+ optional :engagement, -> { GrowsurfRuby::Models::CampaignEngagementAnalytics }
27
+
25
28
  # @!attribute previous_period
26
29
  # Present only when `include` contains `previousPeriod`.
27
30
  #
@@ -32,7 +32,10 @@ module GrowsurfRuby
32
32
  optional :duration_in_months, Integer, api_name: :durationInMonths, nil?: true
33
33
 
34
34
  # @!attribute event
35
- # The event that generates a commission. Missing legacy values read as `SALE`.
35
+ # The event that generates a commission. `CLICK` and `LEAD` require `FIXED`
36
+ # with a positive `amount`; `amountISO` defaults to the program currency when
37
+ # omitted. `SALE` supports `FIXED` or `PERCENT`. Missing legacy values read as
38
+ # `SALE`.
36
39
  #
37
40
  # @return [Symbol, GrowsurfRuby::Models::CommissionStructure::Event, nil]
38
41
  optional :event, enum: -> { GrowsurfRuby::CommissionStructure::Event }, nil?: true
@@ -80,7 +80,7 @@ module GrowsurfRuby
80
80
  # @!attribute approved_at
81
81
  #
82
82
  # @return [Integer, nil]
83
- optional :approved_at, Integer, api_name: :approvedAt
83
+ optional :approved_at, Integer, api_name: :approvedAt, nil?: true
84
84
 
85
85
  # @!attribute campaign_currency_iso
86
86
  #
@@ -95,7 +95,7 @@ module GrowsurfRuby
95
95
  # @!attribute exchange_rate_at
96
96
  #
97
97
  # @return [Integer, nil]
98
- optional :exchange_rate_at, Integer, api_name: :exchangeRateAt
98
+ optional :exchange_rate_at, Integer, api_name: :exchangeRateAt, nil?: true
99
99
 
100
100
  # @!attribute fx_error
101
101
  #
@@ -110,12 +110,12 @@ module GrowsurfRuby
110
110
  # @!attribute paid_at
111
111
  #
112
112
  # @return [Integer, nil]
113
- optional :paid_at, Integer, api_name: :paidAt
113
+ optional :paid_at, Integer, api_name: :paidAt, nil?: true
114
114
 
115
115
  # @!attribute payout_queued_at
116
116
  #
117
117
  # @return [Integer, nil]
118
- optional :payout_queued_at, Integer, api_name: :payoutQueuedAt
118
+ optional :payout_queued_at, Integer, api_name: :payoutQueuedAt, nil?: true
119
119
 
120
120
  # @!attribute provider
121
121
  #
@@ -125,7 +125,7 @@ module GrowsurfRuby
125
125
  # @!attribute reversed_at
126
126
  #
127
127
  # @return [Integer, nil]
128
- optional :reversed_at, Integer, api_name: :reversedAt
128
+ optional :reversed_at, Integer, api_name: :reversedAt, nil?: true
129
129
 
130
130
  # @!attribute sale_amount_in_campaign_currency
131
131
  #
@@ -79,12 +79,12 @@ module GrowsurfRuby
79
79
  # @!attribute exchange_rate_at
80
80
  #
81
81
  # @return [Integer, nil]
82
- optional :exchange_rate_at, Integer, api_name: :exchangeRateAt
82
+ optional :exchange_rate_at, Integer, api_name: :exchangeRateAt, nil?: true
83
83
 
84
84
  # @!attribute failed_at
85
85
  #
86
86
  # @return [Integer, nil]
87
- optional :failed_at, Integer, api_name: :failedAt
87
+ optional :failed_at, Integer, api_name: :failedAt, nil?: true
88
88
 
89
89
  # @!attribute fx_error
90
90
  #
@@ -94,7 +94,7 @@ module GrowsurfRuby
94
94
  # @!attribute issued_at
95
95
  #
96
96
  # @return [Integer, nil]
97
- optional :issued_at, Integer, api_name: :issuedAt
97
+ optional :issued_at, Integer, api_name: :issuedAt, nil?: true
98
98
 
99
99
  # @!attribute provider
100
100
  #
@@ -104,12 +104,12 @@ module GrowsurfRuby
104
104
  # @!attribute queued_at
105
105
  #
106
106
  # @return [Integer, nil]
107
- optional :queued_at, Integer, api_name: :queuedAt
107
+ optional :queued_at, Integer, api_name: :queuedAt, nil?: true
108
108
 
109
109
  # @!attribute reversed_at
110
110
  #
111
111
  # @return [Integer, nil]
112
- optional :reversed_at, Integer, api_name: :reversedAt
112
+ optional :reversed_at, Integer, api_name: :reversedAt, nil?: true
113
113
 
114
114
  # @!method initialize(id:, amount:, commission_ids:, created_at:, currency_iso:, participant_id:, status:, amount_in_campaign_currency: nil, campaign_currency_iso: nil, exchange_rate: nil, exchange_rate_at: nil, failed_at: nil, fx_error: nil, issued_at: nil, provider: nil, queued_at: nil, reversed_at: nil)
115
115
  # @param id [String]
@@ -41,6 +41,10 @@ module GrowsurfRuby
41
41
 
42
42
  AccountCreateParams = GrowsurfRuby::Models::AccountCreateParams
43
43
 
44
+ AnalyticsAvailability = GrowsurfRuby::Models::AnalyticsAvailability
45
+
46
+ AnalyticsUnavailableReason = GrowsurfRuby::Models::AnalyticsUnavailableReason
47
+
44
48
  AffiliateApplication = GrowsurfRuby::Models::AffiliateApplication
45
49
 
46
50
  AffiliateInvite = GrowsurfRuby::Models::AffiliateInvite
@@ -81,6 +85,9 @@ module GrowsurfRuby
81
85
  CampaignRetrieveAffiliateApplicationParams =
82
86
  GrowsurfRuby::Models::CampaignRetrieveAffiliateApplicationParams
83
87
 
88
+ CampaignRetrieveActivationAnalyticsParams =
89
+ GrowsurfRuby::Models::CampaignRetrieveActivationAnalyticsParams
90
+
84
91
  CampaignRetrieveAnalyticsParams = GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams
85
92
 
86
93
  CampaignRetrieveParams = GrowsurfRuby::Models::CampaignRetrieveParams
@@ -4,19 +4,25 @@ module GrowsurfRuby
4
4
  module Resources
5
5
  class Account
6
6
  # Creates a new GrowSurf account. This is the only endpoint that does not require
7
- # an API key. The response includes an API key for the new account, shown once in
8
- # the response. The key is locked until the team owner's email address is
7
+ # an API key. Before calling it, an authorized account owner must review and
8
+ # approve GrowSurf's [Terms of Service](https://growsurf.com/terms) and [Privacy
9
+ # Policy](https://growsurf.com/privacy). The account starts a 14-day Business
10
+ # trial without a credit card. The response includes an API key for the new
11
+ # account, shown once in the response. The key is a secret: store it in a secret
12
+ # manager and do not put it in logs, screenshots, URLs, model context, analytics,
13
+ # or generated output. The key is locked until the team owner's email address is
9
14
  # verified: authenticated program and resource endpoints return a `403` with error
10
15
  # code `EMAIL_NOT_VERIFIED_ERROR` until then (resend the email via `POST
11
- # /team/owner/verification-email`, then retry). A welcome email is sent to the
12
- # address with the verification link and a set-password link for dashboard access.
13
- # Accounts whose email is never verified are deleted automatically after 7 days.
14
- # For security, the API key is rotated the first time the account owner signs in
15
- # to the GrowSurf dashboard. Some actions (such as emailing participants)
16
- # additionally require GrowSurf to verify the team first. By creating an account
17
- # you agree, on behalf of the account holder, to GrowSurf's [Terms of
18
- # Service](https://growsurf.com/terms) and [Privacy
19
- # Policy](https://growsurf.com/privacy).
16
+ # /team/owner/verification-email`, then retry). Verification unlocks this same key
17
+ # - keep it and retry rather than requesting a replacement. A welcome email is
18
+ # sent to the address with the verification link and a set-password link for
19
+ # dashboard access. Accounts whose email is never verified are deleted
20
+ # automatically after 7 days. Separately, for security, the API key is replaced
21
+ # the first time the account owner signs in to the GrowSurf dashboard; email
22
+ # verification does not trigger that, and the previous key then returns a `403`
23
+ # with error code `NOT_AUTHORIZED_ERROR`. Some actions (such as emailing participants)
24
+ # additionally require GrowSurf to verify the team first. Calling this endpoint
25
+ # accepts those policies on the account holder's behalf.
20
26
  #
21
27
  # @overload create(email:, company: nil, first_name: nil, last_name: nil, request_options: {})
22
28
  #
@@ -7,8 +7,11 @@ module GrowsurfRuby
7
7
  # Retrieves a program's configured design fields: the dashboard Program Editor's **Design**
8
8
  # tab plus the payout-destination confirmation page copy configured from payout integration
9
9
  # cards. This includes the GrowSurf window layout, header, share channels and invites,
10
- # signup form, portal and landing pages, theme styling, and referral or affiliate summary
11
- # and status sections. The available fields depend on the program type.
10
+ # signup form, Resources presentation, portal and landing pages, theme styling, and referral
11
+ # or affiliate summary and status sections. `referredExperience` includes the Claim Offer Popup for both program
12
+ # types, with its colors under `theme.referredExperienceOfferPopup`.
13
+ # `participantAvatarStyle` is `CHARACTERS`, `INITIALS`, `ANIMALS`, or `GRADIENT`; missing or
14
+ # unknown values mean `INITIALS`.
12
15
  # `payoutDestinationConfirmation` is omitted when no confirmation fields are stored. Stored
13
16
  # `null` fields are returned as `null`; omitted and `null` fields use localized defaults.
14
17
  #
@@ -29,7 +32,8 @@ module GrowsurfRuby
29
32
  end
30
33
 
31
34
  # Updates a program's design configuration, including the payout-destination confirmation
32
- # page copy configured from payout integration cards. Only the fields you send are changed;
35
+ # page copy and the Claim Offer Popup under `referredExperience`. Only the fields you send
36
+ # are changed;
33
37
  # anything you leave out is untouched (arrays such as `signup.fields` replace wholesale).
34
38
  # Unknown fields, fields not available for the program type, and invalid values return a
35
39
  # `400`. Landing-page custom code and JavaScript are not editable via the API.
@@ -38,8 +42,10 @@ module GrowsurfRuby
38
42
  #
39
43
  # @param id [String] GrowSurf program ID.
40
44
  #
41
- # @param body [Hash{Symbol=>Object}] Partial design configuration to merge, such as
42
- # `{ payoutDestinationConfirmation: { headline: "Confirm your {{payoutProvider}} payout email" } }`.
45
+ # @param body [Hash{Symbol=>Object}] Partial design configuration to merge. `resources`
46
+ # accepts `isPublicDisplayed`, `title`, `viewResourcesLinkText`, `backLinkText`,
47
+ # `copyButtonText`, `copiedText`, `emptyState`, and `icon` (`type`: `DEFAULT`, `IMAGE`, or `NONE`, plus
48
+ # `imageUrl` for `IMAGE`). Resource items use the Program Resources operations.
43
49
  #
44
50
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
45
51
  #
@@ -8,7 +8,8 @@ module GrowsurfRuby
8
8
  # Program Editor's **Emails** tab. Returns each editable email template
9
9
  # (`subject`, `preheader`, `body`, `isEnabled`) plus the `settings` block (sender,
10
10
  # contact, and design). The set of email templates returned depends on the program
11
- # type (referral vs affiliate).
11
+ # type (referral vs affiliate). `offerClaimed` is available to both program types and sends
12
+ # while the Claim Offer Popup is enabled.
12
13
  #
13
14
  # @overload retrieve(id, request_options: {})
14
15
  #
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ class Integrations
7
+ # Lists every integration this program can connect, each with its current state.
8
+ # Integrations that do not apply to the program type are omitted (for example,
9
+ # Wise on a referral program). Read-only: connecting an integration is an OAuth or
10
+ # credential handshake completed in the GrowSurf dashboard, so it cannot be done
11
+ # over the API. `connected` means credentials are stored, `enabled` means the
12
+ # integration is switched on and working, and `autoDisabled` means GrowSurf
13
+ # switched it off after repeated delivery failures — its credentials are still
14
+ # stored, but it delivers nothing until it is reconnected in the dashboard.
15
+ #
16
+ # @overload list(id, request_options: {})
17
+ #
18
+ # @param id [String] GrowSurf program ID.
19
+ #
20
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
21
+ #
22
+ # @return [GrowsurfRuby::Models::Campaign::IntegrationListResponse]
23
+ def list(id, params = {})
24
+ @client.request(
25
+ method: :get,
26
+ path: ["campaign/%1$s/integrations", id],
27
+ model: GrowsurfRuby::Models::Campaign::IntegrationListResponse,
28
+ options: params[:request_options]
29
+ )
30
+ end
31
+
32
+ # @api private
33
+ #
34
+ # @param client [GrowsurfRuby::Client]
35
+ def initialize(client:)
36
+ @client = client
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end