com.microsoft.graph.beta.generated.models.RiskyServicePrincipal Maven / Gradle / Ivy
package com.microsoft.graph.beta.models;
import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@jakarta.annotation.Generated("com.microsoft.kiota")
public class RiskyServicePrincipal extends Entity implements Parsable {
/**
* Instantiates a new {@link RiskyServicePrincipal} and sets the default values.
*/
public RiskyServicePrincipal() {
super();
}
/**
* Creates a new instance of the appropriate class based on discriminator value
* @param parseNode The parse node to use to read the discriminator value and create the object
* @return a {@link RiskyServicePrincipal}
*/
@jakarta.annotation.Nonnull
public static RiskyServicePrincipal createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
Objects.requireNonNull(parseNode);
final ParseNode mappingValueNode = parseNode.getChildNode("@odata.type");
if (mappingValueNode != null) {
final String mappingValue = mappingValueNode.getStringValue();
switch (mappingValue) {
case "#microsoft.graph.riskyServicePrincipalHistoryItem": return new RiskyServicePrincipalHistoryItem();
}
}
return new RiskyServicePrincipal();
}
/**
* Gets the accountEnabled property value. true if the service principal account is enabled; otherwise, false.
* @return a {@link Boolean}
*/
@jakarta.annotation.Nullable
public Boolean getAccountEnabled() {
return this.backingStore.get("accountEnabled");
}
/**
* Gets the appId property value. The globally unique identifier for the associated application (its appId property), if any.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getAppId() {
return this.backingStore.get("appId");
}
/**
* Gets the displayName property value. The display name for the service principal.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getDisplayName() {
return this.backingStore.get("displayName");
}
/**
* The deserialization information for the current model
* @return a {@link Map>}
*/
@jakarta.annotation.Nonnull
public Map> getFieldDeserializers() {
final HashMap> deserializerMap = new HashMap>(super.getFieldDeserializers());
deserializerMap.put("accountEnabled", (n) -> { this.setAccountEnabled(n.getBooleanValue()); });
deserializerMap.put("appId", (n) -> { this.setAppId(n.getStringValue()); });
deserializerMap.put("displayName", (n) -> { this.setDisplayName(n.getStringValue()); });
deserializerMap.put("history", (n) -> { this.setHistory(n.getCollectionOfObjectValues(RiskyServicePrincipalHistoryItem::createFromDiscriminatorValue)); });
deserializerMap.put("isEnabled", (n) -> { this.setIsEnabled(n.getBooleanValue()); });
deserializerMap.put("isProcessing", (n) -> { this.setIsProcessing(n.getBooleanValue()); });
deserializerMap.put("riskDetail", (n) -> { this.setRiskDetail(n.getEnumValue(RiskDetail::forValue)); });
deserializerMap.put("riskLastUpdatedDateTime", (n) -> { this.setRiskLastUpdatedDateTime(n.getOffsetDateTimeValue()); });
deserializerMap.put("riskLevel", (n) -> { this.setRiskLevel(n.getEnumValue(RiskLevel::forValue)); });
deserializerMap.put("riskState", (n) -> { this.setRiskState(n.getEnumValue(RiskState::forValue)); });
deserializerMap.put("servicePrincipalType", (n) -> { this.setServicePrincipalType(n.getStringValue()); });
return deserializerMap;
}
/**
* Gets the history property value. Represents the risk history of Microsoft Entra service principals.
* @return a {@link java.util.List}
*/
@jakarta.annotation.Nullable
public java.util.List getHistory() {
return this.backingStore.get("history");
}
/**
* Gets the isEnabled property value. The isEnabled property
* @return a {@link Boolean}
*/
@jakarta.annotation.Nullable
public Boolean getIsEnabled() {
return this.backingStore.get("isEnabled");
}
/**
* Gets the isProcessing property value. Indicates whether Microsoft Entra ID Protection is currently processing the service principal's risky state.
* @return a {@link Boolean}
*/
@jakarta.annotation.Nullable
public Boolean getIsProcessing() {
return this.backingStore.get("isProcessing");
}
/**
* Gets the riskDetail property value. Details of the detected risk. Note: Details for this property are only available for Workload Identities Premium customers. Events in tenants without this license will be returned hidden. The possible values are: none, hidden, unknownFutureValue, adminConfirmedServicePrincipalCompromised, adminDismissedAllRiskForServicePrincipal. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum: adminConfirmedServicePrincipalCompromised , adminDismissedAllRiskForServicePrincipal.
* @return a {@link RiskDetail}
*/
@jakarta.annotation.Nullable
public RiskDetail getRiskDetail() {
return this.backingStore.get("riskDetail");
}
/**
* Gets the riskLastUpdatedDateTime property value. The date and time that the risk state was last updated. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2021 is 2021-01-01T00:00:00Z. Supports $filter (eq).
* @return a {@link OffsetDateTime}
*/
@jakarta.annotation.Nullable
public OffsetDateTime getRiskLastUpdatedDateTime() {
return this.backingStore.get("riskLastUpdatedDateTime");
}
/**
* Gets the riskLevel property value. Level of the detected risky workload identity. The possible values are: low, medium, high, hidden, none, unknownFutureValue. Supports $filter (eq).
* @return a {@link RiskLevel}
*/
@jakarta.annotation.Nullable
public RiskLevel getRiskLevel() {
return this.backingStore.get("riskLevel");
}
/**
* Gets the riskState property value. State of the service principal's risk. The possible values are: none, confirmedSafe, remediated, dismissed, atRisk, confirmedCompromised, unknownFutureValue.
* @return a {@link RiskState}
*/
@jakarta.annotation.Nullable
public RiskState getRiskState() {
return this.backingStore.get("riskState");
}
/**
* Gets the servicePrincipalType property value. Identifies whether the service principal represents an Application, a ManagedIdentity, or a legacy application (socialIdp). This is set by Microsoft Entra ID internally and is inherited from servicePrincipal.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getServicePrincipalType() {
return this.backingStore.get("servicePrincipalType");
}
/**
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
public void serialize(@jakarta.annotation.Nonnull final SerializationWriter writer) {
Objects.requireNonNull(writer);
super.serialize(writer);
writer.writeBooleanValue("accountEnabled", this.getAccountEnabled());
writer.writeStringValue("appId", this.getAppId());
writer.writeStringValue("displayName", this.getDisplayName());
writer.writeCollectionOfObjectValues("history", this.getHistory());
writer.writeBooleanValue("isEnabled", this.getIsEnabled());
writer.writeBooleanValue("isProcessing", this.getIsProcessing());
writer.writeEnumValue("riskDetail", this.getRiskDetail());
writer.writeOffsetDateTimeValue("riskLastUpdatedDateTime", this.getRiskLastUpdatedDateTime());
writer.writeEnumValue("riskLevel", this.getRiskLevel());
writer.writeEnumValue("riskState", this.getRiskState());
writer.writeStringValue("servicePrincipalType", this.getServicePrincipalType());
}
/**
* Sets the accountEnabled property value. true if the service principal account is enabled; otherwise, false.
* @param value Value to set for the accountEnabled property.
*/
public void setAccountEnabled(@jakarta.annotation.Nullable final Boolean value) {
this.backingStore.set("accountEnabled", value);
}
/**
* Sets the appId property value. The globally unique identifier for the associated application (its appId property), if any.
* @param value Value to set for the appId property.
*/
public void setAppId(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("appId", value);
}
/**
* Sets the displayName property value. The display name for the service principal.
* @param value Value to set for the displayName property.
*/
public void setDisplayName(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("displayName", value);
}
/**
* Sets the history property value. Represents the risk history of Microsoft Entra service principals.
* @param value Value to set for the history property.
*/
public void setHistory(@jakarta.annotation.Nullable final java.util.List value) {
this.backingStore.set("history", value);
}
/**
* Sets the isEnabled property value. The isEnabled property
* @param value Value to set for the isEnabled property.
*/
public void setIsEnabled(@jakarta.annotation.Nullable final Boolean value) {
this.backingStore.set("isEnabled", value);
}
/**
* Sets the isProcessing property value. Indicates whether Microsoft Entra ID Protection is currently processing the service principal's risky state.
* @param value Value to set for the isProcessing property.
*/
public void setIsProcessing(@jakarta.annotation.Nullable final Boolean value) {
this.backingStore.set("isProcessing", value);
}
/**
* Sets the riskDetail property value. Details of the detected risk. Note: Details for this property are only available for Workload Identities Premium customers. Events in tenants without this license will be returned hidden. The possible values are: none, hidden, unknownFutureValue, adminConfirmedServicePrincipalCompromised, adminDismissedAllRiskForServicePrincipal. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum: adminConfirmedServicePrincipalCompromised , adminDismissedAllRiskForServicePrincipal.
* @param value Value to set for the riskDetail property.
*/
public void setRiskDetail(@jakarta.annotation.Nullable final RiskDetail value) {
this.backingStore.set("riskDetail", value);
}
/**
* Sets the riskLastUpdatedDateTime property value. The date and time that the risk state was last updated. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2021 is 2021-01-01T00:00:00Z. Supports $filter (eq).
* @param value Value to set for the riskLastUpdatedDateTime property.
*/
public void setRiskLastUpdatedDateTime(@jakarta.annotation.Nullable final OffsetDateTime value) {
this.backingStore.set("riskLastUpdatedDateTime", value);
}
/**
* Sets the riskLevel property value. Level of the detected risky workload identity. The possible values are: low, medium, high, hidden, none, unknownFutureValue. Supports $filter (eq).
* @param value Value to set for the riskLevel property.
*/
public void setRiskLevel(@jakarta.annotation.Nullable final RiskLevel value) {
this.backingStore.set("riskLevel", value);
}
/**
* Sets the riskState property value. State of the service principal's risk. The possible values are: none, confirmedSafe, remediated, dismissed, atRisk, confirmedCompromised, unknownFutureValue.
* @param value Value to set for the riskState property.
*/
public void setRiskState(@jakarta.annotation.Nullable final RiskState value) {
this.backingStore.set("riskState", value);
}
/**
* Sets the servicePrincipalType property value. Identifies whether the service principal represents an Application, a ManagedIdentity, or a legacy application (socialIdp). This is set by Microsoft Entra ID internally and is inherited from servicePrincipal.
* @param value Value to set for the servicePrincipalType property.
*/
public void setServicePrincipalType(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("servicePrincipalType", value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy