/// <summary>
        /// Reads annotation fields for event name and field-values and set them to
        /// proper event fields. After this method, json serialization of event will meet server expectation
        /// </summary>
        /// <param name="gameEvent">always is caller event. Just for test purposes</param>
        private void InitFieldsUsingAnnotations(BacktoryGameEvent gameEvent)
        {
            var temp            = new List <FieldValue>();
            var fieldNamesProps = Utils.GetPropertiesByAttribute(typeof(FieldNameAttribute), this, true);

            foreach (var prop in fieldNamesProps)
            {
                FieldNameAttribute attr = prop.GetCustomAttributes(typeof(FieldNameAttribute), true).Single() as FieldNameAttribute;
                if (attr == null)
                {
                    throw new InvalidOperationException("something bad in reflection");
                }

                var val = prop.GetValue(this, null);
                if (val is int)
                {
                    temp.Add(new FieldValue(attr.Name, (int)val));
                }
                else
                {
                    throw new ArgumentException("\"Fields\"s can only accept integers as their values. Your's is " + val.GetType());
                }
            }
            FieldsAndValues = temp;
        }
        private IRestRequest SendEventRequest(BacktoryGameEvent backtoryGameEvent)
        {
            var request = Backtory.RestRequest("game/events", Method.POST);

            request.AddHeader(Backtory.GameInstanceIdString, BacktoryConfig.BacktoryGameInstanceId);
            request.AddHeader(BacktoryUser.KeyAuthorization, BacktoryUser.AuthorizationHeader());
            request.AddHeader("Accept", Backtory.ApplicationJson);
            request.AddJsonBody(backtoryGameEvent);

            return(request);
        }