/** * Copy method to populate the builder with values from the given instance. * @return this builder instance */ public Builder copy(ListResourceTypesResponse o) { opcNextPage(o.getOpcNextPage()); opcRequestId(o.getOpcRequestId()); items(o.getItems()); return this; } }
/** * Copy method to populate the builder with values from the given instance. * @return this builder instance */ public Builder copy(SearchResourcesResponse o) { opcNextPage(o.getOpcNextPage()); opcRequestId(o.getOpcRequestId()); resourceSummaryCollection(o.getResourceSummaryCollection()); return this; } }
/** * Copy method to populate the builder with values from the given instance. * @return this builder instance */ public Builder copy(GetResourceTypeResponse o) { opcRequestId(o.getOpcRequestId()); resourceType(o.getResourceType()); return this; } }
private static void freetextSearch(ResourceSearch client, String text) { SearchResourcesRequest req = SearchResourcesRequest.builder() .searchDetails(FreeTextSearchDetails.builder().text(text).build()) .build(); SearchResourcesResponse resp = client.searchResources(req); for (ResourceSummary resource : resp.getResourceSummaryCollection().getItems()) { System.out.println(resource); } }
private static void getTypeDetails(ResourceSearch client, String typeName) { GetResourceTypeRequest getTypeRequest = GetResourceTypeRequest.builder().name(typeName).build(); GetResourceTypeResponse getTypeResp = client.getResourceType(getTypeRequest); System.out.println(getTypeResp.getResourceType()); }
private static void listTypes(ResourceSearch client) { ListResourceTypesRequest listTypesRequest = ListResourceTypesRequest.builder().build(); ListResourceTypesResponse listTypesResp = client.listResourceTypes(listTypesRequest); for (ResourceType type : listTypesResp.getItems()) { System.out.println("Resource : " + type.getName()); } }
private static void structuredQuerySearch(ResourceSearch client) { SearchResourcesRequest req = SearchResourcesRequest.builder() .searchDetails( StructuredSearchDetails.builder() .matchingContextType( SearchDetails.MatchingContextType.Highlights) .query("query all resources") .build()) .build(); SearchResourcesResponse resp = client.searchResources(req); for (ResourceSummary resource : resp.getResourceSummaryCollection().getItems()) { System.out.println(resource); } } }