com.microsoft.graph.generated.models.AttachmentSession Maven / Gradle / Ivy
package com.microsoft.graph.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 AttachmentSession extends Entity implements Parsable {
/**
* Instantiates a new {@link AttachmentSession} and sets the default values.
*/
public AttachmentSession() {
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 AttachmentSession}
*/
@jakarta.annotation.Nonnull
public static AttachmentSession createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
Objects.requireNonNull(parseNode);
return new AttachmentSession();
}
/**
* Gets the content property value. The content streams that are uploaded.
* @return a {@link byte[]}
*/
@jakarta.annotation.Nullable
public byte[] getContent() {
return this.backingStore.get("content");
}
/**
* Gets the expirationDateTime property value. The date and time in UTC when the upload session will expire. The complete file must be uploaded before this expiration time is reached.
* @return a {@link OffsetDateTime}
*/
@jakarta.annotation.Nullable
public OffsetDateTime getExpirationDateTime() {
return this.backingStore.get("expirationDateTime");
}
/**
* 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("content", (n) -> { this.setContent(n.getByteArrayValue()); });
deserializerMap.put("expirationDateTime", (n) -> { this.setExpirationDateTime(n.getOffsetDateTimeValue()); });
deserializerMap.put("nextExpectedRanges", (n) -> { this.setNextExpectedRanges(n.getCollectionOfPrimitiveValues(String.class)); });
return deserializerMap;
}
/**
* Gets the nextExpectedRanges property value. Indicates a single value {start} that represents the location in the file where the next upload should begin.
* @return a {@link java.util.List}
*/
@jakarta.annotation.Nullable
public java.util.List getNextExpectedRanges() {
return this.backingStore.get("nextExpectedRanges");
}
/**
* 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.writeByteArrayValue("content", this.getContent());
writer.writeOffsetDateTimeValue("expirationDateTime", this.getExpirationDateTime());
writer.writeCollectionOfPrimitiveValues("nextExpectedRanges", this.getNextExpectedRanges());
}
/**
* Sets the content property value. The content streams that are uploaded.
* @param value Value to set for the content property.
*/
public void setContent(@jakarta.annotation.Nullable final byte[] value) {
this.backingStore.set("content", value);
}
/**
* Sets the expirationDateTime property value. The date and time in UTC when the upload session will expire. The complete file must be uploaded before this expiration time is reached.
* @param value Value to set for the expirationDateTime property.
*/
public void setExpirationDateTime(@jakarta.annotation.Nullable final OffsetDateTime value) {
this.backingStore.set("expirationDateTime", value);
}
/**
* Sets the nextExpectedRanges property value. Indicates a single value {start} that represents the location in the file where the next upload should begin.
* @param value Value to set for the nextExpectedRanges property.
*/
public void setNextExpectedRanges(@jakarta.annotation.Nullable final java.util.List value) {
this.backingStore.set("nextExpectedRanges", value);
}
}