/// <summary> /// Gets the business rating from the specified transaction id. /// Requires <see cref="APIPermission.CONTRACTS" /> /// <summary> /// <param name="client">The client to use to process this request.</param> /// <param name="transactionId">The byte transaction id.</param> public static BusinessRatingResult Get(HttpClient client, int transactionId) { var request = new BusinessRatingRequest(); request.Type = RequestType.Read; request.Parameters.Add("_crid", transactionId); request.AddResultParameters(); return(request.ProcessRequest <BusinessRatingResult>(client)); }
/// <summary> /// Searches all the business ratings involving the specified user. /// Requires <see cref="APIPermission.CONTRACTS" /> /// <summary> /// <param name="client">The client to use to process this request.</param> /// <param name="userId">The user id.</param> /// <param name="page">The page number.</param> /// <param name="perPage">The number of results per page.</param> public static BusinessRatingResult[] SearchByUserId(HttpClient client, int userId, int page = 1, int perPage = 1) { var request = new BusinessRatingRequest(); request.Type = RequestType.Read; request.Parameters.Add("_uid", userId); if (page < 1) { throw new ArgumentException("Parameter cannot be less than 1.", nameof(page)); } request.Parameters.Add("_page", page); if (perPage < 1) { throw new ArgumentException("Parameter cannot be less than 1.", nameof(perPage)); } if (perPage > 10) { throw new ArgumentException("Parameter cannot be greater than 10.", nameof(perPage)); } request.Parameters.Add("_perpage", perPage); request.AddResultParameters(); return(request.ProcessMultiRequest <BusinessRatingResult>(client)); }