001package ca.uhn.fhir.rest.annotation;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2016 University Health Network
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023import java.lang.annotation.ElementType;
024import java.lang.annotation.Retention;
025import java.lang.annotation.RetentionPolicy;
026import java.lang.annotation.Target;
027
028import ca.uhn.fhir.model.api.IResource;
029import ca.uhn.fhir.model.api.TagList;
030import ca.uhn.fhir.model.primitive.IdDt;
031
032/**
033 * RESTful method annotation to be used for the FHIR <a
034 * href="http://hl7.org/implement/standards/fhir/http.html#tags">Tag
035 * Operations</a> which have to do with deleting tags.
036 * <ul>
037 * <li>
038 * To delete tag(s) <b>to the given resource
039 * instance</b>, this annotation should contain a {@link #type()} attribute
040 * specifying the resource type, and the method should have a parameter of type
041 * {@link IdDt} annotated with the {@link IdParam} annotation, as well as 
042 * a parameter of type {@link TagList} which will contain the list of tags
043 * to be deleted.
044 * Note that for a
045 * server implementation, the {@link #type()} annotation is optional if the
046 * method is defined in a <a href=
047 * "http://jamesagnew.github.io/hapi-fhir/doc_rest_server.html#resource_providers"
048 * >resource provider</a>, since the type is implied.</li>
049 * <li>
050 * To delete tag(s) on the server <b>to the given version of the
051 * resource instance</b>, this annotation should contain a {@link #type()}
052 * attribute specifying the resource type, and the method should have a
053 * parameter of type {@link IdDt} annotated with the {@link VersionIdParam}
054 * annotation, <b>and</b> a parameter of type {@link IdDt} annotated with the
055 * {@link IdParam} annotation, as well as 
056 * a parameter of type {@link TagList} which will contain the list of tags
057 * to be deleted.
058 * Note that for a server implementation, the
059 * {@link #type()} annotation is optional if the method is defined in a <a href=
060 * "http://jamesagnew.github.io/hapi-fhir/doc_rest_server.html#resource_providers"
061 * >resource provider</a>, since the type is implied.</li>
062 * </ul>
063 */
064@Target(value= ElementType.METHOD)
065@Retention(value=RetentionPolicy.RUNTIME)
066public @interface DeleteTags {
067
068        /**
069         * If set to a type other than the default (which is {@link IResource}
070         * , this method is expected to return a TagList containing only tags which
071         * are specific to the given resource type.
072         */
073        Class<? extends IResource> type() default IResource.class;
074
075}