-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
230 additions
and
0 deletions.
There are no files selected for viewing
127 changes: 127 additions & 0 deletions
127
...abstractions/src/test/java/com/microsoft/kiota/BaseCollectionPaginationCountResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
package com.microsoft.kiota; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
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; | ||
|
||
public class BaseCollectionPaginationCountResponse implements AdditionalDataHolder, BackedModel, Parsable { | ||
|
||
/** | ||
* Stores model information. | ||
*/ | ||
@jakarta.annotation.Nonnull | ||
protected BackingStore backingStore; | ||
/** | ||
* Instantiates a new {@link BaseCollectionPaginationCountResponse} and sets the default values. | ||
*/ | ||
public BaseCollectionPaginationCountResponse() { | ||
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 BaseCollectionPaginationCountResponse} | ||
*/ | ||
@jakarta.annotation.Nonnull | ||
public static BaseCollectionPaginationCountResponse createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) { | ||
Objects.requireNonNull(parseNode); | ||
return new BaseCollectionPaginationCountResponse(); | ||
} | ||
/** | ||
* 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 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<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>>(2); | ||
deserializerMap.put("@odata.count", (n) -> { this.setOdataCount(n.getLongValue()); }); | ||
deserializerMap.put("@odata.nextLink", (n) -> { this.setOdataNextLink(n.getStringValue()); }); | ||
return deserializerMap; | ||
} | ||
/** | ||
* Gets the @odata.count property value. The OdataCount property | ||
* @return a {@link Long} | ||
*/ | ||
@jakarta.annotation.Nullable | ||
public Long getOdataCount() { | ||
return this.backingStore.get("odataCount"); | ||
} | ||
/** | ||
* Gets the @odata.nextLink property value. The OdataNextLink property | ||
* @return a {@link String} | ||
*/ | ||
@jakarta.annotation.Nullable | ||
public String getOdataNextLink() { | ||
return this.backingStore.get("odataNextLink"); | ||
} | ||
/** | ||
* 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.writeLongValue("@odata.count", this.getOdataCount()); | ||
writer.writeStringValue("@odata.nextLink", this.getOdataNextLink()); | ||
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 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 @odata.count property value. The OdataCount property | ||
* @param value Value to set for the @odata.count property. | ||
*/ | ||
public void setOdataCount(@jakarta.annotation.Nullable final Long value) { | ||
this.backingStore.set("odataCount", value); | ||
} | ||
/** | ||
* Sets the @odata.nextLink property value. The OdataNextLink property | ||
* @param value Value to set for the @odata.nextLink property. | ||
*/ | ||
public void setOdataNextLink(@jakarta.annotation.Nullable final String value) { | ||
this.backingStore.set("odataNextLink", value); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
components/abstractions/src/test/java/com/microsoft/kiota/TestEntityCollectionResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.microsoft.kiota; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
|
||
import com.microsoft.kiota.serialization.Parsable; | ||
import com.microsoft.kiota.serialization.ParseNode; | ||
import com.microsoft.kiota.serialization.SerializationWriter; | ||
|
||
public class TestEntityCollectionResponse extends BaseCollectionPaginationCountResponse implements Parsable { | ||
|
||
/** | ||
* Instantiates a new {@link TestEntityCollectionResponse} and sets the default values. | ||
*/ | ||
public TestEntityCollectionResponse() { | ||
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 TestEntityCollectionResponse} | ||
*/ | ||
@jakarta.annotation.Nonnull | ||
public static TestEntityCollectionResponse createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) { | ||
Objects.requireNonNull(parseNode); | ||
return new TestEntityCollectionResponse(); | ||
} | ||
/** | ||
* 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>>(super.getFieldDeserializers()); | ||
deserializerMap.put("value", (n) -> { this.setValue(n.getCollectionOfObjectValues(TestEntity::createFromDiscriminatorValue)); }); | ||
return deserializerMap; | ||
} | ||
/** | ||
* Gets the value property value. The value property | ||
* @return a {@link java.util.List<TestEntity>} | ||
*/ | ||
@jakarta.annotation.Nullable | ||
public java.util.List<TestEntity> getValue() { | ||
return this.backingStore.get("value"); | ||
} | ||
/** | ||
* 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.writeCollectionOfObjectValues("value", this.getValue()); | ||
} | ||
/** | ||
* Sets the value property value. The value property | ||
* @param value Value to set for the value property. | ||
*/ | ||
public void setValue(@jakarta.annotation.Nullable final java.util.List<TestEntity> value) { | ||
this.backingStore.set("value", value); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters