com.microsoft.graph.beta.generated.models.Identity Maven / Gradle / Ivy
package com.microsoft.graph.beta.models;
import com.microsoft.graph.beta.models.callrecords.UserIdentity;
import com.microsoft.graph.beta.models.security.SubmissionUserIdentity;
import com.microsoft.kiota.serialization.AdditionalDataHolder;
import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;
import com.microsoft.kiota.store.BackedModel;
import com.microsoft.kiota.store.BackingStore;
import com.microsoft.kiota.store.BackingStoreFactorySingleton;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@jakarta.annotation.Generated("com.microsoft.kiota")
public class Identity implements AdditionalDataHolder, BackedModel, Parsable {
/**
* Stores model information.
*/
@jakarta.annotation.Nonnull
protected BackingStore backingStore;
/**
* Instantiates a new {@link Identity} and sets the default values.
*/
public Identity() {
this.backingStore = BackingStoreFactorySingleton.instance.createBackingStore();
this.setAdditionalData(new HashMap<>());
}
/**
* 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 Identity}
*/
@jakarta.annotation.Nonnull
public static Identity 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.auditUserIdentity": return new AuditUserIdentity();
case "#microsoft.graph.azureCommunicationServicesUserIdentity": return new AzureCommunicationServicesUserIdentity();
case "#microsoft.graph.callRecords.userIdentity": return new UserIdentity();
case "#microsoft.graph.communicationsApplicationIdentity": return new CommunicationsApplicationIdentity();
case "#microsoft.graph.communicationsApplicationInstanceIdentity": return new CommunicationsApplicationInstanceIdentity();
case "#microsoft.graph.communicationsEncryptedIdentity": return new CommunicationsEncryptedIdentity();
case "#microsoft.graph.communicationsGuestIdentity": return new CommunicationsGuestIdentity();
case "#microsoft.graph.communicationsPhoneIdentity": return new CommunicationsPhoneIdentity();
case "#microsoft.graph.communicationsUserIdentity": return new CommunicationsUserIdentity();
case "#microsoft.graph.emailIdentity": return new EmailIdentity();
case "#microsoft.graph.initiator": return new Initiator();
case "#microsoft.graph.programResource": return new ProgramResource();
case "#microsoft.graph.provisionedIdentity": return new ProvisionedIdentity();
case "#microsoft.graph.provisioningServicePrincipal": return new ProvisioningServicePrincipal();
case "#microsoft.graph.provisioningSystem": return new ProvisioningSystem();
case "#microsoft.graph.security.submissionUserIdentity": return new SubmissionUserIdentity();
case "#microsoft.graph.servicePrincipalIdentity": return new ServicePrincipalIdentity();
case "#microsoft.graph.sharePointIdentity": return new SharePointIdentity();
case "#microsoft.graph.sourceProvisionedIdentity": return new SourceProvisionedIdentity();
case "#microsoft.graph.targetProvisionedIdentity": return new TargetProvisionedIdentity();
case "#microsoft.graph.teamworkApplicationIdentity": return new TeamworkApplicationIdentity();
case "#microsoft.graph.teamworkConversationIdentity": return new TeamworkConversationIdentity();
case "#microsoft.graph.teamworkTagIdentity": return new TeamworkTagIdentity();
case "#microsoft.graph.teamworkUserIdentity": return new TeamworkUserIdentity();
case "#microsoft.graph.userIdentity": return new UserIdentity();
}
}
return new Identity();
}
/**
* Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
* @return a {@link Map}
*/
@jakarta.annotation.Nonnull
public Map getAdditionalData() {
Map value = this.backingStore.get("additionalData");
if(value == null) {
value = new HashMap<>();
this.setAdditionalData(value);
}
return value;
}
/**
* Gets the backingStore property value. Stores model information.
* @return a {@link BackingStore}
*/
@jakarta.annotation.Nonnull
public BackingStore getBackingStore() {
return this.backingStore;
}
/**
* Gets the displayName property value. The display name of the identity. For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.
* @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>(3);
deserializerMap.put("displayName", (n) -> { this.setDisplayName(n.getStringValue()); });
deserializerMap.put("id", (n) -> { this.setId(n.getStringValue()); });
deserializerMap.put("@odata.type", (n) -> { this.setOdataType(n.getStringValue()); });
return deserializerMap;
}
/**
* Gets the id property value. Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getId() {
return this.backingStore.get("id");
}
/**
* Gets the @odata.type property value. The OdataType property
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getOdataType() {
return this.backingStore.get("odataType");
}
/**
* 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);
writer.writeStringValue("displayName", this.getDisplayName());
writer.writeStringValue("id", this.getId());
writer.writeStringValue("@odata.type", this.getOdataType());
writer.writeAdditionalData(this.getAdditionalData());
}
/**
* Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
* @param value Value to set for the AdditionalData property.
*/
public void setAdditionalData(@jakarta.annotation.Nullable final Map value) {
this.backingStore.set("additionalData", value);
}
/**
* Sets the backingStore property value. Stores model information.
* @param value Value to set for the backingStore property.
*/
public void setBackingStore(@jakarta.annotation.Nonnull final BackingStore value) {
Objects.requireNonNull(value);
this.backingStore = value;
}
/**
* Sets the displayName property value. The display name of the identity. For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.
* @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 id property value. Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.
* @param value Value to set for the id property.
*/
public void setId(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("id", value);
}
/**
* Sets the @odata.type property value. The OdataType property
* @param value Value to set for the @odata.type property.
*/
public void setOdataType(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("odataType", value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy