Class: GrowsurfRuby::Resources::Campaign::Reward
- Inherits:
-
Object
- Object
- GrowsurfRuby::Resources::Campaign::Reward
- Defined in:
- lib/growsurf_ruby/resources/campaign/reward.rb
Overview
Participant reward retrieval and manual reward operations.
Instance Method Summary collapse
-
#approve(reward_id, id:, fulfill: nil, request_options: {}) ⇒ GrowsurfRuby::Models::Campaign::RewardApproveResponse
Approves a manually approved reward earned by a participant.
-
#delete(reward_id, id:, request_options: {}) ⇒ GrowsurfRuby::Models::Campaign::RewardDeleteResponse
Removes a manually approved participant reward that has not already been approved.
-
#fulfill(reward_id, id:, request_options: {}) ⇒ GrowsurfRuby::Models::Campaign::RewardFulfillResponse
Marks an approved participant reward as fulfilled.
-
#initialize(client:) ⇒ Reward
constructor
private
A new instance of Reward.
Constructor Details
#initialize(client:) ⇒ Reward
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Reward.
96 97 98 |
# File 'lib/growsurf_ruby/resources/campaign/reward.rb', line 96 def initialize(client:) @client = client end |
Instance Method Details
#approve(reward_id, id:, fulfill: nil, request_options: {}) ⇒ GrowsurfRuby::Models::Campaign::RewardApproveResponse
Approves a manually approved reward earned by a participant.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/growsurf_ruby/resources/campaign/reward.rb', line 51 def approve(reward_id, params) parsed, = GrowsurfRuby::Campaign::RewardApproveParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["campaign/%1$s/reward/%2$s/approve", id, reward_id], body: parsed, model: GrowsurfRuby::Models::Campaign::RewardApproveResponse, options: ) end |
#delete(reward_id, id:, request_options: {}) ⇒ GrowsurfRuby::Models::Campaign::RewardDeleteResponse
Removes a manually approved participant reward that has not already been approved.
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/growsurf_ruby/resources/campaign/reward.rb', line 22 def delete(reward_id, params) parsed, = GrowsurfRuby::Campaign::RewardDeleteParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["campaign/%1$s/reward/%2$s", id, reward_id], model: GrowsurfRuby::Models::Campaign::RewardDeleteResponse, options: ) end |
#fulfill(reward_id, id:, request_options: {}) ⇒ GrowsurfRuby::Models::Campaign::RewardFulfillResponse
Marks an approved participant reward as fulfilled.
79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/growsurf_ruby/resources/campaign/reward.rb', line 79 def fulfill(reward_id, params) parsed, = GrowsurfRuby::Campaign::RewardFulfillParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["campaign/%1$s/reward/%2$s/fulfill", id, reward_id], model: GrowsurfRuby::Models::Campaign::RewardFulfillResponse, options: ) end |