package com.sequenceiq.cloudbreak.structuredevent.event;

import java.io.Serializable;
import java.util.Calendar;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class OperationDetails implements Serializable {

    private StructuredEventType eventType;

    private Long resourceId;

    private String resourceName;

    private String resourceType;

    private Long timestamp;

    private String userIdV3;

    private String userNameV3;

    private String account;

    private String userId;

    private String userName;

    private String cloudbreakId;

    private String cloudbreakVersion;

    private Long workspaceId;

    public OperationDetails() {
    }

    public OperationDetails(StructuredEventType eventType, String resourceType, Long resourceId, String resourceName, String userIdV3,
            String userNameV3, String cloudbreakId, String cloudbreakVersion, Long workspaceId, String account, String userId, String userName) {
        this(Calendar.getInstance().getTimeInMillis(), eventType, resourceType, resourceId, resourceName, userIdV3,
                userNameV3, cloudbreakId, cloudbreakVersion, workspaceId, account, userId, userName);
    }

    public OperationDetails(Long timestamp, StructuredEventType eventType, String resourceType, Long resourceId,
            String resourceName, String userIdV3, String userNameV3, String cloudbreakId,
            String cloudbreakVersion, Long workspaceId, String account, String userId, String userName) {
        this.timestamp = timestamp;
        this.eventType = eventType;
        this.resourceId = resourceId;
        this.resourceName = resourceName;
        this.resourceType = resourceType;
        this.userIdV3 = userIdV3;
        this.userNameV3 = userNameV3;
        this.cloudbreakId = cloudbreakId;
        this.cloudbreakVersion = cloudbreakVersion;
        this.workspaceId = workspaceId;
        this.account = account;
        this.userId = userId;
        this.userName = userName;
    }

    public StructuredEventType getEventType() {
        return eventType;
    }

    public void setEventType(StructuredEventType eventType) {
        this.eventType = eventType;
    }

    public String getResourceType() {
        return resourceType;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }

    public Long getResourceId() {
        return resourceId;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public void setResourceId(Long resourceId) {
        this.resourceId = resourceId;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getUserIdV3() {
        return userIdV3;
    }

    public void setUserIdV3(String userIdV3) {
        this.userIdV3 = userIdV3;
    }

    public String getCloudbreakId() {
        return cloudbreakId;
    }

    public void setCloudbreakId(String cloudbreakId) {
        this.cloudbreakId = cloudbreakId;
    }

    public String getCloudbreakVersion() {
        return cloudbreakVersion;
    }

    public void setCloudbreakVersion(String cloudbreakVersion) {
        this.cloudbreakVersion = cloudbreakVersion;
    }

    public String getUserNameV3() {
        return userNameV3;
    }

    public void setUserNameV3(String userNameV3) {
        this.userNameV3 = userNameV3;
    }

    public Long getWorkspaceId() {
        return workspaceId;
    }

    public void setWorkspaceId(Long workspaceId) {
        this.workspaceId = workspaceId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}

@@ -80,16 +80,146 @@
 izable;%0A
+import java.time.Instant;%0Aimport java.time.ZoneOffset;%0Aimport java.time.ZonedDateTime;%0Aimport java.time.format.DateTimeFormatter;%0A
 import j
@@ -402,16 +402,136 @@
 able %7B%0A%0A
+    private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern(%22MM/dd/yyyy HH:mm:ss Z%22);%0A%0A
     priv
@@ -3155,32 +3155,280 @@
 mestamp;%0A    %7D%0A%0A
+    public String getUTCDateTime() %7B%0A        if (timestamp != null) %7B%0A            return ZonedDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneOffset.UTC).format(DATE_TIME_FORMATTER);%0A        %7D else %7B%0A            return %22%22;%0A        %7D%0A    %7D%0A%0A
     public Strin

CB-3330 Add utc date time but in String format