|
| 1 | +package com.microsoft.graph.beta.chats.item.messages.forwardtochat; |
| 2 | + |
| 3 | +import com.microsoft.graph.beta.models.ChatMessage; |
| 4 | +import com.microsoft.kiota.serialization.AdditionalDataHolder; |
| 5 | +import com.microsoft.kiota.serialization.Parsable; |
| 6 | +import com.microsoft.kiota.serialization.ParseNode; |
| 7 | +import com.microsoft.kiota.serialization.SerializationWriter; |
| 8 | +import com.microsoft.kiota.store.BackedModel; |
| 9 | +import com.microsoft.kiota.store.BackingStore; |
| 10 | +import com.microsoft.kiota.store.BackingStoreFactorySingleton; |
| 11 | +import java.util.HashMap; |
| 12 | +import java.util.Map; |
| 13 | +import java.util.Objects; |
| 14 | +@jakarta.annotation.Generated("com.microsoft.kiota") |
| 15 | +public class ForwardToChatPostRequestBody implements AdditionalDataHolder, BackedModel, Parsable { |
| 16 | + /** |
| 17 | + * Stores model information. |
| 18 | + */ |
| 19 | + @jakarta.annotation.Nonnull |
| 20 | + protected BackingStore backingStore; |
| 21 | + /** |
| 22 | + * Instantiates a new {@link ForwardToChatPostRequestBody} and sets the default values. |
| 23 | + */ |
| 24 | + public ForwardToChatPostRequestBody() { |
| 25 | + this.backingStore = BackingStoreFactorySingleton.instance.createBackingStore(); |
| 26 | + this.setAdditionalData(new HashMap<>()); |
| 27 | + } |
| 28 | + /** |
| 29 | + * Creates a new instance of the appropriate class based on discriminator value |
| 30 | + * @param parseNode The parse node to use to read the discriminator value and create the object |
| 31 | + * @return a {@link ForwardToChatPostRequestBody} |
| 32 | + */ |
| 33 | + @jakarta.annotation.Nonnull |
| 34 | + public static ForwardToChatPostRequestBody createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) { |
| 35 | + Objects.requireNonNull(parseNode); |
| 36 | + return new ForwardToChatPostRequestBody(); |
| 37 | + } |
| 38 | + /** |
| 39 | + * Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. |
| 40 | + * @return a {@link Map<String, Object>} |
| 41 | + */ |
| 42 | + @jakarta.annotation.Nonnull |
| 43 | + public Map<String, Object> getAdditionalData() { |
| 44 | + Map<String, Object> value = this.backingStore.get("additionalData"); |
| 45 | + if(value == null) { |
| 46 | + value = new HashMap<>(); |
| 47 | + this.setAdditionalData(value); |
| 48 | + } |
| 49 | + return value; |
| 50 | + } |
| 51 | + /** |
| 52 | + * Gets the additionalMessage property value. The additionalMessage property |
| 53 | + * @return a {@link ChatMessage} |
| 54 | + */ |
| 55 | + @jakarta.annotation.Nullable |
| 56 | + public ChatMessage getAdditionalMessage() { |
| 57 | + return this.backingStore.get("additionalMessage"); |
| 58 | + } |
| 59 | + /** |
| 60 | + * Gets the backingStore property value. Stores model information. |
| 61 | + * @return a {@link BackingStore} |
| 62 | + */ |
| 63 | + @jakarta.annotation.Nonnull |
| 64 | + public BackingStore getBackingStore() { |
| 65 | + return this.backingStore; |
| 66 | + } |
| 67 | + /** |
| 68 | + * The deserialization information for the current model |
| 69 | + * @return a {@link Map<String, java.util.function.Consumer<ParseNode>>} |
| 70 | + */ |
| 71 | + @jakarta.annotation.Nonnull |
| 72 | + public Map<String, java.util.function.Consumer<ParseNode>> getFieldDeserializers() { |
| 73 | + final HashMap<String, java.util.function.Consumer<ParseNode>> deserializerMap = new HashMap<String, java.util.function.Consumer<ParseNode>>(3); |
| 74 | + deserializerMap.put("additionalMessage", (n) -> { this.setAdditionalMessage(n.getObjectValue(ChatMessage::createFromDiscriminatorValue)); }); |
| 75 | + deserializerMap.put("messageIds", (n) -> { this.setMessageIds(n.getCollectionOfPrimitiveValues(String.class)); }); |
| 76 | + deserializerMap.put("targetChatIds", (n) -> { this.setTargetChatIds(n.getCollectionOfPrimitiveValues(String.class)); }); |
| 77 | + return deserializerMap; |
| 78 | + } |
| 79 | + /** |
| 80 | + * Gets the messageIds property value. The messageIds property |
| 81 | + * @return a {@link java.util.List<String>} |
| 82 | + */ |
| 83 | + @jakarta.annotation.Nullable |
| 84 | + public java.util.List<String> getMessageIds() { |
| 85 | + return this.backingStore.get("messageIds"); |
| 86 | + } |
| 87 | + /** |
| 88 | + * Gets the targetChatIds property value. The targetChatIds property |
| 89 | + * @return a {@link java.util.List<String>} |
| 90 | + */ |
| 91 | + @jakarta.annotation.Nullable |
| 92 | + public java.util.List<String> getTargetChatIds() { |
| 93 | + return this.backingStore.get("targetChatIds"); |
| 94 | + } |
| 95 | + /** |
| 96 | + * Serializes information the current object |
| 97 | + * @param writer Serialization writer to use to serialize this model |
| 98 | + */ |
| 99 | + public void serialize(@jakarta.annotation.Nonnull final SerializationWriter writer) { |
| 100 | + Objects.requireNonNull(writer); |
| 101 | + writer.writeObjectValue("additionalMessage", this.getAdditionalMessage()); |
| 102 | + writer.writeCollectionOfPrimitiveValues("messageIds", this.getMessageIds()); |
| 103 | + writer.writeCollectionOfPrimitiveValues("targetChatIds", this.getTargetChatIds()); |
| 104 | + writer.writeAdditionalData(this.getAdditionalData()); |
| 105 | + } |
| 106 | + /** |
| 107 | + * Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. |
| 108 | + * @param value Value to set for the AdditionalData property. |
| 109 | + */ |
| 110 | + public void setAdditionalData(@jakarta.annotation.Nullable final Map<String, Object> value) { |
| 111 | + this.backingStore.set("additionalData", value); |
| 112 | + } |
| 113 | + /** |
| 114 | + * Sets the additionalMessage property value. The additionalMessage property |
| 115 | + * @param value Value to set for the additionalMessage property. |
| 116 | + */ |
| 117 | + public void setAdditionalMessage(@jakarta.annotation.Nullable final ChatMessage value) { |
| 118 | + this.backingStore.set("additionalMessage", value); |
| 119 | + } |
| 120 | + /** |
| 121 | + * Sets the backingStore property value. Stores model information. |
| 122 | + * @param value Value to set for the backingStore property. |
| 123 | + */ |
| 124 | + public void setBackingStore(@jakarta.annotation.Nonnull final BackingStore value) { |
| 125 | + Objects.requireNonNull(value); |
| 126 | + this.backingStore = value; |
| 127 | + } |
| 128 | + /** |
| 129 | + * Sets the messageIds property value. The messageIds property |
| 130 | + * @param value Value to set for the messageIds property. |
| 131 | + */ |
| 132 | + public void setMessageIds(@jakarta.annotation.Nullable final java.util.List<String> value) { |
| 133 | + this.backingStore.set("messageIds", value); |
| 134 | + } |
| 135 | + /** |
| 136 | + * Sets the targetChatIds property value. The targetChatIds property |
| 137 | + * @param value Value to set for the targetChatIds property. |
| 138 | + */ |
| 139 | + public void setTargetChatIds(@jakarta.annotation.Nullable final java.util.List<String> value) { |
| 140 | + this.backingStore.set("targetChatIds", value); |
| 141 | + } |
| 142 | +} |
0 commit comments