001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2024 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.fhirgw.json;
011
012import com.fasterxml.jackson.annotation.JsonProperty;
013import io.swagger.v3.oas.annotations.media.Schema;
014import org.apache.commons.lang3.Validate;
015
016import java.util.ArrayList;
017import java.util.List;
018
019@Schema(
020                name = "GatewayOperationRoute",
021                description = "Defines a Smile CDR FHIR Gateway route that services FHIR operations")
022public class GatewayOperationRouteJson extends BaseRouteJson<GatewayOperationRouteJson> {
023        @JsonProperty("operations")
024        @Schema(description = "The operations that this route applies to")
025        private List<GatewayOperationJson> myOperations;
026
027        public GatewayOperationRouteJson addOperation(GatewayOperationJson theOperation) {
028                Validate.notNull(theOperation);
029                getOperations().add(theOperation);
030                return this;
031        }
032
033        public List<GatewayOperationJson> getOperations() {
034                if (myOperations == null) {
035                        myOperations = new ArrayList<>();
036                }
037                return myOperations;
038        }
039
040        public GatewayOperationRouteJson setOperations(List<GatewayOperationJson> theOperations) {
041                myOperations = theOperations;
042                return this;
043        }
044}