package com.microsoft.graph.beta.drives.item.items.item.preview;

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 PreviewPostRequestBody implements AdditionalDataHolder, BackedModel, Parsable {
    /**
     * Stores model information.
     */
    @jakarta.annotation.Nonnull
    protected BackingStore backingStore;
    /**
     * Instantiates a new {@link PreviewPostRequestBody} and sets the default values.
     */
    public PreviewPostRequestBody() {
        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 PreviewPostRequestBody}
     */
    @jakarta.annotation.Nonnull
    public static PreviewPostRequestBody createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
        Objects.requireNonNull(parseNode);
        return new PreviewPostRequestBody();
    }
    /**
     * 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<String, Object>}
     */
    @jakarta.annotation.Nonnull
    public Map<String, Object> getAdditionalData() {
        Map<String, Object> value = this.backingStore.get("additionalData");
        if(value == null) {
            value = new HashMap<>();
            this.setAdditionalData(value);
        }
        return value;
    }
    /**
     * Gets the allowEdit property value. The allowEdit property
     * @return a {@link Boolean}
     */
    @jakarta.annotation.Nullable
    public Boolean getAllowEdit() {
        return this.backingStore.get("allowEdit");
    }
    /**
     * Gets the backingStore property value. Stores model information.
     * @return a {@link BackingStore}
     */
    @jakarta.annotation.Nonnull
    public BackingStore getBackingStore() {
        return this.backingStore;
    }
    /**
     * Gets the chromeless property value. The chromeless property
     * @return a {@link Boolean}
     */
    @jakarta.annotation.Nullable
    public Boolean getChromeless() {
        return this.backingStore.get("chromeless");
    }
    /**
     * The deserialization information for the current model
     * @return a {@link Map<String, java.util.function.Consumer<ParseNode>>}
     */
    @jakarta.annotation.Nonnull
    public Map<String, java.util.function.Consumer<ParseNode>> getFieldDeserializers() {
        final HashMap<String, java.util.function.Consumer<ParseNode>> deserializerMap = new HashMap<String, java.util.function.Consumer<ParseNode>>(5);
        deserializerMap.put("allowEdit", (n) -> { this.setAllowEdit(n.getBooleanValue()); });
        deserializerMap.put("chromeless", (n) -> { this.setChromeless(n.getBooleanValue()); });
        deserializerMap.put("page", (n) -> { this.setPage(n.getStringValue()); });
        deserializerMap.put("viewer", (n) -> { this.setViewer(n.getStringValue()); });
        deserializerMap.put("zoom", (n) -> { this.setZoom(n.getDoubleValue()); });
        return deserializerMap;
    }
    /**
     * Gets the page property value. The page property
     * @return a {@link String}
     */
    @jakarta.annotation.Nullable
    public String getPage() {
        return this.backingStore.get("page");
    }
    /**
     * Gets the viewer property value. The viewer property
     * @return a {@link String}
     */
    @jakarta.annotation.Nullable
    public String getViewer() {
        return this.backingStore.get("viewer");
    }
    /**
     * Gets the zoom property value. The zoom property
     * @return a {@link Double}
     */
    @jakarta.annotation.Nullable
    public Double getZoom() {
        return this.backingStore.get("zoom");
    }
    /**
     * 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.writeBooleanValue("allowEdit", this.getAllowEdit());
        writer.writeBooleanValue("chromeless", this.getChromeless());
        writer.writeStringValue("page", this.getPage());
        writer.writeStringValue("viewer", this.getViewer());
        writer.writeDoubleValue("zoom", this.getZoom());
        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<String, Object> value) {
        this.backingStore.set("additionalData", value);
    }
    /**
     * Sets the allowEdit property value. The allowEdit property
     * @param value Value to set for the allowEdit property.
     */
    public void setAllowEdit(@jakarta.annotation.Nullable final Boolean value) {
        this.backingStore.set("allowEdit", 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 chromeless property value. The chromeless property
     * @param value Value to set for the chromeless property.
     */
    public void setChromeless(@jakarta.annotation.Nullable final Boolean value) {
        this.backingStore.set("chromeless", value);
    }
    /**
     * Sets the page property value. The page property
     * @param value Value to set for the page property.
     */
    public void setPage(@jakarta.annotation.Nullable final String value) {
        this.backingStore.set("page", value);
    }
    /**
     * Sets the viewer property value. The viewer property
     * @param value Value to set for the viewer property.
     */
    public void setViewer(@jakarta.annotation.Nullable final String value) {
        this.backingStore.set("viewer", value);
    }
    /**
     * Sets the zoom property value. The zoom property
     * @param value Value to set for the zoom property.
     */
    public void setZoom(@jakarta.annotation.Nullable final Double value) {
        this.backingStore.set("zoom", value);
    }
}
