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