001 002package ca.uhn.fhir.rest.api; 003 004/* 005 * #%L 006 * HAPI FHIR - Core Library 007 * %% 008 * Copyright (C) 2014 - 2017 University Health Network 009 * %% 010 * Licensed under the Apache License, Version 2.0 (the "License"); 011 * you may not use this file except in compliance with the License. 012 * You may obtain a copy of the License at 013 * 014 * http://www.apache.org/licenses/LICENSE-2.0 015 * 016 * Unless required by applicable law or agreed to in writing, software 017 * distributed under the License is distributed on an "AS IS" BASIS, 018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 019 * See the License for the specific language governing permissions and 020 * limitations under the License. 021 * #L% 022 */ 023 024import java.util.HashMap; 025import java.util.Map; 026 027import ca.uhn.fhir.util.CoverageIgnore; 028 029@CoverageIgnore 030public enum RestOperationTypeEnum { 031 032 ADD_TAGS("add-tags"), 033 034 DELETE_TAGS("delete-tags"), 035 036 GET_TAGS("get-tags"), 037 038 GET_PAGE("get-page"), 039 040 /** 041 * <b> 042 * Use this value with caution, this may 043 * change as the GraphQL interface matures 044 * </b> 045 */ 046 GRAPHQL_REQUEST("graphql-request"), 047 048 /** 049 * E.g. $everything, $validate, etc. 050 */ 051 EXTENDED_OPERATION_SERVER("extended-operation-server"), 052 053 /** 054 * E.g. $everything, $validate, etc. 055 */ 056 EXTENDED_OPERATION_TYPE("extended-operation-type"), 057 058 /** 059 * E.g. $everything, $validate, etc. 060 */ 061 EXTENDED_OPERATION_INSTANCE("extended-operation-instance"), 062 063 /** 064 * Code Value: <b>create</b> 065 */ 066 CREATE("create"), 067 068 /** 069 * Code Value: <b>delete</b> 070 */ 071 DELETE("delete"), 072 073 /** 074 * Code Value: <b>history-instance</b> 075 */ 076 HISTORY_INSTANCE("history-instance"), 077 078 /** 079 * Code Value: <b>history-system</b> 080 */ 081 HISTORY_SYSTEM("history-system"), 082 083 /** 084 * Code Value: <b>history-type</b> 085 */ 086 HISTORY_TYPE("history-type"), 087 088 /** 089 * Code Value: <b>read</b> 090 */ 091 READ("read"), 092 093 /** 094 * Code Value: <b>search-system</b> 095 */ 096 SEARCH_SYSTEM("search-system"), 097 098 /** 099 * 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}