001package ca.uhn.fhir.rest.gclient; 002 003import java.util.List; 004 005import org.hl7.fhir.instance.model.api.IBaseResource; 006 007import ca.uhn.fhir.rest.api.SummaryEnum; 008 009/* 010 * #%L 011 * HAPI FHIR - Core Library 012 * %% 013 * Copyright (C) 2014 - 2017 University Health Network 014 * %% 015 * Licensed under the Apache License, Version 2.0 (the "License"); 016 * you may not use this file except in compliance with the License. 017 * You may obtain a copy of the License at 018 * 019 * http://www.apache.org/licenses/LICENSE-2.0 020 * 021 * Unless required by applicable law or agreed to in writing, software 022 * distributed under the License is distributed on an "AS IS" BASIS, 023 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 024 * See the License for the specific language governing permissions and 025 * limitations under the License. 026 * #L% 027 */ 028 029 030public interface IClientExecutable<T extends IClientExecutable<?,?>, Y> { 031 032 /** 033 * If set to true, the client will log the request and response to the SLF4J logger. This can be useful for 034 * debugging, but is generally not desirable in a production situation. 035 * 036 * @deprecated Use the client logging interceptor to log requests and responses instead. See <a href="http://jamesagnew.github.io/hapi-fhir/doc_rest_client.html#req_resp_logging">here</a> for more information. 037 */ 038 @Deprecated 039 T andLogRequestAndResponse(boolean theLogRequestAndResponse); 040 041 /** 042 * Request that the server return subsetted resources, containing only the elements specified in the given parameters. 043 * For example: <code>subsetElements("name", "identifier")</code> requests that the server only return 044 * the "name" and "identifier" fields in the returned resource, and omit any others. 045 */ 046 T elementsSubset(String... theElements); 047 048 T encodedJson(); 049 050 T encodedXml(); 051 052 Y execute(); 053 054 T prettyPrint(); 055 056 /** 057 * Explicitly specify a custom structure type to attempt to use when parsing the response. This 058 * is useful for invocations where the response is a Bundle/Parameters containing nested resources, 059 * and you want to use specific custom structures for those nested resources. 060 * <p> 061 * See <a href="https://jamesagnew.github.io/hapi-fhir/doc_extensions.html">Profiles and Extensions</a> for more information on using custom structures 062 * </p> 063 */ 064 T preferResponseType(Class<? extends IBaseResource> theType); 065 066 /** 067 * Explicitly specify a list of custom structure types to attempt to use (in order from most to 068 * least preferred) when parsing the response. This 069 * is useful for invocations where the response is a Bundle/Parameters containing nested resources, 070 * and you want to use specific custom structures for those nested resources. 071 * <p> 072 * See <a href="https://jamesagnew.github.io/hapi-fhir/doc_extensions.html">Profiles and Extensions</a> for more information on using custom structures 073 * </p> 074 */ 075 T preferResponseTypes(List<Class<? extends IBaseResource>> theTypes); 076 077 /** 078 * Request that the server modify the response using the <code>_summary</code> param 079 */ 080 T summaryMode(SummaryEnum theSummary); 081 082}