diff --git a/sdk/java-sdk-spring/src/it/java/com/example/wiring/SpringSdkIntegrationTest.java b/sdk/java-sdk-spring/src/it/java/com/example/wiring/SpringSdkIntegrationTest.java index 2665e4d644..3eb9e84876 100644 --- a/sdk/java-sdk-spring/src/it/java/com/example/wiring/SpringSdkIntegrationTest.java +++ b/sdk/java-sdk-spring/src/it/java/com/example/wiring/SpringSdkIntegrationTest.java @@ -27,6 +27,7 @@ import com.example.wiring.valueentities.customer.CustomerEntity; import com.example.wiring.valueentities.headers.ForwardHeadersValueEntity; import com.example.wiring.valueentities.user.AssignedCounterEntity; +import com.example.wiring.valueentities.user.CompoundIdCounterEntity; import com.example.wiring.valueentities.user.User; import com.example.wiring.valueentities.user.UserEntity; import com.example.wiring.valueentities.user.UserSideEffect; @@ -70,6 +71,7 @@ import static java.time.temporal.ChronoUnit.SECONDS; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.awaitility.Awaitility.await; @SpringBootTest(classes = Main.class) @@ -503,6 +505,35 @@ public void verifyFindUsersByNameStreaming() { new IsEqual(2)); } + @Test + public void shouldInvokeValueEntityWithCompoundKey() { + //given + execute(componentClient.forValueEntity("1", "2") + .call(CompoundIdCounterEntity::set).params(10)); + + //when + Integer result = execute(componentClient.forValueEntity("1", "2") + .call(CompoundIdCounterEntity::get)); + + //then + assertThat(result).isEqualTo(10); + } + + @Test + public void shouldFailInvokeValueEntityWithWrongCompoundKey() { + assertThatThrownBy(() -> { + execute(componentClient.forValueEntity("1") + .call(CompoundIdCounterEntity::set).params(10)); + }).isInstanceOf(IllegalStateException.class) + .hasMessageContaining("Expecting 2 instead of 1 when calling [set] method. Provide values for [id_part_1, id_part_2] ids."); + + assertThatThrownBy(() -> { + execute(componentClient.forValueEntity("1", "1", "3") + .call(CompoundIdCounterEntity::set).params(10)); + }).isInstanceOf(IllegalStateException.class) + .hasMessageContaining("Expecting 2 instead of 3 when calling [set] method. Provide values for [id_part_1, id_part_2] ids."); + } + @Test public void verifyMultiTableViewForUserCounters() { diff --git a/sdk/java-sdk-spring/src/it/java/com/example/wiring/valueentities/user/CompoundIdCounterEntity.java b/sdk/java-sdk-spring/src/it/java/com/example/wiring/valueentities/user/CompoundIdCounterEntity.java new file mode 100644 index 0000000000..4059981795 --- /dev/null +++ b/sdk/java-sdk-spring/src/it/java/com/example/wiring/valueentities/user/CompoundIdCounterEntity.java @@ -0,0 +1,49 @@ +/* + * Copyright 2021 Lightbend Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.wiring.valueentities.user; + +import kalix.javasdk.annotations.Id; +import kalix.javasdk.annotations.TypeId; +import kalix.javasdk.valueentity.ValueEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +@TypeId("compound-id-counter") +@Id({"id_part_1", "id_part_2"}) +@RequestMapping("/compound-id-counter") +public class CompoundIdCounterEntity extends ValueEntity { + + + @Override + public Integer emptyState() { + return 0; + } + + @PostMapping("/{id_part_1}/{id_part_2}/set/{value}") + public Effect set(@PathVariable Integer value) { + System.out.println(commandContext().entityId()); + return effects().updateState(value).thenReply("OK"); + } + + @GetMapping("/{id_part_1}/{id_part_2}") + public Effect get() { + System.out.println(commandContext().entityId()); + return effects().reply(currentState()); + } +} diff --git a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ActionCallBuilder.java b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ActionCallBuilder.java index 36257cad9f..1e5ff81e5a 100644 --- a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ActionCallBuilder.java +++ b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ActionCallBuilder.java @@ -43,7 +43,7 @@ import kalix.javasdk.action.Action; import kalix.spring.KalixClient; -import java.util.Optional; +import java.util.List; public class ActionCallBuilder { @@ -57,153 +57,153 @@ public ActionCallBuilder(KalixClient kalixClient) { * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public DeferredCall call(Function> methodRef) { - return ComponentCall.noParams(kalixClient, methodRef, Optional.empty()); + return ComponentCall.noParams(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall call(Function2> methodRef) { - return new ComponentCall<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall2 call(Function3> methodRef) { - return new ComponentCall2<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall2<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall3 call(Function4> methodRef) { - return new ComponentCall3<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall3<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall4 call(Function5> methodRef) { - return new ComponentCall4<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall4<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall5 call(Function6> methodRef) { - return new ComponentCall5<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall5<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall6 call(Function7> methodRef) { - return new ComponentCall6<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall6<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall7 call(Function8> methodRef) { - return new ComponentCall7<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall7<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall8 call(Function9> methodRef) { - return new ComponentCall8<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall8<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall9 call(Function10> methodRef) { - return new ComponentCall9<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall9<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall10 call(Function11> methodRef) { - return new ComponentCall10<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall10<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall11 call(Function12> methodRef) { - return new ComponentCall11<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall11<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall12 call(Function13> methodRef) { - return new ComponentCall12<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall12<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall13 call(Function14> methodRef) { - return new ComponentCall13<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall13<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall14 call(Function15> methodRef) { - return new ComponentCall14<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall14<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall15 call(Function16> methodRef) { - return new ComponentCall15<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall15<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall16 call(Function17> methodRef) { - return new ComponentCall16<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall16<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall17 call(Function18> methodRef) { - return new ComponentCall17<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall17<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall18 call(Function19> methodRef) { - return new ComponentCall18<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall18<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall19 call(Function20> methodRef) { - return new ComponentCall19<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall19<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall20 call(Function21> methodRef) { - return new ComponentCall20<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall20<>(kalixClient, methodRef, List.of()); } /** * Pass in an Action method reference annotated as a REST endpoint, e.g. MyAction::create */ public ComponentCall21 call(Function22> methodRef) { - return new ComponentCall21<>(kalixClient, methodRef, Optional.empty()); + return new ComponentCall21<>(kalixClient, methodRef, List.of()); } } diff --git a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ComponentClient.java b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ComponentClient.java index 3d14b772c7..f6b292f6f3 100644 --- a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ComponentClient.java +++ b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ComponentClient.java @@ -18,6 +18,8 @@ import kalix.spring.KalixClient; +import java.util.List; + /** * Utility to send requests to other Kalix components by composing a DeferredCall. To compose a call: * 1. select component type (and pass id if necessary) @@ -67,6 +69,15 @@ public ValueEntityCallBuilder forValueEntity(String valueEntityId) { return new ValueEntityCallBuilder(kalixClient, valueEntityId); } + /** + * Select ValueEntity as a call target component. + * + * @param valueEntityIds - compound entity ids used to create a call. + */ + public ValueEntityCallBuilder forValueEntity(String... valueEntityIds) { + return new ValueEntityCallBuilder(kalixClient, List.of(valueEntityIds)); + } + /** * Select EventSourcedEntity as a call target component. *

@@ -85,6 +96,15 @@ public EventSourcedEntityCallBuilder forEventSourcedEntity(String eventSourcedEn return new EventSourcedEntityCallBuilder(kalixClient, eventSourcedEntityId); } + /** + * Select EventSourcedEntity as a call target component. + * + * @param eventSourcedEntityIds - compound entity ids used to create a call. + */ + public EventSourcedEntityCallBuilder forEventSourcedEntity(String... eventSourcedEntityIds) { + return new EventSourcedEntityCallBuilder(kalixClient, List.of(eventSourcedEntityIds)); + } + /** * Select Workflow as a call target component. *

@@ -103,6 +123,15 @@ public WorkflowCallBuilder forWorkflow(String workflowId) { return new WorkflowCallBuilder(kalixClient, workflowId); } + /** + * Select Workflow as a call target component. + * + * @param workflowIds - compound workflow ids used to create a call. + */ + public WorkflowCallBuilder forWorkflow(String... workflowIds) { + return new WorkflowCallBuilder(kalixClient, List.of(workflowIds)); + } + /** * Select View as a call target component. */ diff --git a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/EventSourcedEntityCallBuilder.java b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/EventSourcedEntityCallBuilder.java index 78accc53c5..bf05ca61fe 100644 --- a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/EventSourcedEntityCallBuilder.java +++ b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/EventSourcedEntityCallBuilder.java @@ -43,174 +43,177 @@ import kalix.javasdk.eventsourcedentity.EventSourcedEntity; import kalix.spring.KalixClient; -import java.util.Optional; +import java.util.List; public class EventSourcedEntityCallBuilder { private final KalixClient kalixClient; - private final Optional entityId; + private final List entityIds; - public EventSourcedEntityCallBuilder(KalixClient kalixClient, String entityId) { + public EventSourcedEntityCallBuilder(KalixClient kalixClient, List entityIds) { this.kalixClient = kalixClient; - this.entityId = Optional.of(entityId); + this.entityIds = entityIds; + } + + public EventSourcedEntityCallBuilder(KalixClient kalixClient, String entityId) { + this(kalixClient, List.of(entityId)); } public EventSourcedEntityCallBuilder(KalixClient kalixClient) { - this.kalixClient = kalixClient; - this.entityId = Optional.empty(); + this(kalixClient, List.of()); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public DeferredCall call(Function> methodRef) { - return ComponentCall.noParams(kalixClient, methodRef, entityId); + return ComponentCall.noParams(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall call(Function2> methodRef) { - return new ComponentCall<>(kalixClient, methodRef, entityId); + return new ComponentCall<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall2 call(Function3> methodRef) { - return new ComponentCall2<>(kalixClient, methodRef, entityId); + return new ComponentCall2<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall3 call(Function4> methodRef) { - return new ComponentCall3<>(kalixClient, methodRef, entityId); + return new ComponentCall3<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall4 call(Function5> methodRef) { - return new ComponentCall4<>(kalixClient, methodRef, entityId); + return new ComponentCall4<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall5 call(Function6> methodRef) { - return new ComponentCall5<>(kalixClient, methodRef, entityId); + return new ComponentCall5<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall6 call(Function7> methodRef) { - return new ComponentCall6<>(kalixClient, methodRef, entityId); + return new ComponentCall6<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall7 call(Function8> methodRef) { - return new ComponentCall7<>(kalixClient, methodRef, entityId); + return new ComponentCall7<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall8 call(Function9> methodRef) { - return new ComponentCall8<>(kalixClient, methodRef, entityId); + return new ComponentCall8<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall9 call(Function10> methodRef) { - return new ComponentCall9<>(kalixClient, methodRef, entityId); + return new ComponentCall9<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall10 call(Function11> methodRef) { - return new ComponentCall10<>(kalixClient, methodRef, entityId); + return new ComponentCall10<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall11 call(Function12> methodRef) { - return new ComponentCall11<>(kalixClient, methodRef, entityId); + return new ComponentCall11<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall12 call(Function13> methodRef) { - return new ComponentCall12<>(kalixClient, methodRef, entityId); + return new ComponentCall12<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall13 call(Function14> methodRef) { - return new ComponentCall13<>(kalixClient, methodRef, entityId); + return new ComponentCall13<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall14 call(Function15> methodRef) { - return new ComponentCall14<>(kalixClient, methodRef, entityId); + return new ComponentCall14<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall15 call(Function16> methodRef) { - return new ComponentCall15<>(kalixClient, methodRef, entityId); + return new ComponentCall15<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall16 call(Function17> methodRef) { - return new ComponentCall16<>(kalixClient, methodRef, entityId); + return new ComponentCall16<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall17 call(Function18> methodRef) { - return new ComponentCall17<>(kalixClient, methodRef, entityId); + return new ComponentCall17<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall18 call(Function19> methodRef) { - return new ComponentCall18<>(kalixClient, methodRef, entityId); + return new ComponentCall18<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall19 call(Function20> methodRef) { - return new ComponentCall19<>(kalixClient, methodRef, entityId); + return new ComponentCall19<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall20 call(Function21> methodRef) { - return new ComponentCall20<>(kalixClient, methodRef, entityId); + return new ComponentCall20<>(kalixClient, methodRef, entityIds); } /** * Pass in an Event Sourced Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall21 call(Function22> methodRef) { - return new ComponentCall21<>(kalixClient, methodRef, entityId); + return new ComponentCall21<>(kalixClient, methodRef, entityIds); } } diff --git a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ValueEntityCallBuilder.java b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ValueEntityCallBuilder.java index 420839d8d7..3e3504fb74 100644 --- a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ValueEntityCallBuilder.java +++ b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ValueEntityCallBuilder.java @@ -43,174 +43,177 @@ import kalix.javasdk.valueentity.ValueEntity; import kalix.spring.KalixClient; -import java.util.Optional; +import java.util.List; public class ValueEntityCallBuilder { private final KalixClient kalixClient; - private final Optional entityId; + private final List entityIds; - public ValueEntityCallBuilder(KalixClient kalixClient, String entityId) { + public ValueEntityCallBuilder(KalixClient kalixClient, List entityIds) { this.kalixClient = kalixClient; - this.entityId = Optional.of(entityId); + this.entityIds = entityIds; + } + + public ValueEntityCallBuilder(KalixClient kalixClient, String entityId) { + this(kalixClient, List.of(entityId)); } public ValueEntityCallBuilder(KalixClient kalixClient) { - this.kalixClient = kalixClient; - this.entityId = Optional.empty(); + this(kalixClient, List.of()); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public DeferredCall call(Function> methodRef) { - return ComponentCall.noParams(kalixClient, methodRef, entityId); + return ComponentCall.noParams(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall call(Function2> methodRef) { - return new ComponentCall<>(kalixClient, methodRef, entityId); + return new ComponentCall<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall2 call(Function3> methodRef) { - return new ComponentCall2<>(kalixClient, methodRef, entityId); + return new ComponentCall2<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall3 call(Function4> methodRef) { - return new ComponentCall3<>(kalixClient, methodRef, entityId); + return new ComponentCall3<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall4 call(Function5> methodRef) { - return new ComponentCall4<>(kalixClient, methodRef, entityId); + return new ComponentCall4<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall5 call(Function6> methodRef) { - return new ComponentCall5<>(kalixClient, methodRef, entityId); + return new ComponentCall5<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall6 call(Function7> methodRef) { - return new ComponentCall6<>(kalixClient, methodRef, entityId); + return new ComponentCall6<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall7 call(Function8> methodRef) { - return new ComponentCall7<>(kalixClient, methodRef, entityId); + return new ComponentCall7<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall8 call(Function9> methodRef) { - return new ComponentCall8<>(kalixClient, methodRef, entityId); + return new ComponentCall8<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall9 call(Function10> methodRef) { - return new ComponentCall9<>(kalixClient, methodRef, entityId); + return new ComponentCall9<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall10 call(Function11> methodRef) { - return new ComponentCall10<>(kalixClient, methodRef, entityId); + return new ComponentCall10<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall11 call(Function12> methodRef) { - return new ComponentCall11<>(kalixClient, methodRef, entityId); + return new ComponentCall11<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall12 call(Function13> methodRef) { - return new ComponentCall12<>(kalixClient, methodRef, entityId); + return new ComponentCall12<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall13 call(Function14> methodRef) { - return new ComponentCall13<>(kalixClient, methodRef, entityId); + return new ComponentCall13<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall14 call(Function15> methodRef) { - return new ComponentCall14<>(kalixClient, methodRef, entityId); + return new ComponentCall14<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall15 call(Function16> methodRef) { - return new ComponentCall15<>(kalixClient, methodRef, entityId); + return new ComponentCall15<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall16 call(Function17> methodRef) { - return new ComponentCall16<>(kalixClient, methodRef, entityId); + return new ComponentCall16<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall17 call(Function18> methodRef) { - return new ComponentCall17<>(kalixClient, methodRef, entityId); + return new ComponentCall17<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall18 call(Function19> methodRef) { - return new ComponentCall18<>(kalixClient, methodRef, entityId); + return new ComponentCall18<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall19 call(Function20> methodRef) { - return new ComponentCall19<>(kalixClient, methodRef, entityId); + return new ComponentCall19<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall20 call(Function21> methodRef) { - return new ComponentCall20<>(kalixClient, methodRef, entityId); + return new ComponentCall20<>(kalixClient, methodRef, entityIds); } /** * Pass in a Value Entity method reference annotated as a REST endpoint, e.g. UserEntity::create */ public ComponentCall21 call(Function22> methodRef) { - return new ComponentCall21<>(kalixClient, methodRef, entityId); + return new ComponentCall21<>(kalixClient, methodRef, entityIds); } } diff --git a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ViewCallBuilder.java b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ViewCallBuilder.java index 333654a07b..85a087a8bd 100644 --- a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ViewCallBuilder.java +++ b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/ViewCallBuilder.java @@ -45,7 +45,7 @@ import kalix.spring.KalixClient; import java.lang.reflect.Method; -import java.util.Optional; +import java.util.List; public class ViewCallBuilder { @@ -61,7 +61,7 @@ public ViewCallBuilder(KalixClient kalixClient) { public DeferredCall call(Function methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return ComponentCall.noParams(kalixClient, method, Optional.empty()); + return ComponentCall.noParams(kalixClient, method, List.of()); } /** @@ -70,7 +70,7 @@ public DeferredCall call(Function methodRef) { public ComponentCall call(Function2 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall<>(kalixClient, method, Optional.empty()); + return new ComponentCall<>(kalixClient, method, List.of()); } /** @@ -79,7 +79,7 @@ public ComponentCall call(Function2 methodRef) { public ComponentCall2 call(Function3 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall2<>(kalixClient, method, Optional.empty()); + return new ComponentCall2<>(kalixClient, method, List.of()); } /** @@ -88,7 +88,7 @@ public ComponentCall2 call(Function3 met public ComponentCall3 call(Function4 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall3<>(kalixClient, method, Optional.empty()); + return new ComponentCall3<>(kalixClient, method, List.of()); } /** @@ -97,7 +97,7 @@ public ComponentCall3 call(Function4 ComponentCall4 call(Function5 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall4<>(kalixClient, method, Optional.empty()); + return new ComponentCall4<>(kalixClient, method, List.of()); } /** @@ -106,7 +106,7 @@ public ComponentCall4 call(Function5 ComponentCall5 call(Function6 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall5<>(kalixClient, method, Optional.empty()); + return new ComponentCall5<>(kalixClient, method, List.of()); } /** @@ -115,7 +115,7 @@ public ComponentCall5 call(Fun public ComponentCall6 call(Function7 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall6<>(kalixClient, method, Optional.empty()); + return new ComponentCall6<>(kalixClient, method, List.of()); } /** @@ -124,7 +124,7 @@ public ComponentCall6 public ComponentCall7 call(Function8 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall7<>(kalixClient, method, Optional.empty()); + return new ComponentCall7<>(kalixClient, method, List.of()); } /** @@ -133,7 +133,7 @@ public ComponentCall7 ComponentCall8 call(Function9 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall8<>(kalixClient, method, Optional.empty()); + return new ComponentCall8<>(kalixClient, method, List.of()); } /** @@ -142,7 +142,7 @@ public ComponentCall8 ComponentCall9 call(Function10 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall9<>(kalixClient, method, Optional.empty()); + return new ComponentCall9<>(kalixClient, method, List.of()); } /** @@ -151,7 +151,7 @@ public ComponentCall9 ComponentCall10 call(Function11 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall10<>(kalixClient, method, Optional.empty()); + return new ComponentCall10<>(kalixClient, method, List.of()); } /** @@ -160,7 +160,7 @@ public ComponentCall10 ComponentCall11 call(Function12 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall11<>(kalixClient, method, Optional.empty()); + return new ComponentCall11<>(kalixClient, method, List.of()); } /** @@ -169,7 +169,7 @@ public ComponentCall11 ComponentCall12 call(Function13 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall12<>(kalixClient, method, Optional.empty()); + return new ComponentCall12<>(kalixClient, method, List.of()); } /** @@ -178,7 +178,7 @@ public ComponentCall12 public ComponentCall13 call(Function14 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall13<>(kalixClient, method, Optional.empty()); + return new ComponentCall13<>(kalixClient, method, List.of()); } /** @@ -187,7 +187,7 @@ public ComponentC public ComponentCall14 call(Function15 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall14<>(kalixClient, method, Optional.empty()); + return new ComponentCall14<>(kalixClient, method, List.of()); } /** @@ -196,7 +196,7 @@ public Compo public ComponentCall15 call(Function16 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall15<>(kalixClient, method, Optional.empty()); + return new ComponentCall15<>(kalixClient, method, List.of()); } /** @@ -205,7 +205,7 @@ public public ComponentCall16 call(Function17 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall16<>(kalixClient, method, Optional.empty()); + return new ComponentCall16<>(kalixClient, method, List.of()); } /** @@ -214,7 +214,7 @@ public ComponentCall17 call(Function18 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall17<>(kalixClient, method, Optional.empty()); + return new ComponentCall17<>(kalixClient, method, List.of()); } /** @@ -223,7 +223,7 @@ public ComponentCall18 call(Function19 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall18<>(kalixClient, method, Optional.empty()); + return new ComponentCall18<>(kalixClient, method, List.of()); } /** @@ -232,7 +232,7 @@ public ComponentCall19 call(Function20 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall19<>(kalixClient, method, Optional.empty()); + return new ComponentCall19<>(kalixClient, method, List.of()); } /** @@ -241,7 +241,7 @@ public ComponentCall20 call(Function21 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall20<>(kalixClient, method, Optional.empty()); + return new ComponentCall20<>(kalixClient, method, List.of()); } /** @@ -250,6 +250,6 @@ public ComponentCall21 call(Function22 methodRef) { Method method = MethodRefResolver.resolveMethodRef(methodRef); ViewCallValidator.validate(method); - return new ComponentCall21<>(kalixClient, method, Optional.empty()); + return new ComponentCall21<>(kalixClient, method, List.of()); } } diff --git a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/WorkflowCallBuilder.java b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/WorkflowCallBuilder.java index 12c6ca70aa..edf8cd8fe4 100644 --- a/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/WorkflowCallBuilder.java +++ b/sdk/java-sdk-spring/src/main/java/kalix/javasdk/client/WorkflowCallBuilder.java @@ -43,174 +43,177 @@ import kalix.javasdk.workflow.Workflow; import kalix.spring.KalixClient; -import java.util.Optional; +import java.util.List; public class WorkflowCallBuilder { private final KalixClient kalixClient; - private final Optional workflowId; + private final List workflowIds; - public WorkflowCallBuilder(KalixClient kalixClient, String workflowId) { + public WorkflowCallBuilder(KalixClient kalixClient, List workflowIds) { this.kalixClient = kalixClient; - this.workflowId = Optional.of(workflowId); + this.workflowIds = workflowIds; + } + + public WorkflowCallBuilder(KalixClient kalixClient, String workflowId) { + this(kalixClient, List.of(workflowId)); } public WorkflowCallBuilder(KalixClient kalixClient) { - this.kalixClient = kalixClient; - this.workflowId = Optional.empty(); + this(kalixClient, List.of()); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public DeferredCall call(Function> methodRef) { - return ComponentCall.noParams(kalixClient, methodRef, workflowId); + return ComponentCall.noParams(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall call(Function2> methodRef) { - return new ComponentCall<>(kalixClient, methodRef, workflowId); + return new ComponentCall<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall2 call(Function3> methodRef) { - return new ComponentCall2<>(kalixClient, methodRef, workflowId); + return new ComponentCall2<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall3 call(Function4> methodRef) { - return new ComponentCall3<>(kalixClient, methodRef, workflowId); + return new ComponentCall3<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall4 call(Function5> methodRef) { - return new ComponentCall4<>(kalixClient, methodRef, workflowId); + return new ComponentCall4<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall5 call(Function6> methodRef) { - return new ComponentCall5<>(kalixClient, methodRef, workflowId); + return new ComponentCall5<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall6 call(Function7> methodRef) { - return new ComponentCall6<>(kalixClient, methodRef, workflowId); + return new ComponentCall6<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall7 call(Function8> methodRef) { - return new ComponentCall7<>(kalixClient, methodRef, workflowId); + return new ComponentCall7<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall8 call(Function9> methodRef) { - return new ComponentCall8<>(kalixClient, methodRef, workflowId); + return new ComponentCall8<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall9 call(Function10> methodRef) { - return new ComponentCall9<>(kalixClient, methodRef, workflowId); + return new ComponentCall9<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall10 call(Function11> methodRef) { - return new ComponentCall10<>(kalixClient, methodRef, workflowId); + return new ComponentCall10<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall11 call(Function12> methodRef) { - return new ComponentCall11<>(kalixClient, methodRef, workflowId); + return new ComponentCall11<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall12 call(Function13> methodRef) { - return new ComponentCall12<>(kalixClient, methodRef, workflowId); + return new ComponentCall12<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall13 call(Function14> methodRef) { - return new ComponentCall13<>(kalixClient, methodRef, workflowId); + return new ComponentCall13<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall14 call(Function15> methodRef) { - return new ComponentCall14<>(kalixClient, methodRef, workflowId); + return new ComponentCall14<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall15 call(Function16> methodRef) { - return new ComponentCall15<>(kalixClient, methodRef, workflowId); + return new ComponentCall15<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall16 call(Function17> methodRef) { - return new ComponentCall16<>(kalixClient, methodRef, workflowId); + return new ComponentCall16<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall17 call(Function18> methodRef) { - return new ComponentCall17<>(kalixClient, methodRef, workflowId); + return new ComponentCall17<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall18 call(Function19> methodRef) { - return new ComponentCall18<>(kalixClient, methodRef, workflowId); + return new ComponentCall18<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall19 call(Function20> methodRef) { - return new ComponentCall19<>(kalixClient, methodRef, workflowId); + return new ComponentCall19<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall20 call(Function21> methodRef) { - return new ComponentCall20<>(kalixClient, methodRef, workflowId); + return new ComponentCall20<>(kalixClient, methodRef, workflowIds); } /** * Pass in a Workflow method reference annotated as a REST endpoint, e.g. MyWorkflow::start */ public ComponentCall21 call(Function22> methodRef) { - return new ComponentCall21<>(kalixClient, methodRef, workflowId); + return new ComponentCall21<>(kalixClient, methodRef, workflowIds); } } diff --git a/sdk/java-sdk-spring/src/main/scala/kalix/javasdk/client/ComponentCall.scala b/sdk/java-sdk-spring/src/main/scala/kalix/javasdk/client/ComponentCall.scala index 89aac98e52..ee4cddc176 100644 --- a/sdk/java-sdk-spring/src/main/scala/kalix/javasdk/client/ComponentCall.scala +++ b/sdk/java-sdk-spring/src/main/scala/kalix/javasdk/client/ComponentCall.scala @@ -19,9 +19,8 @@ package kalix.javasdk.client import java.lang.reflect.Method import java.lang.reflect.ParameterizedType import java.util -import java.util.Optional -import scala.jdk.OptionConverters._ +import scala.jdk.CollectionConverters._ import akka.http.scaladsl.model.HttpMethods import com.google.protobuf.any.Any @@ -45,40 +44,40 @@ import kalix.spring.impl.RestKalixClientImpl import org.springframework.web.bind.annotation.RequestMethod import reactor.core.publisher.Flux -final class ComponentCall[A1, R](kalixClient: KalixClient, method: Method, id: Optional[String]) { +final class ComponentCall[A1, R](kalixClient: KalixClient, method: Method, ids: util.List[String]) { - def this(kalixClient: KalixClient, lambda: scala.Any, id: Optional[String]) { - this(kalixClient, MethodRefResolver.resolveMethodRef(lambda), id) + def this(kalixClient: KalixClient, lambda: scala.Any, ids: util.List[String]) { + this(kalixClient, MethodRefResolver.resolveMethodRef(lambda), ids) } def params(a1: A1): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1), kalixClient, method, id.toScala) + ComponentCall.invoke(Seq(a1), kalixClient, method, ids.asScala.toList) } } object ComponentCall { - def noParams[R](kalixClient: KalixClient, lambda: scala.Any, id: Optional[String]): DeferredCall[Any, R] = { - invoke(Seq.empty, kalixClient, MethodRefResolver.resolveMethodRef(lambda), id.toScala) + def noParams[R](kalixClient: KalixClient, lambda: scala.Any, ids: util.List[String]): DeferredCall[Any, R] = { + invoke(Seq.empty, kalixClient, MethodRefResolver.resolveMethodRef(lambda), ids.asScala.toList) } - def noParams[R](kalixClient: KalixClient, method: Method, id: Optional[String]): DeferredCall[Any, R] = { - invoke(Seq.empty, kalixClient, method, id.toScala) + def noParams[R](kalixClient: KalixClient, method: Method, ids: util.List[String]): DeferredCall[Any, R] = { + invoke(Seq.empty, kalixClient, method, ids.asScala.toList) } private[client] def invoke[R]( params: Seq[scala.Any], kalixClient: KalixClient, lambda: scala.Any, - id: Option[String]): DeferredCall[Any, R] = { - invoke(params, kalixClient, MethodRefResolver.resolveMethodRef(lambda), id) + ids: List[String]): DeferredCall[Any, R] = { + invoke(params, kalixClient, MethodRefResolver.resolveMethodRef(lambda), ids) } private[client] def invoke[R]( params: Seq[scala.Any], kalixClient: KalixClient, method: Method, - id: Option[String]): DeferredCall[Any, R] = { + ids: List[String]): DeferredCall[Any, R] = { val declaringClass = method.getDeclaringClass @@ -101,7 +100,7 @@ object ComponentCall { val pathVariables: Map[String, ?] = restMethod.params .collect { case p: PathParameter => p } .map(p => (p.name, getPathParam(params, p.param.getParameterIndex, p.name))) - .toMap ++ idVariables(id, method) + .toMap ++ idVariables(ids, method) val bodyIndex = restMethod.params.collect { case p: BodyParameter => p }.map(_.param.getParameterIndex).headOption val body = bodyIndex.map(params(_)) @@ -168,7 +167,7 @@ object ComponentCall { throw new IllegalStateException(s"HTTP $requestMethod not supported when calling $pathTemplate") } - private def idVariables(id: Option[String], method: Method): Map[String, String] = { + private def idVariables(ids: List[String], method: Method): Map[String, String] = { val declaringClass = method.getDeclaringClass if (declaringClass.getAnnotation(classOf[EntityType]) == null && @@ -179,16 +178,22 @@ object ComponentCall { Map.empty } else { val idNames = IdExtractor.extractIds(declaringClass, method) - id match { - case Some(value) => Map(idNames.head -> value) //TODO handle compound keys - case None => throw new IllegalStateException(s"Id is missing while calling ${method.getName}") + if (ids.isEmpty) { + throw new IllegalStateException(s"Id is missing when calling [${method.getName}] method") + } else if (ids.size != idNames.size) { + throw new IllegalStateException( + s"Expecting ${idNames.size} instead of ${ids.size} when calling [${method.getName}] method. Provide values for [${idNames.mkString(", ")}] ids.") + } else if (idNames.size == 1) { //single key + Map(idNames.head -> ids.head) + } else { //compound key + idNames.zip(ids).toMap } } } } // format: off -final class ComponentCall2[A1, A2, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall2[A1, A2, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -197,10 +202,10 @@ final class ComponentCall2[A1, A2, R](kalixClient: KalixClient, lambda: scala.An * used to build this DeferredCall. */ def params(a1: A1, a2: A2): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall3[A1, A2, A3, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall3[A1, A2, A3, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -209,10 +214,10 @@ final class ComponentCall3[A1, A2, A3, R](kalixClient: KalixClient, lambda: scal * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall4[A1, A2, A3, A4, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall4[A1, A2, A3, A4, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -221,10 +226,10 @@ final class ComponentCall4[A1, A2, A3, A4, R](kalixClient: KalixClient, lambda: * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall5[A1, A2, A3, A4, A5, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall5[A1, A2, A3, A4, A5, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -233,10 +238,10 @@ final class ComponentCall5[A1, A2, A3, A4, A5, R](kalixClient: KalixClient, lamb * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall6[A1, A2, A3, A4, A5, A6, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall6[A1, A2, A3, A4, A5, A6, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -245,10 +250,10 @@ final class ComponentCall6[A1, A2, A3, A4, A5, A6, R](kalixClient: KalixClient, * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall7[A1, A2, A3, A4, A5, A6, A7, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall7[A1, A2, A3, A4, A5, A6, A7, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -257,10 +262,10 @@ final class ComponentCall7[A1, A2, A3, A4, A5, A6, A7, R](kalixClient: KalixClie * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall8[A1, A2, A3, A4, A5, A6, A7, A8, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall8[A1, A2, A3, A4, A5, A6, A7, A8, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -269,10 +274,10 @@ final class ComponentCall8[A1, A2, A3, A4, A5, A6, A7, A8, R](kalixClient: Kalix * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall9[A1, A2, A3, A4, A5, A6, A7, A8, A9, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall9[A1, A2, A3, A4, A5, A6, A7, A8, A9, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -281,10 +286,10 @@ final class ComponentCall9[A1, A2, A3, A4, A5, A6, A7, A8, A9, R](kalixClient: K * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -293,10 +298,10 @@ final class ComponentCall10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, R](kalixCli * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall11[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall11[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -305,10 +310,10 @@ final class ComponentCall11[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, R](kal * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall12[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall12[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -317,10 +322,10 @@ final class ComponentCall12[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, R * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall13[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall13[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -329,10 +334,10 @@ final class ComponentCall13[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12, a13: A13): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall14[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall14[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -341,10 +346,10 @@ final class ComponentCall14[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12, a13: A13, a14: A14): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall15[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall15[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -353,10 +358,10 @@ final class ComponentCall15[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12, a13: A13, a14: A14, a15: A15): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall16[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall16[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -365,10 +370,10 @@ final class ComponentCall16[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12, a13: A13, a14: A14, a15: A15, a16: A16): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall17[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall17[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -377,10 +382,10 @@ final class ComponentCall17[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12, a13: A13, a14: A14, a15: A15, a16: A16, a17: A17): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall18[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall18[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -389,10 +394,10 @@ final class ComponentCall18[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12, a13: A13, a14: A14, a15: A15, a16: A16, a17: A17, a18: A18): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall19[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall19[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -401,10 +406,10 @@ final class ComponentCall19[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12, a13: A13, a14: A14, a15: A15, a16: A16, a17: A17, a18: A18, a19: A19): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall20[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall20[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -413,10 +418,10 @@ final class ComponentCall20[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12, a13: A13, a14: A14, a15: A15, a16: A16, a17: A17, a18: A18, a19: A19, a20: A20): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20), kalixClient, lambda, entityIds.asScala.toList) } } -final class ComponentCall21[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, R](kalixClient: KalixClient, lambda: scala.Any, entityId: Optional[String]) { +final class ComponentCall21[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, R](kalixClient: KalixClient, lambda: scala.Any, entityIds: util.List[String]) { /** * Pass in the parameters that are required to execute this call. @@ -425,7 +430,7 @@ final class ComponentCall21[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A * used to build this DeferredCall. */ def params(a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8, a9: A9, a10: A10, a11: A11, a12: A12, a13: A13, a14: A14, a15: A15, a16: A16, a17: A17, a18: A18, a19: A19, a20: A20, a21: A21): DeferredCall[Any, R] = { - ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21), kalixClient, lambda, entityId.toScala) + ComponentCall.invoke(Seq(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21), kalixClient, lambda, entityIds.asScala.toList) } } // format: on