com.azure.resourcemanager.securityinsights.fluent.models.MailMessageEntityProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
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.Fluent;
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.AntispamMailDirection;
import com.azure.resourcemanager.securityinsights.models.DeliveryAction;
import com.azure.resourcemanager.securityinsights.models.DeliveryLocation;
import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* Mail message entity property bag.
*/
@Fluent
public final class MailMessageEntityProperties extends EntityCommonProperties {
/*
* The File entity ids of this mail message's attachments
*/
private List fileEntityIds;
/*
* The recipient of this mail message. Note that in case of multiple recipients the mail message is forked and each
* copy has one recipient
*/
private String recipient;
/*
* The Urls contained in this mail message
*/
private List urls;
/*
* The threats of this mail message
*/
private List threats;
/*
* The p1 sender's email address
*/
private String p1Sender;
/*
* The p1 sender's display name
*/
private String p1SenderDisplayName;
/*
* The p1 sender's domain
*/
private String p1SenderDomain;
/*
* The sender's IP address
*/
private String senderIp;
/*
* The p2 sender's email address
*/
private String p2Sender;
/*
* The p2 sender's display name
*/
private String p2SenderDisplayName;
/*
* The p2 sender's domain
*/
private String p2SenderDomain;
/*
* The receive date of this message
*/
private OffsetDateTime receiveDate;
/*
* The network message id of this mail message
*/
private UUID networkMessageId;
/*
* The internet message id of this mail message
*/
private String internetMessageId;
/*
* The subject of this mail message
*/
private String subject;
/*
* The language of this mail message
*/
private String language;
/*
* The threat detection methods
*/
private List threatDetectionMethods;
/*
* The bodyFingerprintBin1
*/
private Integer bodyFingerprintBin1;
/*
* The bodyFingerprintBin2
*/
private Integer bodyFingerprintBin2;
/*
* The bodyFingerprintBin3
*/
private Integer bodyFingerprintBin3;
/*
* The bodyFingerprintBin4
*/
private Integer bodyFingerprintBin4;
/*
* The bodyFingerprintBin5
*/
private Integer bodyFingerprintBin5;
/*
* The directionality of this mail message
*/
private AntispamMailDirection antispamDirection;
/*
* The delivery action of this mail message like Delivered, Blocked, Replaced etc
*/
private DeliveryAction deliveryAction;
/*
* The delivery location of this mail message like Inbox, JunkFolder etc
*/
private DeliveryLocation deliveryLocation;
/*
* 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 MailMessageEntityProperties class.
*/
public MailMessageEntityProperties() {
}
/**
* Get the fileEntityIds property: The File entity ids of this mail message's attachments.
*
* @return the fileEntityIds value.
*/
public List fileEntityIds() {
return this.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.recipient;
}
/**
* Get the urls property: The Urls contained in this mail message.
*
* @return the urls value.
*/
public List urls() {
return this.urls;
}
/**
* Get the threats property: The threats of this mail message.
*
* @return the threats value.
*/
public List threats() {
return this.threats;
}
/**
* Get the p1Sender property: The p1 sender's email address.
*
* @return the p1Sender value.
*/
public String p1Sender() {
return this.p1Sender;
}
/**
* Get the p1SenderDisplayName property: The p1 sender's display name.
*
* @return the p1SenderDisplayName value.
*/
public String p1SenderDisplayName() {
return this.p1SenderDisplayName;
}
/**
* Get the p1SenderDomain property: The p1 sender's domain.
*
* @return the p1SenderDomain value.
*/
public String p1SenderDomain() {
return this.p1SenderDomain;
}
/**
* Get the senderIp property: The sender's IP address.
*
* @return the senderIp value.
*/
public String senderIp() {
return this.senderIp;
}
/**
* Get the p2Sender property: The p2 sender's email address.
*
* @return the p2Sender value.
*/
public String p2Sender() {
return this.p2Sender;
}
/**
* Get the p2SenderDisplayName property: The p2 sender's display name.
*
* @return the p2SenderDisplayName value.
*/
public String p2SenderDisplayName() {
return this.p2SenderDisplayName;
}
/**
* Get the p2SenderDomain property: The p2 sender's domain.
*
* @return the p2SenderDomain value.
*/
public String p2SenderDomain() {
return this.p2SenderDomain;
}
/**
* Get the receiveDate property: The receive date of this message.
*
* @return the receiveDate value.
*/
public OffsetDateTime receiveDate() {
return this.receiveDate;
}
/**
* Get the networkMessageId property: The network message id of this mail message.
*
* @return the networkMessageId value.
*/
public UUID networkMessageId() {
return this.networkMessageId;
}
/**
* Get the internetMessageId property: The internet message id of this mail message.
*
* @return the internetMessageId value.
*/
public String internetMessageId() {
return this.internetMessageId;
}
/**
* Get the subject property: The subject of this mail message.
*
* @return the subject value.
*/
public String subject() {
return this.subject;
}
/**
* Get the language property: The language of this mail message.
*
* @return the language value.
*/
public String language() {
return this.language;
}
/**
* Get the threatDetectionMethods property: The threat detection methods.
*
* @return the threatDetectionMethods value.
*/
public List threatDetectionMethods() {
return this.threatDetectionMethods;
}
/**
* Get the bodyFingerprintBin1 property: The bodyFingerprintBin1.
*
* @return the bodyFingerprintBin1 value.
*/
public Integer bodyFingerprintBin1() {
return this.bodyFingerprintBin1;
}
/**
* Set the bodyFingerprintBin1 property: The bodyFingerprintBin1.
*
* @param bodyFingerprintBin1 the bodyFingerprintBin1 value to set.
* @return the MailMessageEntityProperties object itself.
*/
public MailMessageEntityProperties withBodyFingerprintBin1(Integer bodyFingerprintBin1) {
this.bodyFingerprintBin1 = bodyFingerprintBin1;
return this;
}
/**
* Get the bodyFingerprintBin2 property: The bodyFingerprintBin2.
*
* @return the bodyFingerprintBin2 value.
*/
public Integer bodyFingerprintBin2() {
return this.bodyFingerprintBin2;
}
/**
* Set the bodyFingerprintBin2 property: The bodyFingerprintBin2.
*
* @param bodyFingerprintBin2 the bodyFingerprintBin2 value to set.
* @return the MailMessageEntityProperties object itself.
*/
public MailMessageEntityProperties withBodyFingerprintBin2(Integer bodyFingerprintBin2) {
this.bodyFingerprintBin2 = bodyFingerprintBin2;
return this;
}
/**
* Get the bodyFingerprintBin3 property: The bodyFingerprintBin3.
*
* @return the bodyFingerprintBin3 value.
*/
public Integer bodyFingerprintBin3() {
return this.bodyFingerprintBin3;
}
/**
* Set the bodyFingerprintBin3 property: The bodyFingerprintBin3.
*
* @param bodyFingerprintBin3 the bodyFingerprintBin3 value to set.
* @return the MailMessageEntityProperties object itself.
*/
public MailMessageEntityProperties withBodyFingerprintBin3(Integer bodyFingerprintBin3) {
this.bodyFingerprintBin3 = bodyFingerprintBin3;
return this;
}
/**
* Get the bodyFingerprintBin4 property: The bodyFingerprintBin4.
*
* @return the bodyFingerprintBin4 value.
*/
public Integer bodyFingerprintBin4() {
return this.bodyFingerprintBin4;
}
/**
* Set the bodyFingerprintBin4 property: The bodyFingerprintBin4.
*
* @param bodyFingerprintBin4 the bodyFingerprintBin4 value to set.
* @return the MailMessageEntityProperties object itself.
*/
public MailMessageEntityProperties withBodyFingerprintBin4(Integer bodyFingerprintBin4) {
this.bodyFingerprintBin4 = bodyFingerprintBin4;
return this;
}
/**
* Get the bodyFingerprintBin5 property: The bodyFingerprintBin5.
*
* @return the bodyFingerprintBin5 value.
*/
public Integer bodyFingerprintBin5() {
return this.bodyFingerprintBin5;
}
/**
* Set the bodyFingerprintBin5 property: The bodyFingerprintBin5.
*
* @param bodyFingerprintBin5 the bodyFingerprintBin5 value to set.
* @return the MailMessageEntityProperties object itself.
*/
public MailMessageEntityProperties withBodyFingerprintBin5(Integer bodyFingerprintBin5) {
this.bodyFingerprintBin5 = bodyFingerprintBin5;
return this;
}
/**
* Get the antispamDirection property: The directionality of this mail message.
*
* @return the antispamDirection value.
*/
public AntispamMailDirection antispamDirection() {
return this.antispamDirection;
}
/**
* Set the antispamDirection property: The directionality of this mail message.
*
* @param antispamDirection the antispamDirection value to set.
* @return the MailMessageEntityProperties object itself.
*/
public MailMessageEntityProperties withAntispamDirection(AntispamMailDirection antispamDirection) {
this.antispamDirection = 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.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 MailMessageEntityProperties object itself.
*/
public MailMessageEntityProperties withDeliveryAction(DeliveryAction deliveryAction) {
this.deliveryAction = 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.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 MailMessageEntityProperties object itself.
*/
public MailMessageEntityProperties withDeliveryLocation(DeliveryLocation deliveryLocation) {
this.deliveryLocation = deliveryLocation;
return this;
}
/**
* 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();
jsonWriter.writeNumberField("bodyFingerprintBin1", this.bodyFingerprintBin1);
jsonWriter.writeNumberField("bodyFingerprintBin2", this.bodyFingerprintBin2);
jsonWriter.writeNumberField("bodyFingerprintBin3", this.bodyFingerprintBin3);
jsonWriter.writeNumberField("bodyFingerprintBin4", this.bodyFingerprintBin4);
jsonWriter.writeNumberField("bodyFingerprintBin5", this.bodyFingerprintBin5);
jsonWriter.writeStringField("antispamDirection",
this.antispamDirection == null ? null : this.antispamDirection.toString());
jsonWriter.writeStringField("deliveryAction",
this.deliveryAction == null ? null : this.deliveryAction.toString());
jsonWriter.writeStringField("deliveryLocation",
this.deliveryLocation == null ? null : this.deliveryLocation.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MailMessageEntityProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MailMessageEntityProperties 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 MailMessageEntityProperties.
*/
public static MailMessageEntityProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MailMessageEntityProperties deserializedMailMessageEntityProperties = new MailMessageEntityProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("additionalData".equals(fieldName)) {
Map additionalData = reader.readMap(reader1 -> reader1.readUntyped());
deserializedMailMessageEntityProperties.additionalData = additionalData;
} else if ("friendlyName".equals(fieldName)) {
deserializedMailMessageEntityProperties.friendlyName = reader.getString();
} else if ("fileEntityIds".equals(fieldName)) {
List fileEntityIds = reader.readArray(reader1 -> reader1.getString());
deserializedMailMessageEntityProperties.fileEntityIds = fileEntityIds;
} else if ("recipient".equals(fieldName)) {
deserializedMailMessageEntityProperties.recipient = reader.getString();
} else if ("urls".equals(fieldName)) {
List urls = reader.readArray(reader1 -> reader1.getString());
deserializedMailMessageEntityProperties.urls = urls;
} else if ("threats".equals(fieldName)) {
List threats = reader.readArray(reader1 -> reader1.getString());
deserializedMailMessageEntityProperties.threats = threats;
} else if ("p1Sender".equals(fieldName)) {
deserializedMailMessageEntityProperties.p1Sender = reader.getString();
} else if ("p1SenderDisplayName".equals(fieldName)) {
deserializedMailMessageEntityProperties.p1SenderDisplayName = reader.getString();
} else if ("p1SenderDomain".equals(fieldName)) {
deserializedMailMessageEntityProperties.p1SenderDomain = reader.getString();
} else if ("senderIP".equals(fieldName)) {
deserializedMailMessageEntityProperties.senderIp = reader.getString();
} else if ("p2Sender".equals(fieldName)) {
deserializedMailMessageEntityProperties.p2Sender = reader.getString();
} else if ("p2SenderDisplayName".equals(fieldName)) {
deserializedMailMessageEntityProperties.p2SenderDisplayName = reader.getString();
} else if ("p2SenderDomain".equals(fieldName)) {
deserializedMailMessageEntityProperties.p2SenderDomain = reader.getString();
} else if ("receiveDate".equals(fieldName)) {
deserializedMailMessageEntityProperties.receiveDate = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("networkMessageId".equals(fieldName)) {
deserializedMailMessageEntityProperties.networkMessageId
= reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
} else if ("internetMessageId".equals(fieldName)) {
deserializedMailMessageEntityProperties.internetMessageId = reader.getString();
} else if ("subject".equals(fieldName)) {
deserializedMailMessageEntityProperties.subject = reader.getString();
} else if ("language".equals(fieldName)) {
deserializedMailMessageEntityProperties.language = reader.getString();
} else if ("threatDetectionMethods".equals(fieldName)) {
List threatDetectionMethods = reader.readArray(reader1 -> reader1.getString());
deserializedMailMessageEntityProperties.threatDetectionMethods = threatDetectionMethods;
} else if ("bodyFingerprintBin1".equals(fieldName)) {
deserializedMailMessageEntityProperties.bodyFingerprintBin1
= reader.getNullable(JsonReader::getInt);
} else if ("bodyFingerprintBin2".equals(fieldName)) {
deserializedMailMessageEntityProperties.bodyFingerprintBin2
= reader.getNullable(JsonReader::getInt);
} else if ("bodyFingerprintBin3".equals(fieldName)) {
deserializedMailMessageEntityProperties.bodyFingerprintBin3
= reader.getNullable(JsonReader::getInt);
} else if ("bodyFingerprintBin4".equals(fieldName)) {
deserializedMailMessageEntityProperties.bodyFingerprintBin4
= reader.getNullable(JsonReader::getInt);
} else if ("bodyFingerprintBin5".equals(fieldName)) {
deserializedMailMessageEntityProperties.bodyFingerprintBin5
= reader.getNullable(JsonReader::getInt);
} else if ("antispamDirection".equals(fieldName)) {
deserializedMailMessageEntityProperties.antispamDirection
= AntispamMailDirection.fromString(reader.getString());
} else if ("deliveryAction".equals(fieldName)) {
deserializedMailMessageEntityProperties.deliveryAction
= DeliveryAction.fromString(reader.getString());
} else if ("deliveryLocation".equals(fieldName)) {
deserializedMailMessageEntityProperties.deliveryLocation
= DeliveryLocation.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedMailMessageEntityProperties;
});
}
}