コード例 #1
0
            public response.ProfileRating set(string source_id, int rating,
                                              string profile_id = null, string profile_reference = null,
                                              string filter_id  = null, string filter_reference  = null)
            {
                // To avoid a line of about 30000 column.
                var mess = String.Format("One beetween profile_id and profile_reference has to be not null or empty. (profile_id: {0} profile_reference: {1})", profile_id, profile_reference);

                RequestUtils.assert_id_ref_notNull(profile_id, profile_reference, mess);
                mess = String.Format("One beetween filter_id and filter_reference has to be not null or empty. (filter_id: {0} filter_reference: {1})", filter_id, filter_reference);
                RequestUtils.assert_id_ref_notNull(filter_id, filter_reference, mess);

                var bodyParams = new Dictionary <string, object>
                {
                    { "source_id", source_id },
                    { "rating", rating }
                };

                RequestUtils.addIfNotNull(ref bodyParams, "profile_id", profile_id);
                RequestUtils.addIfNotNull(ref bodyParams, "profile_reference", profile_reference);
                RequestUtils.addIfNotNull(ref bodyParams, "filter_id", filter_id);
                RequestUtils.addIfNotNull(ref bodyParams, "filter_reference", filter_reference);

                var resp = _client.patch <response.ProfileRating>("profile/rating", args: bodyParams);

                return(resp.data);
            }