// 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.resourcemanager.securityinsights.fluent.models.EntityInner;
import com.azure.resourcemanager.securityinsights.fluent.models.MailMessageEntityProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/** Represents a mail message entity. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonTypeName("MailMessage")
@Fluent
public final class MailMessageEntity extends EntityInner {
    /*
     * Mail message entity properties
     */
    @JsonProperty(value = "properties")
    private MailMessageEntityProperties innerProperties;

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

    /**
     * Get the fileEntityIds property: The File entity ids of this mail message's attachments.
     *
     * @return the fileEntityIds value.
     */
    public List<String> 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<String> 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<String> 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<String> 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<String, Object> 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() {
        super.validate();
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
