001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2026 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.model.json;
011
012import ca.uhn.fhir.model.api.IModelJson;
013import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
014import com.fasterxml.jackson.annotation.JsonProperty;
015import io.swagger.v3.oas.annotations.media.Schema;
016
017@Schema(
018                name = "OpenIdTokenResponse",
019                description =
020                                "This object represents the response from a client-credentials request to an Identity Provider's token endpoint.")
021@JsonIgnoreProperties(ignoreUnknown = true)
022public class OpenIdTokenResponseJson implements IModelJson {
023
024        /* CHECKSTYLE.OFF: RegexpSingleLine - these properties are spec compliant and should not be changed */
025
026        /**
027         * REQUIRED
028         * The token we've requested
029         */
030        @JsonProperty("access_token")
031        private String myAccessToken;
032
033        /**
034         * REQUIRED
035         * The token type ("bearer", "mac")...
036         * We should only ever receive "bearer" (as that's all we support).
037         */
038        @JsonProperty("token_type")
039        private String myTokenType;
040
041        /**
042         * RECOMMENDED
043         * The lifetime (in seconds) of the access_token.
044         * MAy or may not be included.
045         */
046        @JsonProperty("expires_in")
047        private Long myExpiration;
048
049        /**
050         * OPTIONAL
051         * Only provided if this was a refresh_token request.
052         */
053        @JsonProperty("refresh_token")
054        private String myRefreshToken;
055
056        /* CHECKSTYLE.ON: RegexpSingleLine */
057
058        public String getAccessToken() {
059                return myAccessToken;
060        }
061
062        public void setAccessToken(String theAccessToken) {
063                myAccessToken = theAccessToken;
064        }
065
066        public String getTokenType() {
067                return myTokenType;
068        }
069
070        public void setTokenType(String theTokenType) {
071                myTokenType = theTokenType;
072        }
073
074        public Long getExpiration() {
075                return myExpiration;
076        }
077
078        public void setExpiration(Long theExpiration) {
079                myExpiration = theExpiration;
080        }
081
082        public String getRefreshToken() {
083                return myRefreshToken;
084        }
085
086        public void setRefreshToken(String theRefreshToken) {
087                myRefreshToken = theRefreshToken;
088        }
089}
090
091/**
092 * @deprecated Use ca.cdr.api.model.json.OpenIdTokenResponseJson
093 */
094@Deprecated(since = "2025.11.R01", forRemoval = true)
095class OpenIdTokenResponse extends OpenIdTokenResponseJson {}