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 com.fasterxml.jackson.annotation.JsonProperty;
014import com.fasterxml.jackson.annotation.JsonPropertyOrder;
015import io.swagger.v3.oas.annotations.media.Schema;
016import tools.jackson.databind.annotation.JsonDeserialize;
017import tools.jackson.databind.annotation.JsonSerialize;
018
019import java.util.ArrayList;
020import java.util.Date;
021import java.util.List;
022
023@JsonPropertyOrder({
024        "from",
025        "to",
026        "userId",
027        "username",
028        "auditAction",
029        "transactionGuid",
030        "targetResourceIds",
031        "pageIndex",
032        "pageSize",
033        "totalRecords",
034        "audit-events"
035})
036public class AuditEventsJson implements IModelJson {
037
038        @Schema(description = "The list of audit events for the current page.")
039        @JsonProperty("audit-events")
040        private List<AuditEventJson> myAuditEvents;
041
042        @Schema(description = "The start of the date range filter applied to the query.")
043        @JsonProperty("from")
044        @JsonSerialize(using = JsonDateSerializer.class)
045        @JsonDeserialize(using = JsonDateDeserializer.class)
046        private Date myAuditFromDate;
047
048        @Schema(description = "The end of the date range filter applied to the query.")
049        @JsonProperty("to")
050        @JsonSerialize(using = JsonDateSerializer.class)
051        @JsonDeserialize(using = JsonDateDeserializer.class)
052        private Date myAuditToDate;
053
054        @Schema(description = "The user ID filter applied to the query.")
055        @JsonProperty("userId")
056        private Long myUserId;
057
058        @Schema(description = "The username filter applied to the query.")
059        @JsonProperty("username")
060        private String myUsername;
061
062        @Schema(description = "The audit action type filter applied to the query.")
063        @JsonProperty("auditAction")
064        private String myAuditAction;
065
066        @Schema(description = "The transaction GUID filter applied to the query.")
067        @JsonProperty("transactionGuid")
068        private String myTransactionGuid;
069
070        @Schema(description = "The target resource ID filters applied to the query.")
071        @JsonProperty("targetResourceIds")
072        private List<String> myTargetResourceIds;
073
074        @Schema(description = "The number of records per page.")
075        @JsonProperty("pageSize")
076        private int myAuditPageSize;
077
078        @Schema(description = "The zero-based page index.")
079        @JsonProperty("pageIndex")
080        private int myAuditPageIndex;
081
082        @Schema(description = "Total number of audit log records matching the query.")
083        @JsonProperty("totalRecords")
084        private long myTotalRecords;
085
086        public Date getAuditFromDate() {
087                return myAuditFromDate;
088        }
089
090        public void setAuditFromDate(Date theAuditFromDate) {
091                myAuditFromDate = theAuditFromDate;
092        }
093
094        public Date getAuditToDate() {
095                return myAuditToDate;
096        }
097
098        public void setAuditToDate(Date theAuditToDate) {
099                myAuditToDate = theAuditToDate;
100        }
101
102        public int getAuditPageSize() {
103                return myAuditPageSize;
104        }
105
106        public void setAuditPageSize(int theAuditPageSize) {
107                myAuditPageSize = theAuditPageSize;
108        }
109
110        public int getAuditPageIndex() {
111                return myAuditPageIndex;
112        }
113
114        public void setAuditPageIndex(int theAuditPageIndex) {
115                myAuditPageIndex = theAuditPageIndex;
116        }
117
118        public Long getUserId() {
119                return myUserId;
120        }
121
122        public void setUserId(Long theUserId) {
123                myUserId = theUserId;
124        }
125
126        public long getTotalRecords() {
127                return myTotalRecords;
128        }
129
130        public void setTotalRecords(long theTotalRecords) {
131                myTotalRecords = theTotalRecords;
132        }
133
134        public String getUsername() {
135                return myUsername;
136        }
137
138        public void setUsername(String theUsername) {
139                myUsername = theUsername;
140        }
141
142        public String getAuditAction() {
143                return myAuditAction;
144        }
145
146        public void setAuditAction(String theAuditAction) {
147                myAuditAction = theAuditAction;
148        }
149
150        public String getTransactionGuid() {
151                return myTransactionGuid;
152        }
153
154        public void setTransactionGuid(String theTransactionGuid) {
155                myTransactionGuid = theTransactionGuid;
156        }
157
158        public List<String> getTargetResourceIds() {
159                return myTargetResourceIds;
160        }
161
162        public void setTargetResourceIds(List<String> theTargetResourceIds) {
163                myTargetResourceIds = theTargetResourceIds;
164        }
165
166        public List<AuditEventJson> getAuditEvents() {
167                if (myAuditEvents == null) {
168                        myAuditEvents = new ArrayList<>();
169                }
170                return myAuditEvents;
171        }
172}