001package ca.cdr.api.model.json;
002
003/*
004 * #%L
005 * Smile CDR - CDR
006 * %%
007 * Copyright (C) 2016 - 2025 Smile CDR, Inc.
008 * %%
009 * All rights reserved.
010 * #L%
011 */
012
013// Created by claude-sonnet-4-20250514
014
015import ca.uhn.fhir.model.api.IModelJson;
016import com.fasterxml.jackson.annotation.JsonProperty;
017import io.swagger.v3.oas.annotations.media.Schema;
018
019import java.util.ArrayList;
020import java.util.List;
021
022/**
023 * Contains lists of available authorities (roles and permissions) that can be assigned to users
024 */
025@Schema(
026                name = "AvailableAuthoritiesList",
027                description = "Lists of available authorities (roles and permissions) that can be assigned to users")
028public class AvailableAuthoritiesListJson implements IModelJson {
029
030        @JsonProperty("roles")
031        @Schema(description = "Available roles that can be assigned to users")
032        private List<AvailableAuthorityJson> myRoles;
033
034        @JsonProperty("permissions")
035        @Schema(description = "Available permissions that can be assigned to users")
036        private List<AvailableAuthorityJson> myPermissions;
037
038        @JsonProperty("customRoles")
039        @Schema(description = "Available custom roles that can be assigned to users")
040        private List<String> myCustomRoles;
041
042        @JsonProperty("appRoles")
043        @Schema(description = "Available application roles that can be assigned to users")
044        private List<String> myApplicationRoles;
045
046        /**
047         * Constructor
048         */
049        public AvailableAuthoritiesListJson() {
050                super();
051        }
052
053        public List<AvailableAuthorityJson> getRoles() {
054                if (myRoles == null) {
055                        myRoles = new ArrayList<>();
056                }
057                return myRoles;
058        }
059
060        public AvailableAuthoritiesListJson setRoles(List<AvailableAuthorityJson> theRoles) {
061                myRoles = theRoles;
062                return this;
063        }
064
065        public List<AvailableAuthorityJson> getPermissions() {
066                if (myPermissions == null) {
067                        myPermissions = new ArrayList<>();
068                }
069                return myPermissions;
070        }
071
072        public AvailableAuthoritiesListJson setPermissions(List<AvailableAuthorityJson> thePermissions) {
073                myPermissions = thePermissions;
074                return this;
075        }
076
077        public List<String> getCustomRoles() {
078                if (myCustomRoles == null) {
079                        myCustomRoles = new ArrayList<>();
080                }
081                return myCustomRoles;
082        }
083
084        public AvailableAuthoritiesListJson setCustomRoles(List<String> theCustomRoles) {
085                myCustomRoles = theCustomRoles;
086                return this;
087        }
088
089        public List<String> getApplicationRoles() {
090                if (myApplicationRoles == null) {
091                        myApplicationRoles = new ArrayList<>();
092                }
093                return myApplicationRoles;
094        }
095
096        public AvailableAuthoritiesListJson setApplicationRoles(List<String> theApplicationRoles) {
097                myApplicationRoles = theApplicationRoles;
098                return this;
099        }
100}