All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.securityinsights.fluent.models.SubmissionMailEntityProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-09.

The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.securityinsights.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.Map;
import java.util.UUID;

/**
 * Submission mail entity property bag.
 */
@Immutable
public final class SubmissionMailEntityProperties extends EntityCommonProperties {
    /*
     * The network message id of email to which submission belongs
     */
    private UUID networkMessageId;

    /*
     * The submission id
     */
    private UUID submissionId;

    /*
     * The submitter
     */
    private String submitter;

    /*
     * The submission date
     */
    private OffsetDateTime submissionDate;

    /*
     * The Time stamp when the message is received (Mail)
     */
    private OffsetDateTime timestamp;

    /*
     * The recipient of the mail
     */
    private String recipient;

    /*
     * The sender of the mail
     */
    private String sender;

    /*
     * The sender's IP
     */
    private String senderIp;

    /*
     * The subject of submission mail
     */
    private String subject;

    /*
     * The submission type for the given instance. This maps to Junk, Phish, Malware or NotJunk.
     */
    private String reportType;

    /*
     * The graph item display name which is a short humanly readable description of the graph item instance. This
     * property is optional and might be system generated.
     */
    private String friendlyName;

    /*
     * A bag of custom fields that should be part of the entity and will be presented to the user.
     */
    private Map additionalData;

    /**
     * Creates an instance of SubmissionMailEntityProperties class.
     */
    public SubmissionMailEntityProperties() {
    }

    /**
     * Get the networkMessageId property: The network message id of email to which submission belongs.
     * 
     * @return the networkMessageId value.
     */
    public UUID networkMessageId() {
        return this.networkMessageId;
    }

    /**
     * Get the submissionId property: The submission id.
     * 
     * @return the submissionId value.
     */
    public UUID submissionId() {
        return this.submissionId;
    }

    /**
     * Get the submitter property: The submitter.
     * 
     * @return the submitter value.
     */
    public String submitter() {
        return this.submitter;
    }

    /**
     * Get the submissionDate property: The submission date.
     * 
     * @return the submissionDate value.
     */
    public OffsetDateTime submissionDate() {
        return this.submissionDate;
    }

    /**
     * Get the timestamp property: The Time stamp when the message is received (Mail).
     * 
     * @return the timestamp value.
     */
    public OffsetDateTime timestamp() {
        return this.timestamp;
    }

    /**
     * Get the recipient property: The recipient of the mail.
     * 
     * @return the recipient value.
     */
    public String recipient() {
        return this.recipient;
    }

    /**
     * Get the sender property: The sender of the mail.
     * 
     * @return the sender value.
     */
    public String sender() {
        return this.sender;
    }

    /**
     * Get the senderIp property: The sender's IP.
     * 
     * @return the senderIp value.
     */
    public String senderIp() {
        return this.senderIp;
    }

    /**
     * Get the subject property: The subject of submission mail.
     * 
     * @return the subject value.
     */
    public String subject() {
        return this.subject;
    }

    /**
     * Get the reportType property: The submission type for the given instance. This maps to Junk, Phish, Malware or
     * NotJunk.
     * 
     * @return the reportType value.
     */
    public String reportType() {
        return this.reportType;
    }

    /**
     * Get the friendlyName property: The graph item display name which is a short humanly readable description of the
     * graph item instance. This property is optional and might be system generated.
     * 
     * @return the friendlyName value.
     */
    @Override
    public String friendlyName() {
        return this.friendlyName;
    }

    /**
     * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented
     * to the user.
     * 
     * @return the additionalData value.
     */
    @Override
    public Map additionalData() {
        return this.additionalData;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of SubmissionMailEntityProperties from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of SubmissionMailEntityProperties if the JsonReader was pointing to an instance of it, or
     * null if it was pointing to JSON null.
     * @throws IOException If an error occurs while reading the SubmissionMailEntityProperties.
     */
    public static SubmissionMailEntityProperties fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            SubmissionMailEntityProperties deserializedSubmissionMailEntityProperties
                = new SubmissionMailEntityProperties();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("additionalData".equals(fieldName)) {
                    Map additionalData = reader.readMap(reader1 -> reader1.readUntyped());
                    deserializedSubmissionMailEntityProperties.additionalData = additionalData;
                } else if ("friendlyName".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.friendlyName = reader.getString();
                } else if ("networkMessageId".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.networkMessageId
                        = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
                } else if ("submissionId".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.submissionId
                        = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
                } else if ("submitter".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.submitter = reader.getString();
                } else if ("submissionDate".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.submissionDate = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("timestamp".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.timestamp = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("recipient".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.recipient = reader.getString();
                } else if ("sender".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.sender = reader.getString();
                } else if ("senderIp".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.senderIp = reader.getString();
                } else if ("subject".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.subject = reader.getString();
                } else if ("reportType".equals(fieldName)) {
                    deserializedSubmissionMailEntityProperties.reportType = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSubmissionMailEntityProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy