public DeregisterContainerInstanceResult unmarshall(JsonUnmarshallerContext context)
      throws Exception {
    DeregisterContainerInstanceResult deregisterContainerInstanceResult =
        new DeregisterContainerInstanceResult();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("containerInstance", targetDepth)) {
          context.nextToken();
          deregisterContainerInstanceResult.setContainerInstance(
              ContainerInstanceJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return deregisterContainerInstanceResult;
  }
コード例 #2
0
  public Resource unmarshall(JsonUnmarshallerContext context) throws Exception {
    Resource resource = new Resource();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("name", targetDepth)) {
          context.nextToken();
          resource.setName(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("type", targetDepth)) {
          context.nextToken();
          resource.setType(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("doubleValue", targetDepth)) {
          context.nextToken();
          resource.setDoubleValue(context.getUnmarshaller(Double.class).unmarshall(context));
        }
        if (context.testExpression("longValue", targetDepth)) {
          context.nextToken();
          resource.setLongValue(context.getUnmarshaller(Long.class).unmarshall(context));
        }
        if (context.testExpression("integerValue", targetDepth)) {
          context.nextToken();
          resource.setIntegerValue(context.getUnmarshaller(Integer.class).unmarshall(context));
        }
        if (context.testExpression("stringSetValue", targetDepth)) {
          context.nextToken();
          resource.setStringSetValue(
              new ListUnmarshaller<String>(context.getUnmarshaller(String.class))
                  .unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return resource;
  }
コード例 #3
0
  public VersionInfo unmarshall(JsonUnmarshallerContext context) throws Exception {
    VersionInfo versionInfo = new VersionInfo();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("agentVersion", targetDepth)) {
          context.nextToken();
          versionInfo.setAgentVersion(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("agentHash", targetDepth)) {
          context.nextToken();
          versionInfo.setAgentHash(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("dockerVersion", targetDepth)) {
          context.nextToken();
          versionInfo.setDockerVersion(context.getUnmarshaller(String.class).unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return versionInfo;
  }
コード例 #4
0
  public Ulimit unmarshall(JsonUnmarshallerContext context) throws Exception {
    Ulimit ulimit = new Ulimit();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("name", targetDepth)) {
          context.nextToken();
          ulimit.setName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("softLimit", targetDepth)) {
          context.nextToken();
          ulimit.setSoftLimit(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("hardLimit", targetDepth)) {
          context.nextToken();
          ulimit.setHardLimit(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return ulimit;
  }
コード例 #5
0
  public Service unmarshall(JsonUnmarshallerContext context) throws Exception {
    Service service = new Service();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("serviceArn", targetDepth)) {
          context.nextToken();
          service.setServiceArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("serviceName", targetDepth)) {
          context.nextToken();
          service.setServiceName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("clusterArn", targetDepth)) {
          context.nextToken();
          service.setClusterArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("loadBalancers", targetDepth)) {
          context.nextToken();
          service.setLoadBalancers(
              new ListUnmarshaller<LoadBalancer>(LoadBalancerJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("status", targetDepth)) {
          context.nextToken();
          service.setStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("desiredCount", targetDepth)) {
          context.nextToken();
          service.setDesiredCount(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("runningCount", targetDepth)) {
          context.nextToken();
          service.setRunningCount(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("pendingCount", targetDepth)) {
          context.nextToken();
          service.setPendingCount(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("taskDefinition", targetDepth)) {
          context.nextToken();
          service.setTaskDefinition(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("deployments", targetDepth)) {
          context.nextToken();
          service.setDeployments(
              new ListUnmarshaller<Deployment>(DeploymentJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("roleArn", targetDepth)) {
          context.nextToken();
          service.setRoleArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("events", targetDepth)) {
          context.nextToken();
          service.setEvents(
              new ListUnmarshaller<ServiceEvent>(ServiceEventJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }

      token = context.nextToken();
    }

    return service;
  }
コード例 #6
0
  public ContainerInstance unmarshall(JsonUnmarshallerContext context) throws Exception {
    ContainerInstance containerInstance = new ContainerInstance();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("containerInstanceArn", targetDepth)) {
          context.nextToken();
          containerInstance.setContainerInstanceArn(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("ec2InstanceId", targetDepth)) {
          context.nextToken();
          containerInstance.setEc2InstanceId(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("version", targetDepth)) {
          context.nextToken();
          containerInstance.setVersion(context.getUnmarshaller(Long.class).unmarshall(context));
        }
        if (context.testExpression("versionInfo", targetDepth)) {
          context.nextToken();
          containerInstance.setVersionInfo(
              VersionInfoJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("remainingResources", targetDepth)) {
          context.nextToken();
          containerInstance.setRemainingResources(
              new ListUnmarshaller<Resource>(ResourceJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("registeredResources", targetDepth)) {
          context.nextToken();
          containerInstance.setRegisteredResources(
              new ListUnmarshaller<Resource>(ResourceJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("status", targetDepth)) {
          context.nextToken();
          containerInstance.setStatus(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("agentConnected", targetDepth)) {
          context.nextToken();
          containerInstance.setAgentConnected(
              context.getUnmarshaller(Boolean.class).unmarshall(context));
        }
        if (context.testExpression("runningTasksCount", targetDepth)) {
          context.nextToken();
          containerInstance.setRunningTasksCount(
              context.getUnmarshaller(Integer.class).unmarshall(context));
        }
        if (context.testExpression("pendingTasksCount", targetDepth)) {
          context.nextToken();
          containerInstance.setPendingTasksCount(
              context.getUnmarshaller(Integer.class).unmarshall(context));
        }
        if (context.testExpression("agentUpdateStatus", targetDepth)) {
          context.nextToken();
          containerInstance.setAgentUpdateStatus(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("attributes", targetDepth)) {
          context.nextToken();
          containerInstance.setAttributes(
              new ListUnmarshaller<Attribute>(AttributeJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return containerInstance;
  }