com.microsoft.graph.generated.models.externalconnectors.DisplayTemplate Maven / Gradle / Ivy
package com.microsoft.graph.models.externalconnectors;
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.serialization.UntypedNode;
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 DisplayTemplate implements AdditionalDataHolder, BackedModel, Parsable {
/**
* Stores model information.
*/
@jakarta.annotation.Nonnull
protected BackingStore backingStore;
/**
* Instantiates a new {@link DisplayTemplate} and sets the default values.
*/
public DisplayTemplate() {
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 DisplayTemplate}
*/
@jakarta.annotation.Nonnull
public static DisplayTemplate createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
Objects.requireNonNull(parseNode);
return new DisplayTemplate();
}
/**
* 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;
}
/**
* The deserialization information for the current model
* @return a {@link Map>}
*/
@jakarta.annotation.Nonnull
public Map> getFieldDeserializers() {
final HashMap> deserializerMap = new HashMap>(5);
deserializerMap.put("id", (n) -> { this.setId(n.getStringValue()); });
deserializerMap.put("layout", (n) -> { this.setLayout(n.getObjectValue(UntypedNode::createFromDiscriminatorValue)); });
deserializerMap.put("@odata.type", (n) -> { this.setOdataType(n.getStringValue()); });
deserializerMap.put("priority", (n) -> { this.setPriority(n.getIntegerValue()); });
deserializerMap.put("rules", (n) -> { this.setRules(n.getCollectionOfObjectValues(PropertyRule::createFromDiscriminatorValue)); });
return deserializerMap;
}
/**
* Gets the id property value. The text identifier for the display template; for example, contosoTickets. Maximum 16 characters. Only alphanumeric characters allowed.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getId() {
return this.backingStore.get("id");
}
/**
* Gets the layout property value. The definition of the content's appearance, represented by an Adaptive Card, which is a JSON-serialized card object model.
* @return a {@link UntypedNode}
*/
@jakarta.annotation.Nullable
public UntypedNode getLayout() {
return this.backingStore.get("layout");
}
/**
* Gets the @odata.type property value. The OdataType property
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getOdataType() {
return this.backingStore.get("odataType");
}
/**
* Gets the priority property value. Defines the priority of a display template. A display template with priority 1 is evaluated before a template with priority 4. Gaps in priority values are supported. Must be positive value.
* @return a {@link Integer}
*/
@jakarta.annotation.Nullable
public Integer getPriority() {
return this.backingStore.get("priority");
}
/**
* Gets the rules property value. Specifies additional rules for selecting this display template based on the item schema. Optional.
* @return a {@link java.util.List}
*/
@jakarta.annotation.Nullable
public java.util.List getRules() {
return this.backingStore.get("rules");
}
/**
* 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("id", this.getId());
writer.writeObjectValue("layout", this.getLayout());
writer.writeStringValue("@odata.type", this.getOdataType());
writer.writeIntegerValue("priority", this.getPriority());
writer.writeCollectionOfObjectValues("rules", this.getRules());
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 id property value. The text identifier for the display template; for example, contosoTickets. Maximum 16 characters. Only alphanumeric characters allowed.
* @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 layout property value. The definition of the content's appearance, represented by an Adaptive Card, which is a JSON-serialized card object model.
* @param value Value to set for the layout property.
*/
public void setLayout(@jakarta.annotation.Nullable final UntypedNode value) {
this.backingStore.set("layout", 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);
}
/**
* Sets the priority property value. Defines the priority of a display template. A display template with priority 1 is evaluated before a template with priority 4. Gaps in priority values are supported. Must be positive value.
* @param value Value to set for the priority property.
*/
public void setPriority(@jakarta.annotation.Nullable final Integer value) {
this.backingStore.set("priority", value);
}
/**
* Sets the rules property value. Specifies additional rules for selecting this display template based on the item schema. Optional.
* @param value Value to set for the rules property.
*/
public void setRules(@jakarta.annotation.Nullable final java.util.List value) {
this.backingStore.set("rules", value);
}
}