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

com.azure.resourcemanager.securityinsights.models.MailMessageEntity 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-2021-09.

There is a newer version: 1.0.0
Show 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.SystemData;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner;
import com.azure.resourcemanager.securityinsights.fluent.models.MailMessageEntityProperties;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * Represents a mail message entity.
 */
@Fluent
public final class MailMessageEntity extends EntityInner {
    /*
     * The kind of the entity.
     */
    private EntityKind kind = EntityKind.MAIL_MESSAGE;

    /*
     * Mail message entity properties
     */
    private MailMessageEntityProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    private SystemData systemData;

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

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

    /**
     * Get the kind property: The kind of the entity.
     * 
     * @return the kind value.
     */
    @Override
    public EntityKind kind() {
        return this.kind;
    }

    /**
     * Get the innerProperties property: Mail message entity properties.
     * 
     * @return the innerProperties value.
     */
    private MailMessageEntityProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     * 
     * @return the systemData value.
     */
    @Override
    public SystemData systemData() {
        return this.systemData;
    }

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

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

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * Get the fileEntityIds property: The File entity ids of this mail message's attachments.
     * 
     * @return the fileEntityIds value.
     */
    public List fileEntityIds() {
        return this.innerProperties() == null ? null : this.innerProperties().fileEntityIds();
    }

    /**
     * Get the recipient property: The recipient of this mail message. Note that in case of multiple recipients the mail
     * message is forked and each copy has one recipient.
     * 
     * @return the recipient value.
     */
    public String recipient() {
        return this.innerProperties() == null ? null : this.innerProperties().recipient();
    }

    /**
     * Get the urls property: The Urls contained in this mail message.
     * 
     * @return the urls value.
     */
    public List urls() {
        return this.innerProperties() == null ? null : this.innerProperties().urls();
    }

    /**
     * Get the threats property: The threats of this mail message.
     * 
     * @return the threats value.
     */
    public List threats() {
        return this.innerProperties() == null ? null : this.innerProperties().threats();
    }

    /**
     * Get the p1Sender property: The p1 sender's email address.
     * 
     * @return the p1Sender value.
     */
    public String p1Sender() {
        return this.innerProperties() == null ? null : this.innerProperties().p1Sender();
    }

    /**
     * Get the p1SenderDisplayName property: The p1 sender's display name.
     * 
     * @return the p1SenderDisplayName value.
     */
    public String p1SenderDisplayName() {
        return this.innerProperties() == null ? null : this.innerProperties().p1SenderDisplayName();
    }

    /**
     * Get the p1SenderDomain property: The p1 sender's domain.
     * 
     * @return the p1SenderDomain value.
     */
    public String p1SenderDomain() {
        return this.innerProperties() == null ? null : this.innerProperties().p1SenderDomain();
    }

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

    /**
     * Get the p2Sender property: The p2 sender's email address.
     * 
     * @return the p2Sender value.
     */
    public String p2Sender() {
        return this.innerProperties() == null ? null : this.innerProperties().p2Sender();
    }

    /**
     * Get the p2SenderDisplayName property: The p2 sender's display name.
     * 
     * @return the p2SenderDisplayName value.
     */
    public String p2SenderDisplayName() {
        return this.innerProperties() == null ? null : this.innerProperties().p2SenderDisplayName();
    }

    /**
     * Get the p2SenderDomain property: The p2 sender's domain.
     * 
     * @return the p2SenderDomain value.
     */
    public String p2SenderDomain() {
        return this.innerProperties() == null ? null : this.innerProperties().p2SenderDomain();
    }

    /**
     * Get the receiveDate property: The receive date of this message.
     * 
     * @return the receiveDate value.
     */
    public OffsetDateTime receiveDate() {
        return this.innerProperties() == null ? null : this.innerProperties().receiveDate();
    }

    /**
     * Get the networkMessageId property: The network message id of this mail message.
     * 
     * @return the networkMessageId value.
     */
    public UUID networkMessageId() {
        return this.innerProperties() == null ? null : this.innerProperties().networkMessageId();
    }

    /**
     * Get the internetMessageId property: The internet message id of this mail message.
     * 
     * @return the internetMessageId value.
     */
    public String internetMessageId() {
        return this.innerProperties() == null ? null : this.innerProperties().internetMessageId();
    }

    /**
     * Get the subject property: The subject of this mail message.
     * 
     * @return the subject value.
     */
    public String subject() {
        return this.innerProperties() == null ? null : this.innerProperties().subject();
    }

    /**
     * Get the language property: The language of this mail message.
     * 
     * @return the language value.
     */
    public String language() {
        return this.innerProperties() == null ? null : this.innerProperties().language();
    }

    /**
     * Get the threatDetectionMethods property: The threat detection methods.
     * 
     * @return the threatDetectionMethods value.
     */
    public List threatDetectionMethods() {
        return this.innerProperties() == null ? null : this.innerProperties().threatDetectionMethods();
    }

    /**
     * Get the bodyFingerprintBin1 property: The bodyFingerprintBin1.
     * 
     * @return the bodyFingerprintBin1 value.
     */
    public Integer bodyFingerprintBin1() {
        return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin1();
    }

    /**
     * Set the bodyFingerprintBin1 property: The bodyFingerprintBin1.
     * 
     * @param bodyFingerprintBin1 the bodyFingerprintBin1 value to set.
     * @return the MailMessageEntity object itself.
     */
    public MailMessageEntity withBodyFingerprintBin1(Integer bodyFingerprintBin1) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MailMessageEntityProperties();
        }
        this.innerProperties().withBodyFingerprintBin1(bodyFingerprintBin1);
        return this;
    }

    /**
     * Get the bodyFingerprintBin2 property: The bodyFingerprintBin2.
     * 
     * @return the bodyFingerprintBin2 value.
     */
    public Integer bodyFingerprintBin2() {
        return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin2();
    }

    /**
     * Set the bodyFingerprintBin2 property: The bodyFingerprintBin2.
     * 
     * @param bodyFingerprintBin2 the bodyFingerprintBin2 value to set.
     * @return the MailMessageEntity object itself.
     */
    public MailMessageEntity withBodyFingerprintBin2(Integer bodyFingerprintBin2) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MailMessageEntityProperties();
        }
        this.innerProperties().withBodyFingerprintBin2(bodyFingerprintBin2);
        return this;
    }

    /**
     * Get the bodyFingerprintBin3 property: The bodyFingerprintBin3.
     * 
     * @return the bodyFingerprintBin3 value.
     */
    public Integer bodyFingerprintBin3() {
        return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin3();
    }

    /**
     * Set the bodyFingerprintBin3 property: The bodyFingerprintBin3.
     * 
     * @param bodyFingerprintBin3 the bodyFingerprintBin3 value to set.
     * @return the MailMessageEntity object itself.
     */
    public MailMessageEntity withBodyFingerprintBin3(Integer bodyFingerprintBin3) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MailMessageEntityProperties();
        }
        this.innerProperties().withBodyFingerprintBin3(bodyFingerprintBin3);
        return this;
    }

    /**
     * Get the bodyFingerprintBin4 property: The bodyFingerprintBin4.
     * 
     * @return the bodyFingerprintBin4 value.
     */
    public Integer bodyFingerprintBin4() {
        return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin4();
    }

    /**
     * Set the bodyFingerprintBin4 property: The bodyFingerprintBin4.
     * 
     * @param bodyFingerprintBin4 the bodyFingerprintBin4 value to set.
     * @return the MailMessageEntity object itself.
     */
    public MailMessageEntity withBodyFingerprintBin4(Integer bodyFingerprintBin4) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MailMessageEntityProperties();
        }
        this.innerProperties().withBodyFingerprintBin4(bodyFingerprintBin4);
        return this;
    }

    /**
     * Get the bodyFingerprintBin5 property: The bodyFingerprintBin5.
     * 
     * @return the bodyFingerprintBin5 value.
     */
    public Integer bodyFingerprintBin5() {
        return this.innerProperties() == null ? null : this.innerProperties().bodyFingerprintBin5();
    }

    /**
     * Set the bodyFingerprintBin5 property: The bodyFingerprintBin5.
     * 
     * @param bodyFingerprintBin5 the bodyFingerprintBin5 value to set.
     * @return the MailMessageEntity object itself.
     */
    public MailMessageEntity withBodyFingerprintBin5(Integer bodyFingerprintBin5) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MailMessageEntityProperties();
        }
        this.innerProperties().withBodyFingerprintBin5(bodyFingerprintBin5);
        return this;
    }

    /**
     * Get the antispamDirection property: The directionality of this mail message.
     * 
     * @return the antispamDirection value.
     */
    public AntispamMailDirection antispamDirection() {
        return this.innerProperties() == null ? null : this.innerProperties().antispamDirection();
    }

    /**
     * Set the antispamDirection property: The directionality of this mail message.
     * 
     * @param antispamDirection the antispamDirection value to set.
     * @return the MailMessageEntity object itself.
     */
    public MailMessageEntity withAntispamDirection(AntispamMailDirection antispamDirection) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MailMessageEntityProperties();
        }
        this.innerProperties().withAntispamDirection(antispamDirection);
        return this;
    }

    /**
     * Get the deliveryAction property: The delivery action of this mail message like Delivered, Blocked, Replaced etc.
     * 
     * @return the deliveryAction value.
     */
    public DeliveryAction deliveryAction() {
        return this.innerProperties() == null ? null : this.innerProperties().deliveryAction();
    }

    /**
     * Set the deliveryAction property: The delivery action of this mail message like Delivered, Blocked, Replaced etc.
     * 
     * @param deliveryAction the deliveryAction value to set.
     * @return the MailMessageEntity object itself.
     */
    public MailMessageEntity withDeliveryAction(DeliveryAction deliveryAction) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MailMessageEntityProperties();
        }
        this.innerProperties().withDeliveryAction(deliveryAction);
        return this;
    }

    /**
     * Get the deliveryLocation property: The delivery location of this mail message like Inbox, JunkFolder etc.
     * 
     * @return the deliveryLocation value.
     */
    public DeliveryLocation deliveryLocation() {
        return this.innerProperties() == null ? null : this.innerProperties().deliveryLocation();
    }

    /**
     * Set the deliveryLocation property: The delivery location of this mail message like Inbox, JunkFolder etc.
     * 
     * @param deliveryLocation the deliveryLocation value to set.
     * @return the MailMessageEntity object itself.
     */
    public MailMessageEntity withDeliveryLocation(DeliveryLocation deliveryLocation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MailMessageEntityProperties();
        }
        this.innerProperties().withDeliveryLocation(deliveryLocation);
        return this;
    }

    /**
     * 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.
     */
    public Map additionalData() {
        return this.innerProperties() == null ? null : this.innerProperties().additionalData();
    }

    /**
     * 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.
     */
    public String friendlyName() {
        return this.innerProperties() == null ? null : this.innerProperties().friendlyName();
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedMailMessageEntity.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedMailMessageEntity.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedMailMessageEntity.type = reader.getString();
                } else if ("systemData".equals(fieldName)) {
                    deserializedMailMessageEntity.systemData = SystemData.fromJson(reader);
                } else if ("kind".equals(fieldName)) {
                    deserializedMailMessageEntity.kind = EntityKind.fromString(reader.getString());
                } else if ("properties".equals(fieldName)) {
                    deserializedMailMessageEntity.innerProperties = MailMessageEntityProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMailMessageEntity;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy