001package ca.cdr.api.model.json;
002
003/*
004 * #%L
005 * Smile CDR - CDR
006 * %%
007 * Copyright (C) 2016 - 2026 Smile CDR, Inc.
008 * %%
009 * All rights reserved.
010 * #L%
011 */
012
013import ca.uhn.fhir.model.api.annotation.ExampleSupplier;
014import com.fasterxml.jackson.annotation.JsonProperty;
015import io.swagger.v3.oas.annotations.media.Schema;
016
017import java.util.ArrayList;
018import java.util.List;
019import java.util.function.Supplier;
020
021@Schema(name = "OAuth2Servers", description = "A collection of OAuth2/OpenID Connect server definitions")
022@ExampleSupplier(OAuth2ServersJson.ExampleSupplier.class)
023public class OAuth2ServersJson implements IModelJson {
024
025        @JsonProperty("servers")
026        private List<OAuth2ServerJson> myServers;
027
028        @JsonProperty(value = "pageIndex")
029        private int myPageIndex;
030
031        @JsonProperty(value = "totalPages")
032        private int myTotalPages;
033
034        public List<OAuth2ServerJson> getServers() {
035                if (myServers == null) {
036                        myServers = new ArrayList<>();
037                }
038                return myServers;
039        }
040
041        public void setServers(List<OAuth2ServerJson> theServers) {
042                myServers = theServers;
043        }
044
045        public int getPageIndex() {
046                return myPageIndex;
047        }
048
049        public void setPageIndex(int thePageIndex) {
050                myPageIndex = thePageIndex;
051        }
052
053        public int getTotalPages() {
054                return myTotalPages;
055        }
056
057        public void setTotalPages(int theTotalPages) {
058                myTotalPages = theTotalPages;
059        }
060
061        public static class ExampleSupplier implements Supplier<OAuth2ServersJson> {
062
063                @Override
064                public OAuth2ServersJson get() {
065                        OAuth2ServersJson retVal = new OAuth2ServersJson();
066
067                        OAuth2ServerJson server = new OAuth2ServerJson();
068                        server.setIssuer("http://idp.example.com");
069                        server.setName("Acme Identity Provider Corp");
070                        server.setTokenIntrospectionClientId("my-client-id");
071                        server.setTokenIntrospectionClientSecret("THIS_IS_A_CLIENT_SECRET");
072                        retVal.getServers().add(server);
073
074                        return retVal;
075                }
076        }
077}