示例#1
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DeleteUserGroupResponse response = new DeleteUserGroupResponse();

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

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

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

            return(response);
        }
示例#2
0
        public async Task <DeleteUserGroupResponse> DeleteUserGroup(DeleteUserGroupRequest o)
        {
            var result = new DeleteUserGroupResponse(o.RequestId);

            result.Application = o.Application;
            result.Deleted     = await Server.DeleteUserGroup(o.Id);

            return(result);
        }
示例#3
0
        public static DeleteUserGroupResponse Unmarshall(UnmarshallerContext context)
        {
            DeleteUserGroupResponse deleteUserGroupResponse = new DeleteUserGroupResponse();

            deleteUserGroupResponse.HttpResponse = context.HttpResponse;
            deleteUserGroupResponse.Code         = context.StringValue("DeleteUserGroup.Code");
            deleteUserGroupResponse.Message      = context.StringValue("DeleteUserGroup.Message");
            deleteUserGroupResponse.RequestId    = context.StringValue("DeleteUserGroup.RequestId");
            deleteUserGroupResponse.Data         = context.BooleanValue("DeleteUserGroup.Data");

            return(deleteUserGroupResponse);
        }
示例#4
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, DeleteUserGroupResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("ARN", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.ARN = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("Engine", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Engine = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("MinimumEngineVersion", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.MinimumEngineVersion = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("PendingChanges", targetDepth))
                    {
                        var unmarshaller = UserGroupPendingChangesUnmarshaller.Instance;
                        response.PendingChanges = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("ReplicationGroups/member", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.ReplicationGroups.Add(item);
                        continue;
                    }
                    if (context.TestExpression("Status", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Status = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("UserGroupId", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.UserGroupId = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("UserIds/member", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.UserIds.Add(item);
                        continue;
                    }
                }
            }

            return;
        }