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; 018import jakarta.annotation.Nonnull; 019 020/** 021 * Represents an available authority (role or permission) that can be assigned to users 022 */ 023@Schema( 024 name = "AvailableAuthority", 025 description = "An available authority (role or permission) that can be assigned to users") 026public class AvailableAuthorityJson implements IModelJson { 027 028 @JsonProperty("id") 029 @Schema(description = "The unique identifier for this authority", example = "ROLE_SUPERUSER") 030 private String myId; 031 032 @JsonProperty("name") 033 @Schema(description = "The human-readable name for this authority", example = "Superuser") 034 private String myName; 035 036 @JsonProperty("description") 037 @Schema(description = "A detailed description of what this authority grants") 038 private String myDescription; 039 040 @JsonProperty("type") 041 @Schema( 042 description = "The type of authority", 043 allowableValues = {"role", "permission"}) 044 private String myType; 045 046 @JsonProperty("requiresArgument") 047 @Schema(description = "Whether this permission requires an argument") 048 private boolean myRequiresArgument = false; 049 050 @JsonProperty("argumentOptional") 051 @Schema(description = "Whether the argument is optional (only relevant if requiresArgument is true)") 052 private Boolean myArgumentOptional; 053 054 @JsonProperty("argumentFormat") 055 @Schema(description = "The format type for the argument") 056 private String myArgumentFormat; 057 058 @JsonProperty("argumentDescription") 059 @Schema(description = "Human-readable description of what the argument should contain") 060 private String myArgumentDescription; 061 062 /** 063 * Constructor 064 */ 065 public AvailableAuthorityJson() { 066 super(); 067 } 068 069 /** 070 * Constructor 071 */ 072 public AvailableAuthorityJson( 073 @Nonnull String theId, @Nonnull String theName, @Nonnull String theDescription, @Nonnull String theType) { 074 setId(theId); 075 setName(theName); 076 setDescription(theDescription); 077 setType(theType); 078 } 079 080 public String getId() { 081 return myId; 082 } 083 084 public AvailableAuthorityJson setId(String theId) { 085 myId = theId; 086 return this; 087 } 088 089 public String getName() { 090 return myName; 091 } 092 093 public AvailableAuthorityJson setName(String theName) { 094 myName = theName; 095 return this; 096 } 097 098 public String getDescription() { 099 return myDescription; 100 } 101 102 public AvailableAuthorityJson setDescription(String theDescription) { 103 myDescription = theDescription; 104 return this; 105 } 106 107 public String getType() { 108 return myType; 109 } 110 111 public AvailableAuthorityJson setType(String theType) { 112 myType = theType; 113 return this; 114 } 115 116 public boolean isRequiresArgument() { 117 return myRequiresArgument; 118 } 119 120 public AvailableAuthorityJson setRequiresArgument(boolean theRequiresArgument) { 121 myRequiresArgument = theRequiresArgument; 122 return this; 123 } 124 125 public Boolean getArgumentOptional() { 126 return myArgumentOptional; 127 } 128 129 public AvailableAuthorityJson setArgumentOptional(Boolean theArgumentOptional) { 130 myArgumentOptional = theArgumentOptional; 131 return this; 132 } 133 134 public String getArgumentFormat() { 135 return myArgumentFormat; 136 } 137 138 public AvailableAuthorityJson setArgumentFormat(String theArgumentFormat) { 139 myArgumentFormat = theArgumentFormat; 140 return this; 141 } 142 143 public String getArgumentDescription() { 144 return myArgumentDescription; 145 } 146 147 public AvailableAuthorityJson setArgumentDescription(String theArgumentDescription) { 148 myArgumentDescription = theArgumentDescription; 149 return this; 150 } 151}