001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2025 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.consent;
011
012import ca.cdr.api.model.json.UserSessionDetailsJson;
013
014import java.util.HashMap;
015import java.util.Map;
016
017/**
018 * A consent fixed policy request containing:
019 * <ol>
020 *     <li>The policy name which should be mapped to a new instance of an {@link ca.uhn.fhir.rest.server.interceptor.consent.IConsentService}</li>
021 *     <li>The {@link UserSessionDetailsJson} of the user making the request.</li>
022 *     <li>A list of parameters that can be used to specify additional information used to build the
023 *     {@link ca.uhn.fhir.rest.server.interceptor.consent.IConsentService}.</li>
024 * </ol>
025 */
026public class ConsentFixedPolicyRequest {
027        private final String myPolicyName;
028        private final UserSessionDetailsJson myUserSessionDetailsJson;
029        private final Map<String, String> myParameters;
030
031        public ConsentFixedPolicyRequest(String thePolicyName, UserSessionDetailsJson theUserSessionDetails) {
032                myPolicyName = thePolicyName;
033                myUserSessionDetailsJson = theUserSessionDetails;
034                myParameters = new HashMap<>();
035        }
036
037        public String getPolicyName() {
038                return myPolicyName;
039        }
040
041        public UserSessionDetailsJson getUserSessionDetailsJson() {
042                return myUserSessionDetailsJson;
043        }
044
045        public void addParameters(String theKey, String theValue) {
046                myParameters.put(theKey, theValue);
047        }
048
049        public Map<String, String> getParameters() {
050                return myParameters;
051        }
052}