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.persistence.megascale;
011
012import ca.cdr.api.model.json.IModelJson;
013import com.fasterxml.jackson.annotation.JsonProperty;
014import io.swagger.v3.oas.annotations.media.Schema;
015import org.apache.commons.lang3.Validate;
016
017/**
018 * Hook method input parameter for the
019 * {@link ca.cdr.api.fhir.interceptor.CdrPointcut#STORAGE_MEGASCALE_PROVIDE_DB_INFO}
020 * pointcut.
021 *
022 * @since 2023.02.R01
023 */
024@Schema(name = "MegaScaleCredentialRequest", description = "Request object for a MegaScale database credential request")
025public class MegaScaleCredentialRequestJson implements IModelJson {
026
027        @JsonProperty("partitionId")
028        @Schema(description = "The numeric ID for the given partition")
029        private int myPartitionId;
030
031        @JsonProperty("partitionName")
032        @Schema(description = "The name for the given partition")
033        private String myPartitionName;
034
035        /**
036         * Constructor
037         */
038        public MegaScaleCredentialRequestJson() {
039                super();
040        }
041
042        /**
043         * Constructor
044         *
045         * @param thePartitionId The partition ID
046         */
047        public MegaScaleCredentialRequestJson(String thePartitionName, int thePartitionId) {
048                setPartitionName(thePartitionName);
049                setPartitionId(thePartitionId);
050        }
051
052        public MegaScaleCredentialRequestJson(int thePartitionId) {
053                setPartitionId(thePartitionId);
054        }
055
056        /**
057         * @return The partition ID associated with this request (will always be a number > 0)
058         */
059        public int getPartitionId() {
060                return myPartitionId;
061        }
062
063        /**
064         * @param thePartitionId The partition ID associated with this request (must be a number > 0)
065         */
066        public void setPartitionId(int thePartitionId) {
067                Validate.isTrue(thePartitionId > 0, "thePartitionId must be > 0");
068                myPartitionId = thePartitionId;
069        }
070
071        public String getPartitionName() {
072                return myPartitionName;
073        }
074
075        public void setPartitionName(String thePartitionName) {
076                this.myPartitionName = thePartitionName;
077        }
078}