docs: public CreateClusterResponse createCluster(CreateClusterRequest request) {
          checkNotNull(request, "request should not be null.");
          checkStringNotEmpty(request.getImageType(), "The imageType should not be null or empty string.");
          checkStringNotEmpty(request.getImageVersion(), "The imageVersion should not be null or empty string.");
          checkNotNull(request.getInstanceGroups(), "The instanceGroups should not be null.");
  
          StringWriter writer = new StringWriter();
          try {
              JsonGenerator jsonGenerator = JsonUtils.jsonGeneratorOf(writer);
              jsonGenerator.writeStartObject();
              jsonGenerator.writeStringField("imageType", request.getImageType());
              jsonGenerator.writeStringField("imageVersion", request.getImageVersion());
              jsonGenerator.writeArrayFieldStart("instanceGroups");
              for (InstanceGroupConfig instanceGroup : request.getInstanceGroups()) {
                  jsonGenerator.writeStartObject();
                  if (instanceGroup.getName() != null) {
                      jsonGenerator.writeStringField("name", instanceGroup.getName());
                  }
                  jsonGenerator.writeStringField("type", instanceGroup.getType());
                  jsonGenerator.writeStringField("instanceType", instanceGroup.getInstanceType());
                  jsonGenerator.writeNumberField("instanceCount", instanceGroup.getInstanceCount());
                  jsonGenerator.writeEndObject();
              }
              jsonGenerator.writeEndArray();
              if (request.getName() != null) {
                  jsonGenerator.writeStringField("name", request.getName());
              }
              if (request.getLogUri() != null) {
                  jsonGenerator.writeStringField("logUri", request.getLogUri());
              }
              jsonGenerator.writeBooleanField("autoTerminate", request.getAutoTerminate());
  
              if (request.getApplications() != null) {
                  jsonGenerator.writeArrayFieldStart("applications");
                  for (ApplicationConfig application : request.getApplications()) {
                      jsonGenerator.writeStartObject();
                      jsonGenerator.writeStringField("name", application.getName());
                      jsonGenerator.writeStringField("version", application.getVersion());
                      if (application.getProperties() != null) {
                          jsonGenerator.writeObjectFieldStart("properties");
                          for (Map.Entry<String, Object> entry : application.getProperties().entrySet()) {
                              jsonGenerator.writeObjectField(entry.getKey(), entry.getValue());
                          }
                          jsonGenerator.writeEndObject();
                      }
                      jsonGenerator.writeEndObject();
                  }
                  jsonGenerator.writeEndArray();
              }
  
              if (request.getSteps() != null) {
                  jsonGenerator.writeArrayFieldStart("steps");
                  for (StepConfig step : request.getSteps()) {
                      jsonGenerator.writeStartObject();
                      if (step.getName() != null) {
                          jsonGenerator.writeStringField("name", step.getName());
                      }
                      jsonGenerator.writeStringField("type", step.getType());
                      jsonGenerator.writeStringField("actionOnFailure", step.getActionOnFailure());
                      jsonGenerator.writeObjectFieldStart("properties");
                      for (Map.Entry<String, String> entry : step.getProperties().entrySet()) {
                          jsonGenerator.writeStringField(entry.getKey(), entry.getValue());
                      }
                      jsonGenerator.writeEndObject();
                      jsonGenerator.writeEndObject();
                  }
                  jsonGenerator.writeEndArray();
              }
  
              jsonGenerator.writeEndObject();
              jsonGenerator.close();
          } catch (IOException e) {
              throw new BceClientException("Fail to generate json", e);
          }
  
          byte[] json = null;
          try {
              json = writer.toString().getBytes(DEFAULT_ENCODING);
          } catch (UnsupportedEncodingException e) {
              throw new BceClientException("Fail to get UTF-8 bytes", e);
          }
  
          InternalRequest internalRequest = this.createRequest(request, HttpMethodName.POST, CLUSTER);
          internalRequest.addHeader(Headers.CONTENT_LENGTH, String.valueOf(json.length));
          internalRequest.addHeader(Headers.CONTENT_TYPE, "application/json");
          internalRequest.setContent(RestartableInputStream.wrap(json));
  
          if (request.getClientToken() != null) {
              internalRequest.addParameter("clientToken", request.getClientToken());
          }
  
          return this.invokeHttpClient(internalRequest, CreateClusterResponse.class);
      }