@Test public void allowsNestedOutputItems() { TraitFactory provider = TraitFactory.createServiceFactory(); Node node = Node.objectNode() .withMember("items", Node.from("result.items")) .withMember("inputToken", Node.from("inputToken")) .withMember("outputToken", Node.from("outputToken")); Optional<Trait> trait = provider.createTrait( ShapeId.from("smithy.api#paginated"), ShapeId.from("ns.qux#foo"), node); assertThat(trait.isPresent(), is(true)); assertThat(trait.get(), instanceOf(PaginatedTrait.class)); PaginatedTrait paginatedTrait = (PaginatedTrait) trait.get(); assertThat(paginatedTrait.getItems(), equalTo(Optional.of("result.items"))); }
public Optional<String> getItems() { return Optional.ofNullable(items); }
PaginatedTrait extends AbstractTrait implements ToSmithyBuilder<PaginatedTrait> { public Optional<String> getItems() { return Optional.ofNullable(items); } }
PaginatedTrait extends AbstractTrait implements ToSmithyBuilder<PaginatedTrait> { public Optional<String> getItems() { return Optional.ofNullable(items); } private  PaginatedTrait(Builder builder); }
PaginatedTrait extends AbstractTrait implements ToSmithyBuilder<PaginatedTrait> { public Optional<String> getItems() { return Optional.ofNullable(items); } private  PaginatedTrait(Builder builder); Optional<String> getItems(); Optional<String> getInputToken(); Optional<String> getOutputToken(); Optional<String> getPageSize(); static Optional<MemberShape> resolvePath(
            String path,
            Model model,
            StructureShape shape
    ); PaginatedTrait merge(PaginatedTrait other); @Override Builder toBuilder(); static Builder builder(); }
PaginatedTrait extends AbstractTrait implements ToSmithyBuilder<PaginatedTrait> { public Optional<String> getItems() { return Optional.ofNullable(items); } private  PaginatedTrait(Builder builder); Optional<String> getItems(); Optional<String> getInputToken(); Optional<String> getOutputToken(); Optional<String> getPageSize(); static Optional<MemberShape> resolvePath(
            String path,
            Model model,
            StructureShape shape
    ); PaginatedTrait merge(PaginatedTrait other); @Override Builder toBuilder(); static Builder builder(); static final ShapeId ID; }