Example #1
0
 /// <summary>
 /// The GrantBonus operation issues a payment of money from your account to a Worker. 
 /// To be eligible for a bonus, the Worker must have submitted results for one of your 
 /// HITs, and have had those results approved or rejected. This payment happens separately 
 /// from the reward you pay to the Worker when you approve the Worker's assignment.
 /// </summary>
 /// <param name="request">A <see cref="GrantBonusRequest"/> instance containing 
 /// the request parameters</param>
 public void GrantBonus(GrantBonusRequest request)
 {
     this.SendRequest(request);
 }
Example #2
0
        /// <summary>
        /// See <a href="http://docs.amazonwebservices.com/AWSMechTurk/2012-03-25/AWSMturkAPI/ApiReference_GrantBonusOperation.html">online documentation for this operation.</a>
        /// </summary>
        /// <param name="workerId">The worker id.</param>
        /// <param name="bonusAmount">The bonus amount.</param>
        /// <param name="assignmentId">The assignment id.</param>
        /// <param name="reason">The reason.</param>
        public void GrantBonus(string workerId, decimal? bonusAmount, string assignmentId, string reason)
        {
            GrantBonusRequest request = new GrantBonusRequest();
            request.WorkerId = workerId;
            request.AssignmentId = assignmentId;
            request.Reason = reason;

            if (bonusAmount.HasValue)
            {
                Price p = new Price();
                p.Amount = bonusAmount.Value;
                p.CurrencyCode = "USD";
                request.BonusAmount = p;
            }

            Proxy.GrantBonus(request);
        }