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.model.json;
011
012import com.fasterxml.jackson.annotation.JsonProperty;
013import com.fasterxml.jackson.annotation.JsonPropertyOrder;
014import io.swagger.v3.oas.annotations.Parameter;
015import io.swagger.v3.oas.annotations.media.Schema;
016
017import java.util.Set;
018
019/**
020 * Json representation of a RoleEntity
021 */
022@Schema(name = "Role", description = "A role definition")
023@JsonPropertyOrder({"pid", "name", "description"})
024public class RoleJson implements ca.uhn.fhir.model.api.IModelJson {
025
026        /*
027         * ******************************************************************
028         * Note: If you add properties, add them to the copy constructor too!
029         * ******************************************************************
030         */
031
032        @JsonProperty("pid")
033        @Schema(accessMode = Schema.AccessMode.READ_ONLY, description = "The PID (internal ID) for this role")
034        private Long myPid;
035
036        @JsonProperty("name")
037        @Parameter(description = "The role name")
038        private String myName;
039
040        @JsonProperty("description")
041        @Parameter(description = "The role description")
042        private String myDescription;
043
044        @JsonProperty("permissions")
045        @Parameter(description = "The role permissions")
046        private Set<GrantedAuthorityJson> myPermissions;
047
048        /**
049         * Constructor
050         */
051        public RoleJson() {
052                super();
053        }
054
055        /**
056         * /*
057         * ******************************************************************
058         * Note: If you add properties, add them to the copy constructor too!
059         * ******************************************************************
060         */
061        public Long getPid() {
062                return myPid;
063        }
064
065        public void setPid(Long thePid) {
066                myPid = thePid;
067        }
068
069        public String getName() {
070                return myName;
071        }
072
073        public void setName(String theName) {
074                myName = theName;
075        }
076
077        public String getDescription() {
078                return myDescription;
079        }
080
081        public void setDescription(String theDescription) {
082                myDescription = theDescription;
083        }
084
085        public Set<GrantedAuthorityJson> getPermissions() {
086                return myPermissions;
087        }
088
089        public void setPermissions(Set<GrantedAuthorityJson> theRolePermissions) {
090                myPermissions = theRolePermissions;
091        }
092}