/** * @param json A JSON-bindable data structure * @return An immutable value type * @deprecated Do not use this method directly, it exists only for the <em>Jackson</em>-binding infrastructure */ @Deprecated @JsonCreator(mode = JsonCreator.Mode.DELEGATING) static CreateTaskRequest fromJson(Json json) { CreateTaskRequest.Builder builder = CreateTaskRequest.builder(); if (json.applicationId != null) { builder.applicationId(json.applicationId); } if (json.command != null) { builder.command(json.command); } if (json.diskInMb != null) { builder.diskInMb(json.diskInMb); } if (json.dropletId != null) { builder.dropletId(json.dropletId); } if (json.memoryInMb != null) { builder.memoryInMb(json.memoryInMb); } if (json.name != null) { builder.name(json.name); } return builder.build(); }
/** * Copy abstract value type {@code _CreateTaskRequest} instance into builder. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ final Builder from(_CreateTaskRequest instance) { Objects.requireNonNull(instance, "instance"); applicationId(instance.getApplicationId()); command(instance.getCommand()); Integer diskInMbValue = instance.getDiskInMb(); if (diskInMbValue != null) { diskInMb(diskInMbValue); } String dropletIdValue = instance.getDropletId(); if (dropletIdValue != null) { dropletId(dropletIdValue); } Integer memoryInMbValue = instance.getMemoryInMb(); if (memoryInMbValue != null) { memoryInMb(memoryInMbValue); } String nameValue = instance.getName(); if (nameValue != null) { name(nameValue); } return this; }
private Mono<CreateTaskResponse> requestCreateTask(String applicationId, String command, int memory, String name) { return this.client.tasks() .create(CreateTaskRequest.builder() .applicationId(applicationId) .command(command) .memoryInMb(memory) .name(name) .build()); }
private static Mono<CreateTaskResponse> requestCreateTask(CloudFoundryClient cloudFoundryClient, String applicationId, RunApplicationTaskRequest request) { return cloudFoundryClient.tasks() .create(CreateTaskRequest.builder() .applicationId(applicationId) .command(request.getCommand()) .diskInMb(request.getDisk()) .memoryInMb(request.getMemory()) .name(request.getTaskName()) .build()); }