001package ca.uhn.fhir.rest.gclient;
002
003import org.hl7.fhir.instance.model.api.IBase;
004
005/*
006 * #%L
007 * HAPI FHIR - Core Library
008 * %%
009 * Copyright (C) 2014 - 2023 Smile CDR, Inc.
010 * %%
011 * Licensed under the Apache License, Version 2.0 (the "License");
012 * you may not use this file except in compliance with the License.
013 * You may obtain a copy of the License at
014 *
015 *      http://www.apache.org/licenses/LICENSE-2.0
016 *
017 * Unless required by applicable law or agreed to in writing, software
018 * distributed under the License is distributed on an "AS IS" BASIS,
019 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
020 * See the License for the specific language governing permissions and
021 * limitations under the License.
022 * #L%
023 */
024
025import org.hl7.fhir.instance.model.api.IBaseParameters;
026
027import ca.uhn.fhir.model.api.IQueryParameterType;
028
029public interface IOperationUntyped {
030
031        /**
032         * Use the given parameters resource as the input to the operation
033         * 
034         * @param theParameters The parameters to use as input. May also be <code>null</code> if the operation
035         * does not require any input parameters.
036         */
037        <T extends IBaseParameters> IOperationUntypedWithInputAndPartialOutput<T> withParameters(T theParameters);
038
039        /**
040         * The operation does not require any input parameters
041         * 
042         * @param theOutputParameterType The type to use for the output parameters (this should be set to
043         * <code>Parameters.class</code> drawn from the version of the FHIR structures you are using)
044         */
045        <T extends IBaseParameters> IOperationUntypedWithInput<T> withNoParameters(Class<T> theOutputParameterType);
046
047        /**
048         * Use chained method calls to construct a Parameters input. This form is a convenience
049         * in order to allow simple method chaining to be used to build up a parameters
050         * resource for the input of an operation without needing to manually construct one.
051         * <p>
052         * A sample invocation of this class could look like:<br/>
053         * <pre>Bundle bundle = client.operation()
054         *   .onInstance(new IdType("Patient/A161443"))
055         *   .named("everything")
056         *   .withParameter(Parameters.class, "_count", new IntegerType(50))
057         *   .useHttpGet()
058         *   .returnResourceType(Bundle.class)
059         *   .execute();
060         * </pre>
061         * </p>
062         * 
063         * @param theParameterType The type to use for the output parameters (this should be set to
064         * <code>Parameters.class</code> drawn from the version of the FHIR structures you are using)
065         * @param theName The first parameter name
066         * @param theValue The first parameter value
067         */
068        <T extends IBaseParameters> IOperationUntypedWithInputAndPartialOutput<T> withParameter(Class<T> theParameterType, String theName, IBase theValue);
069
070        /**
071         * Use chained method calls to construct a Parameters input. This form is a convenience
072         * in order to allow simple method chaining to be used to build up a parameters
073         * resource for the input of an operation without needing to manually construct one.
074         * 
075         * @param theParameterType The type to use for the output parameters (this should be set to
076         * <code>Parameters.class</code> drawn from the version of the FHIR structures you are using)
077         * @param theName The first parameter name
078         * @param theValue The first parameter value
079         */
080        <T extends IBaseParameters> IOperationUntypedWithInputAndPartialOutput<T> withSearchParameter(Class<T> theParameterType, String theName, IQueryParameterType theValue);
081
082}