Example #1
0
        /// <summary>Synchronously send the GetUserPropertyInfo request</summary>
        /// <param name="request">Request to be sent</param>
        /// <returns>Response from the API</returns>
        public PropertyInfo Send(GetUserPropertyInfo request)
        {
            var task   = Task.Run(async() => await SendAsync(request));
            var result = task.WaitAndUnwrapException();

            return(result);
        }
        /// <summary>Synchronously send the GetUserPropertyInfo request</summary>
        /// <param name="request">Request to be sent</param>
        /// <returns>Response from the API</returns>
        public PropertyInfo Send(GetUserPropertyInfo request)
        {
            var task = SendAsync(request);

            RaiseExceptionOnFault(task);
            return(task.Result);
        }
        public void TestGetUserPropertyInfo()
        {
            GetUserPropertyInfo req;
            Request             req2;
            PropertyInfo        resp;

            // it 'does not fail with existing properties'
            req  = new GetUserPropertyInfo("int_property");
            resp = client.Send(req);
            Assert.Equal("int", resp.Type);
            req  = new GetUserPropertyInfo("str_property");
            resp = client.Send(req);
            Assert.Equal("string", resp.Type);
        }
        /// <summary>Send the GetUserPropertyInfo request</summary>
        /// <param name="request">Request to be sent</param>
        /// <returns>Response from the API</returns>
        public async Task <PropertyInfo> SendAsync(GetUserPropertyInfo request)
        {
            var json = await SendRequestAsync(request).ConfigureAwait(false);

            return(ParseResponse(json, request));
        }
 /// <summary>Parse JSON response</summary>
 /// <param name="json">JSON string from the API</param>
 /// <param name="request">Request sent to the API</param>
 /// <returns>Parsed response</returns>
 protected PropertyInfo ParseResponse(string json, GetUserPropertyInfo request)
 {
     return(JsonConvert.DeserializeObject <PropertyInfo>(json));
 }
        /// <summary>Send the GetUserPropertyInfo request</summary>
        /// <param name="request">Request to be sent</param>
        /// <returns>Response from the API</returns>
        public PropertyInfo Send(GetUserPropertyInfo request)
        {
            var json = SendRequest(request);

            return(ParseResponse(json, request));
        }