View Javadoc
1   
2   package ca.uhn.fhir.rest.api;
3   
4   /*
5    * #%L
6    * HAPI FHIR - Core Library
7    * %%
8    * Copyright (C) 2014 - 2018 University Health Network
9    * %%
10   * Licensed under the Apache License, Version 2.0 (the "License");
11   * you may not use this file except in compliance with the License.
12   * You may obtain a copy of the License at
13   * 
14   *      http://www.apache.org/licenses/LICENSE-2.0
15   * 
16   * Unless required by applicable law or agreed to in writing, software
17   * distributed under the License is distributed on an "AS IS" BASIS,
18   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19   * See the License for the specific language governing permissions and
20   * limitations under the License.
21   * #L%
22   */
23  
24  import java.util.HashMap;
25  import java.util.Map;
26  
27  import ca.uhn.fhir.util.CoverageIgnore;
28  
29  @CoverageIgnore
30  public enum RestOperationTypeEnum {
31  
32  	ADD_TAGS("add-tags"),
33  
34  	DELETE_TAGS("delete-tags"),
35  
36  	GET_TAGS("get-tags"),
37  
38  	GET_PAGE("get-page"),
39  
40  	/**
41  	 * <b>
42  	 * Use this value with caution, this may
43  	 * change as the GraphQL interface matures
44  	 * </b>
45  	 */
46  	GRAPHQL_REQUEST("graphql-request"),
47  
48  	/**
49  	 * E.g. $everything, $validate, etc.
50  	 */
51  	EXTENDED_OPERATION_SERVER("extended-operation-server"),
52  
53  	/**
54  	 * E.g. $everything, $validate, etc.
55  	 */
56  	EXTENDED_OPERATION_TYPE("extended-operation-type"),
57  
58  	/**
59  	 * E.g. $everything, $validate, etc.
60  	 */
61  	EXTENDED_OPERATION_INSTANCE("extended-operation-instance"),
62  
63  	/**
64  	 * Code Value: <b>create</b>
65  	 */
66  	CREATE("create"),
67  
68  	/**
69  	 * Code Value: <b>delete</b>
70  	 */
71  	DELETE("delete"),
72  
73  	/**
74  	 * Code Value: <b>history-instance</b>
75  	 */
76  	HISTORY_INSTANCE("history-instance"),
77  
78  	/**
79  	 * Code Value: <b>history-system</b>
80  	 */
81  	HISTORY_SYSTEM("history-system"),
82  
83  	/**
84  	 * Code Value: <b>history-type</b>
85  	 */
86  	HISTORY_TYPE("history-type"),
87  
88  	/**
89  	 * Code Value: <b>read</b>
90  	 */
91  	READ("read"),
92  
93  	/**
94  	 * Code Value: <b>search-system</b>
95  	 */
96  	SEARCH_SYSTEM("search-system"),
97  
98  	/**
99  	 * Code Value: <b>search-type</b>
100 	 */
101 	SEARCH_TYPE("search-type"),
102 
103 	/**
104 	 * Code Value: <b>transaction</b>
105 	 */
106 	TRANSACTION("transaction"),
107 
108 	/**
109 	 * Code Value: <b>update</b>
110 	 */
111 	UPDATE("update"),
112 
113 	/**
114 	 * Code Value: <b>validate</b>
115 	 */
116 	VALIDATE("validate"),
117 
118 	/**
119 	 * Code Value: <b>vread</b>
120 	 */
121 	VREAD("vread"),
122 
123 	/**
124 	 * Load the server's metadata
125 	 */
126 	METADATA("metadata"), 
127 	
128 	/**
129 	 * $meta-add extended operation
130 	 */
131 	META_ADD("$meta-add"),
132 
133 	/**
134 	 * $meta-add extended operation
135 	 */
136 	META("$meta"),
137 
138 	/**
139 	 * $meta-delete extended operation
140 	 */
141 	META_DELETE("$meta-delete"), 
142 	
143 	/**
144 	 * Patch operation
145 	 */
146 	PATCH("patch"),
147 
148 	;
149 
150 	private static Map<String, RestOperationTypeEnum> CODE_TO_ENUM = new HashMap<String, RestOperationTypeEnum>();
151 
152 	/**
153 	 * Identifier for this Value Set: http://hl7.org/fhir/vs/type-restful-operation
154 	 */
155 	public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/type-restful-operation";
156 
157 	/**
158 	 * Name for this Value Set: RestfulOperationType
159 	 */
160 	public static final String VALUESET_NAME = "RestfulOperationType";
161 
162 	static {
163 		for (RestOperationTypeEnum next : RestOperationTypeEnum.values()) {
164 			CODE_TO_ENUM.put(next.getCode(), next);
165 		}
166 	}
167 
168 	private final String myCode;
169 
170 	/**
171 	 * Constructor
172 	 */
173 	RestOperationTypeEnum(String theCode) {
174 		myCode = theCode;
175 	}
176 
177 	/**
178 	 * Returns the enumerated value associated with this code
179 	 */
180 	public RestOperationTypeEnum forCode(String theCode) {
181 		RestOperationTypeEnum retVal = CODE_TO_ENUM.get(theCode);
182 		return retVal;
183 	}
184 
185 	/**
186 	 * Returns the code associated with this enumerated value
187 	 */
188 	public String getCode() {
189 		return myCode;
190 	}
191 
192 }