예제 #1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, CreateDomainResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("DomainStatus", targetDepth))
                    {
                        response.DomainStatus = DomainStatusUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }



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

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

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

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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("CreateDomainResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
 public void AddDomain(string domainName)
 {
     CreateDomainRequest myCreateDomainRequest = new CreateDomainRequest {
         DomainName = domainName
     };
     CreateDomainResponse response = Service.CreateDomain(myCreateDomainRequest);
 }
        public static CreateDomainResponse Unmarshall(UnmarshallerContext context)
        {
            CreateDomainResponse createDomainResponse = new CreateDomainResponse();

            createDomainResponse.HttpResponse = context.HttpResponse;
            createDomainResponse.RequestId    = context.StringValue("CreateDomain.RequestId");

            return(createDomainResponse);
        }
        public static CreateDomainResponse Unmarshall(UnmarshallerContext _ctx)
        {
            CreateDomainResponse createDomainResponse = new CreateDomainResponse();

            createDomainResponse.HttpResponse = _ctx.HttpResponse;
            createDomainResponse.RequestId    = _ctx.StringValue("CreateDomain.RequestId");
            createDomainResponse.Cname        = _ctx.StringValue("CreateDomain.Cname");

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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("CreatedAt", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.CreatedAt = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DeadLetterQueueUrl", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.DeadLetterQueueUrl = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DefaultEncryptionKey", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.DefaultEncryptionKey = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DefaultExpirationDays", targetDepth))
                {
                    var unmarshaller = IntUnmarshaller.Instance;
                    response.DefaultExpirationDays = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DomainName", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.DomainName = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("LastUpdatedAt", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.LastUpdatedAt = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Tags", targetDepth))
                {
                    var unmarshaller = new DictionaryUnmarshaller <string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
                    response.Tags = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
예제 #8
0
        private async Task createDomain(string domainName)
        {
            _logger.LogDebug($"Creating domain {domainName}");

            var client = GetClient();

            CreateDomainRequest request = new CreateDomainRequest(domainName);

            CreateDomainResponse response = await client.CreateDomainAsync(request);

            _logger.LogDebug("createDomain returned");
            _logger.LogDebug(response.ToString());
        }
예제 #9
0
        static void WriteToSimpleDb(AWSCredentials credentials)
        {
            AmazonSimpleDBClient client = new AmazonSimpleDBClient(credentials, RegionEndpoint.USEast1);

            CreateDomainRequest  request  = new CreateDomainRequest("aws-talk");
            CreateDomainResponse response = client.CreateDomain(request);

            PutAttributesRequest putData = new PutAttributesRequest("aws-talk", "products/" + Guid.NewGuid().ToString(),
                                                                    new List <ReplaceableAttribute>()
            {
                new ReplaceableAttribute("Name", "Couch", true),
                new ReplaceableAttribute("Price", "20", true)
            });

            client.PutAttributes(putData);
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CreateDomainResponse response = new CreateDomainResponse();

            while (context.Read())
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
            }


            return(response);
        }
예제 #11
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, CreateDomainResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                }
            }

            return;
        }
예제 #12
0
        public static CreateDomainInfo MapToInfo(CreateDomainResponse resp)
        {
            var helper = new CreateDomainMapperHelper();

            return(helper.MapToInfo(resp));
        }