public static FunkServiceInfo FromJSON(String iJSON)
        {
            FunkServiceInfo pFIoInfo = new FunkServiceInfo();

            using (JsonReader pJRrReader = new JsonTextReader(new StringReader(iJSON)))
            {
                pJRrReader.DateParseHandling = DateParseHandling.None;
                JObject pJOtJSON = JObject.Load(pJRrReader);
                pFIoInfo.cStrName    = pJOtJSON["Name"].Value <String>();
                pFIoInfo.cStrVersion = pJOtJSON["Version"].Value <String>();
                //pFIoInfo.cDTeInfoRequestedAt = DateTime.ParseExact(pJOtJSON["InfoRequestedAt"].Value<String>(), EnvironmentHelpers.GetEnvironmentVariable("DateTimeFormat"), System.Globalization.CultureInfo.InvariantCulture);
                pFIoInfo.cStrPublicKey           = pJOtJSON["PublicKey"].Value <String>();
                pFIoInfo.cStrFacebookCallbackURL = pJOtJSON["FacebookCallbackURL"].Value <String>();
            }
            return(pFIoInfo);
        }
Пример #2
0
        public static async Task <FunkManagementServiceInfoResponse> GetServiceInfoAsync(this FunkClient iFunkClient)
        {
            HttpResponseMessage pHRMResponse = await iFunkClient.AuthenticatedRequestAsync("GET",
                                                                                           iFunkClient.GetFunctionURI("ServiceInfo"));

            if (pHRMResponse.IsSuccessStatusCode)
            {
                String pStrResponse = await pHRMResponse.Content.ReadAsStringAsync();

                FunkServiceInfo pFSIResponse = FunkServiceInfo.FromJSON(pStrResponse);
                return(new FunkManagementServiceInfoResponse(true, pFSIResponse));
            }
            else
            {
                return(new FunkManagementServiceInfoResponse(false, null));
            }
        }