/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ExportCertificateResponse response = new ExportCertificateResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Certificate", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Certificate = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("CertificateChain", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.CertificateChain = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PrivateKey", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PrivateKey = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Exemple #2
0
        public static ExportCertificateResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ExportCertificateResponse exportCertificateResponse = new ExportCertificateResponse();

            exportCertificateResponse.HttpResponse     = _ctx.HttpResponse;
            exportCertificateResponse.RequestId        = _ctx.StringValue("ExportCertificate.RequestId");
            exportCertificateResponse.CertificateId    = _ctx.StringValue("ExportCertificate.CertificateId");
            exportCertificateResponse.Certificate      = _ctx.StringValue("ExportCertificate.Certificate");
            exportCertificateResponse.CertificateChain = _ctx.StringValue("ExportCertificate.CertificateChain");
            exportCertificateResponse.PrivateKey       = _ctx.StringValue("ExportCertificate.PrivateKey");
            exportCertificateResponse.PKCS12Blob       = _ctx.StringValue("ExportCertificate.PKCS12Blob");

            return(exportCertificateResponse);
        }