Skip to content

Commit 7fe8eaf

Browse files
authored
Merge pull request #2298 from microsoftgraph/feat/change-notification
feat: add ChangeNotification models
2 parents 592e954 + d87449d commit 7fe8eaf

8 files changed

+859
-3
lines changed

gradle/dependencies.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
dependencies {
2-
2+
33
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
44
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
55

66
// Core Http library
7-
api 'com.microsoft.graph:microsoft-graph-core:3.5.0'
8-
7+
api 'com.microsoft.graph:microsoft-graph-core:3.6.0'
8+
99
implementation 'com.microsoft.kiota:microsoft-kiota-authentication-azure:1.8.2'
1010
implementation 'com.microsoft.kiota:microsoft-kiota-http-okHttp:1.8.2'
1111
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:1.8.2'
Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
package com.microsoft.graph.models;
2+
3+
import com.microsoft.graph.core.models.EncryptedContentBearer;
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.time.OffsetDateTime;
12+
import java.util.HashMap;
13+
import java.util.Map;
14+
import java.util.Objects;
15+
16+
/**
17+
* The {@link ChangeNotification} model with information on the change notification.
18+
*/
19+
public class ChangeNotification implements EncryptedContentBearer<ChangeNotificationEncryptedContent>, AdditionalDataHolder, BackedModel, Parsable {
20+
/**
21+
* Stores model information.
22+
*/
23+
@jakarta.annotation.Nonnull
24+
protected BackingStore backingStore;
25+
/**
26+
* Instantiates a new {@link ChangeNotification} and sets the default values.
27+
*/
28+
public ChangeNotification() {
29+
this.backingStore = BackingStoreFactorySingleton.instance.createBackingStore();
30+
this.setAdditionalData(new HashMap<>());
31+
}
32+
/**
33+
* Creates a new instance of the appropriate class based on discriminator value
34+
* @param parseNode The parse node to use to read the discriminator value and create the object
35+
* @return a {@link ChangeNotification}
36+
*/
37+
@jakarta.annotation.Nonnull
38+
public static ChangeNotification createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
39+
Objects.requireNonNull(parseNode);
40+
return new ChangeNotification();
41+
}
42+
/**
43+
* Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
44+
* @return a {@link Map<String, Object>}
45+
*/
46+
@jakarta.annotation.Nonnull
47+
public Map<String, Object> getAdditionalData() {
48+
Map<String, Object> value = this.backingStore.get("additionalData");
49+
if(value == null) {
50+
value = new HashMap<>();
51+
this.setAdditionalData(value);
52+
}
53+
return value;
54+
}
55+
/**
56+
* Gets the backingStore property value. Stores model information.
57+
* @return a {@link BackingStore}
58+
*/
59+
@jakarta.annotation.Nonnull
60+
public BackingStore getBackingStore() {
61+
return this.backingStore;
62+
}
63+
/**
64+
* Gets the changeType property value. The changeType property
65+
* @return a {@link ChangeType}
66+
*/
67+
@jakarta.annotation.Nullable
68+
public ChangeType getChangeType() {
69+
return this.backingStore.get("changeType");
70+
}
71+
/**
72+
* Gets the clientState property value. The clientState property
73+
* @return a {@link String}
74+
*/
75+
@jakarta.annotation.Nullable
76+
public String getClientState() {
77+
return this.backingStore.get("clientState");
78+
}
79+
/**
80+
* Gets the encryptedContent property value. The encryptedContent property
81+
* @return a {@link ChangeNotificationEncryptedContent}
82+
*/
83+
@jakarta.annotation.Nullable
84+
public ChangeNotificationEncryptedContent getEncryptedContent() {
85+
return this.backingStore.get("encryptedContent");
86+
}
87+
/**
88+
* The deserialization information for the current model
89+
* @return a {@link Map<String, java.util.function.Consumer<ParseNode>>}
90+
*/
91+
@jakarta.annotation.Nonnull
92+
public Map<String, java.util.function.Consumer<ParseNode>> getFieldDeserializers() {
93+
final HashMap<String, java.util.function.Consumer<ParseNode>> deserializerMap = new HashMap<String, java.util.function.Consumer<ParseNode>>(11);
94+
deserializerMap.put("changeType", (n) -> { this.setChangeType(n.getEnumValue(ChangeType::forValue)); });
95+
deserializerMap.put("clientState", (n) -> { this.setClientState(n.getStringValue()); });
96+
deserializerMap.put("encryptedContent", (n) -> { this.setEncryptedContent(n.getObjectValue(ChangeNotificationEncryptedContent::createFromDiscriminatorValue)); });
97+
deserializerMap.put("id", (n) -> { this.setId(n.getStringValue()); });
98+
deserializerMap.put("lifecycleEvent", (n) -> { this.setLifecycleEvent(n.getEnumValue(LifecycleEventType::forValue)); });
99+
deserializerMap.put("@odata.type", (n) -> { this.setOdataType(n.getStringValue()); });
100+
deserializerMap.put("resource", (n) -> { this.setResource(n.getStringValue()); });
101+
deserializerMap.put("resourceData", (n) -> { this.setResourceData(n.getObjectValue(ResourceData::createFromDiscriminatorValue)); });
102+
deserializerMap.put("subscriptionExpirationDateTime", (n) -> { this.setSubscriptionExpirationDateTime(n.getOffsetDateTimeValue()); });
103+
deserializerMap.put("subscriptionId", (n) -> { this.setSubscriptionId(n.getStringValue()); });
104+
deserializerMap.put("tenantId", (n) -> { this.setTenantId(n.getStringValue()); });
105+
return deserializerMap;
106+
}
107+
/**
108+
* Gets the id property value. The id property
109+
* @return a {@link String}
110+
*/
111+
@jakarta.annotation.Nullable
112+
public String getId() {
113+
return this.backingStore.get("id");
114+
}
115+
/**
116+
* Gets the lifecycleEvent property value. The lifecycleEvent property
117+
* @return a {@link LifecycleEventType}
118+
*/
119+
@jakarta.annotation.Nullable
120+
public LifecycleEventType getLifecycleEvent() {
121+
return this.backingStore.get("lifecycleEvent");
122+
}
123+
/**
124+
* Gets the @odata.type property value. The OdataType property
125+
* @return a {@link String}
126+
*/
127+
@jakarta.annotation.Nullable
128+
public String getOdataType() {
129+
return this.backingStore.get("odataType");
130+
}
131+
/**
132+
* Gets the resource property value. The resource property
133+
* @return a {@link String}
134+
*/
135+
@jakarta.annotation.Nullable
136+
public String getResource() {
137+
return this.backingStore.get("resource");
138+
}
139+
/**
140+
* Gets the resourceData property value. The resourceData property
141+
* @return a {@link ResourceData}
142+
*/
143+
@jakarta.annotation.Nullable
144+
public ResourceData getResourceData() {
145+
return this.backingStore.get("resourceData");
146+
}
147+
/**
148+
* Gets the subscriptionExpirationDateTime property value. The subscriptionExpirationDateTime property
149+
* @return a {@link OffsetDateTime}
150+
*/
151+
@jakarta.annotation.Nullable
152+
public OffsetDateTime getSubscriptionExpirationDateTime() {
153+
return this.backingStore.get("subscriptionExpirationDateTime");
154+
}
155+
/**
156+
* Gets the subscriptionId property value. The subscriptionId property
157+
* @return a {@link String}
158+
*/
159+
@jakarta.annotation.Nullable
160+
public String getSubscriptionId() {
161+
return this.backingStore.get("subscriptionId");
162+
}
163+
/**
164+
* Gets the tenantId property value. The tenantId property
165+
* @return a {@link String}
166+
*/
167+
@jakarta.annotation.Nullable
168+
public String getTenantId() {
169+
return this.backingStore.get("tenantId");
170+
}
171+
/**
172+
* Serializes information the current object
173+
* @param writer Serialization writer to use to serialize this model
174+
*/
175+
public void serialize(@jakarta.annotation.Nonnull final SerializationWriter writer) {
176+
Objects.requireNonNull(writer);
177+
writer.writeEnumValue("changeType", this.getChangeType());
178+
writer.writeStringValue("clientState", this.getClientState());
179+
writer.writeObjectValue("encryptedContent", this.getEncryptedContent());
180+
writer.writeStringValue("id", this.getId());
181+
writer.writeEnumValue("lifecycleEvent", this.getLifecycleEvent());
182+
writer.writeStringValue("@odata.type", this.getOdataType());
183+
writer.writeStringValue("resource", this.getResource());
184+
writer.writeObjectValue("resourceData", this.getResourceData());
185+
writer.writeOffsetDateTimeValue("subscriptionExpirationDateTime", this.getSubscriptionExpirationDateTime());
186+
writer.writeStringValue("subscriptionId", this.getSubscriptionId());
187+
writer.writeStringValue("tenantId", this.getTenantId());
188+
writer.writeAdditionalData(this.getAdditionalData());
189+
}
190+
/**
191+
* Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
192+
* @param value Value to set for the AdditionalData property.
193+
*/
194+
public void setAdditionalData(@jakarta.annotation.Nullable final Map<String, Object> value) {
195+
this.backingStore.set("additionalData", value);
196+
}
197+
/**
198+
* Sets the backingStore property value. Stores model information.
199+
* @param value Value to set for the backingStore property.
200+
*/
201+
public void setBackingStore(@jakarta.annotation.Nonnull final BackingStore value) {
202+
Objects.requireNonNull(value);
203+
this.backingStore = value;
204+
}
205+
/**
206+
* Sets the changeType property value. The changeType property
207+
* @param value Value to set for the changeType property.
208+
*/
209+
public void setChangeType(@jakarta.annotation.Nullable final ChangeType value) {
210+
this.backingStore.set("changeType", value);
211+
}
212+
/**
213+
* Sets the clientState property value. The clientState property
214+
* @param value Value to set for the clientState property.
215+
*/
216+
public void setClientState(@jakarta.annotation.Nullable final String value) {
217+
this.backingStore.set("clientState", value);
218+
}
219+
/**
220+
* Sets the encryptedContent property value. The encryptedContent property
221+
* @param value Value to set for the encryptedContent property.
222+
*/
223+
public void setEncryptedContent(@jakarta.annotation.Nullable final ChangeNotificationEncryptedContent value) {
224+
this.backingStore.set("encryptedContent", value);
225+
}
226+
/**
227+
* Sets the id property value. The id property
228+
* @param value Value to set for the id property.
229+
*/
230+
public void setId(@jakarta.annotation.Nullable final String value) {
231+
this.backingStore.set("id", value);
232+
}
233+
/**
234+
* Sets the lifecycleEvent property value. The lifecycleEvent property
235+
* @param value Value to set for the lifecycleEvent property.
236+
*/
237+
public void setLifecycleEvent(@jakarta.annotation.Nullable final LifecycleEventType value) {
238+
this.backingStore.set("lifecycleEvent", value);
239+
}
240+
/**
241+
* Sets the @odata.type property value. The OdataType property
242+
* @param value Value to set for the @odata.type property.
243+
*/
244+
public void setOdataType(@jakarta.annotation.Nullable final String value) {
245+
this.backingStore.set("odataType", value);
246+
}
247+
/**
248+
* Sets the resource property value. The resource property
249+
* @param value Value to set for the resource property.
250+
*/
251+
public void setResource(@jakarta.annotation.Nullable final String value) {
252+
this.backingStore.set("resource", value);
253+
}
254+
/**
255+
* Sets the resourceData property value. The resourceData property
256+
* @param value Value to set for the resourceData property.
257+
*/
258+
public void setResourceData(@jakarta.annotation.Nullable final ResourceData value) {
259+
this.backingStore.set("resourceData", value);
260+
}
261+
/**
262+
* Sets the subscriptionExpirationDateTime property value. The subscriptionExpirationDateTime property
263+
* @param value Value to set for the subscriptionExpirationDateTime property.
264+
*/
265+
public void setSubscriptionExpirationDateTime(@jakarta.annotation.Nullable final OffsetDateTime value) {
266+
this.backingStore.set("subscriptionExpirationDateTime", value);
267+
}
268+
/**
269+
* Sets the subscriptionId property value. The subscriptionId property
270+
* @param value Value to set for the subscriptionId property.
271+
*/
272+
public void setSubscriptionId(@jakarta.annotation.Nullable final String value) {
273+
this.backingStore.set("subscriptionId", value);
274+
}
275+
/**
276+
* Sets the tenantId property value. The tenantId property
277+
* @param value Value to set for the tenantId property.
278+
*/
279+
public void setTenantId(@jakarta.annotation.Nullable final String value) {
280+
this.backingStore.set("tenantId", value);
281+
}
282+
}

0 commit comments

Comments
 (0)