/** * @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(); }
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()); }