public static IpPermissionUnmarshaller GetInstance() { if (instance == null) { instance = new IpPermissionUnmarshaller(); } return(instance); }
public SecurityGroup Unmarshall(XmlUnmarshallerContext context) { SecurityGroup securityGroup = new SecurityGroup(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 1; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("ownerId", targetDepth)) { securityGroup.OwnerId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("groupName", targetDepth)) { securityGroup.GroupName = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("groupId", targetDepth)) { securityGroup.GroupId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("groupDescription", targetDepth)) { securityGroup.Description = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ipPermissions/item", targetDepth)) { securityGroup.IpPermissions.Add(IpPermissionUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("ipPermissionsEgress/item", targetDepth)) { securityGroup.IpPermissionsEgress.Add(IpPermissionUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("vpcId", targetDepth)) { securityGroup.VpcId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("tagSet/item", targetDepth)) { securityGroup.Tags.Add(TagUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(securityGroup); } } return(securityGroup); }