Skip to content

Commit

Permalink
feat(generation): update request builders and models
Browse files Browse the repository at this point in the history
Update generated files with build 164424
  • Loading branch information
Microsoft Graph DevX Tooling authored and Microsoft Graph DevX Tooling committed Sep 24, 2024
1 parent c5112c6 commit 0116924
Show file tree
Hide file tree
Showing 98 changed files with 2,754 additions and 674 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package com.microsoft.graph.applications.item.restore;

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 RestorePostRequestBody implements AdditionalDataHolder, BackedModel, Parsable {
/**
* Stores model information.
*/
@jakarta.annotation.Nonnull
protected BackingStore backingStore;
/**
* Instantiates a new {@link RestorePostRequestBody} and sets the default values.
*/
public RestorePostRequestBody() {
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 RestorePostRequestBody}
*/
@jakarta.annotation.Nonnull
public static RestorePostRequestBody createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
Objects.requireNonNull(parseNode);
return new RestorePostRequestBody();
}
/**
* 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 autoReconcileProxyConflict property value. The autoReconcileProxyConflict property
* @return a {@link Boolean}
*/
@jakarta.annotation.Nullable
public Boolean getAutoReconcileProxyConflict() {
return this.backingStore.get("autoReconcileProxyConflict");
}
/**
* 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>>(1);
deserializerMap.put("autoReconcileProxyConflict", (n) -> { this.setAutoReconcileProxyConflict(n.getBooleanValue()); });
return deserializerMap;
}
/**
* 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("autoReconcileProxyConflict", this.getAutoReconcileProxyConflict());
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 autoReconcileProxyConflict property value. The autoReconcileProxyConflict property
* @param value Value to set for the autoReconcileProxyConflict property.
*/
public void setAutoReconcileProxyConflict(@jakarta.annotation.Nullable final Boolean value) {
this.backingStore.set("autoReconcileProxyConflict", 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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,47 +36,54 @@ public RestoreRequestBuilder(@jakarta.annotation.Nonnull final String rawUrl, @j
super(requestAdapter, "{+baseurl}/applications/{application%2Did}/restore", rawUrl);
}
/**
* Restore a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups cannot be restored. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
* Restore a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups can't be restored. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
* @param body The request body
* @return a {@link DirectoryObject}
* @throws ODataError When receiving a 4XX or 5XX status code
* @see <a href="https://learn.microsoft.com/graph/api/directory-deleteditems-restore?view=graph-rest-1.0">Find more info here</a>
*/
@jakarta.annotation.Nullable
public DirectoryObject post() {
return post(null);
public DirectoryObject post(@jakarta.annotation.Nonnull final RestorePostRequestBody body) {
return post(body, null);
}
/**
* Restore a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups cannot be restored. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
* Restore a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups can't be restored. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
* @param body The request body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return a {@link DirectoryObject}
* @throws ODataError When receiving a 4XX or 5XX status code
* @see <a href="https://learn.microsoft.com/graph/api/directory-deleteditems-restore?view=graph-rest-1.0">Find more info here</a>
*/
@jakarta.annotation.Nullable
public DirectoryObject post(@jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) {
final RequestInformation requestInfo = toPostRequestInformation(requestConfiguration);
public DirectoryObject post(@jakarta.annotation.Nonnull final RestorePostRequestBody body, @jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) {
Objects.requireNonNull(body);
final RequestInformation requestInfo = toPostRequestInformation(body, requestConfiguration);
final HashMap<String, ParsableFactory<? extends Parsable>> errorMapping = new HashMap<String, ParsableFactory<? extends Parsable>>();
errorMapping.put("XXX", ODataError::createFromDiscriminatorValue);
return this.requestAdapter.send(requestInfo, errorMapping, DirectoryObject::createFromDiscriminatorValue);
}
/**
* Restore a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups cannot be restored. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
* Restore a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups can't be restored. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
* @param body The request body
* @return a {@link RequestInformation}
*/
@jakarta.annotation.Nonnull
public RequestInformation toPostRequestInformation() {
return toPostRequestInformation(null);
public RequestInformation toPostRequestInformation(@jakarta.annotation.Nonnull final RestorePostRequestBody body) {
return toPostRequestInformation(body, null);
}
/**
* Restore a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups cannot be restored. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
* Restore a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. If an item was accidentally deleted, you can fully restore the item. However, security groups can't be restored. Also, restoring an application doesn't restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted.
* @param body The request body
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return a {@link RequestInformation}
*/
@jakarta.annotation.Nonnull
public RequestInformation toPostRequestInformation(@jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) {
public RequestInformation toPostRequestInformation(@jakarta.annotation.Nonnull final RestorePostRequestBody body, @jakarta.annotation.Nullable final java.util.function.Consumer<PostRequestConfiguration> requestConfiguration) {
Objects.requireNonNull(body);
final RequestInformation requestInfo = new RequestInformation(HttpMethod.POST, urlTemplate, pathParameters);
requestInfo.configure(requestConfiguration, PostRequestConfiguration::new);
requestInfo.headers.tryAdd("Accept", "application/json");
requestInfo.setContentFromParsable(requestAdapter, "application/json", body);
return requestInfo;
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ public void delete(@jakarta.annotation.Nullable final java.util.function.Consume
this.requestAdapter.sendPrimitive(requestInfo, errorMapping, Void.class);
}
/**
* Retrieve a conversationMember from a chat or channel.
* Retrieve a conversationMember from a chat.
* @return a {@link ConversationMember}
* @throws ODataError When receiving a 4XX or 5XX status code
* @see <a href="https://learn.microsoft.com/graph/api/conversationmember-get?view=graph-rest-1.0">Find more info here</a>
* @see <a href="https://learn.microsoft.com/graph/api/chat-get-members?view=graph-rest-1.0">Find more info here</a>
*/
@jakarta.annotation.Nullable
public ConversationMember get() {
return get(null);
}
/**
* Retrieve a conversationMember from a chat or channel.
* Retrieve a conversationMember from a chat.
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return a {@link ConversationMember}
* @throws ODataError When receiving a 4XX or 5XX status code
* @see <a href="https://learn.microsoft.com/graph/api/conversationmember-get?view=graph-rest-1.0">Find more info here</a>
* @see <a href="https://learn.microsoft.com/graph/api/chat-get-members?view=graph-rest-1.0">Find more info here</a>
*/
@jakarta.annotation.Nullable
public ConversationMember get(@jakarta.annotation.Nullable final java.util.function.Consumer<GetRequestConfiguration> requestConfiguration) {
Expand Down Expand Up @@ -126,15 +126,15 @@ public RequestInformation toDeleteRequestInformation(@jakarta.annotation.Nullabl
return requestInfo;
}
/**
* Retrieve a conversationMember from a chat or channel.
* Retrieve a conversationMember from a chat.
* @return a {@link RequestInformation}
*/
@jakarta.annotation.Nonnull
public RequestInformation toGetRequestInformation() {
return toGetRequestInformation(null);
}
/**
* Retrieve a conversationMember from a chat or channel.
* Retrieve a conversationMember from a chat.
* @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return a {@link RequestInformation}
*/
Expand Down Expand Up @@ -186,7 +186,7 @@ public ConversationMemberItemRequestBuilder withUrl(@jakarta.annotation.Nonnull
public class DeleteRequestConfiguration extends BaseRequestConfiguration {
}
/**
* Retrieve a conversationMember from a chat or channel.
* Retrieve a conversationMember from a chat.
*/
@jakarta.annotation.Generated("com.microsoft.kiota")
public class GetQueryParameters implements QueryParameters {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package com.microsoft.graph.contacts.item.restore;

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 RestorePostRequestBody implements AdditionalDataHolder, BackedModel, Parsable {
/**
* Stores model information.
*/
@jakarta.annotation.Nonnull
protected BackingStore backingStore;
/**
* Instantiates a new {@link RestorePostRequestBody} and sets the default values.
*/
public RestorePostRequestBody() {
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 RestorePostRequestBody}
*/
@jakarta.annotation.Nonnull
public static RestorePostRequestBody createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
Objects.requireNonNull(parseNode);
return new RestorePostRequestBody();
}
/**
* 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 autoReconcileProxyConflict property value. The autoReconcileProxyConflict property
* @return a {@link Boolean}
*/
@jakarta.annotation.Nullable
public Boolean getAutoReconcileProxyConflict() {
return this.backingStore.get("autoReconcileProxyConflict");
}
/**
* 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>>(1);
deserializerMap.put("autoReconcileProxyConflict", (n) -> { this.setAutoReconcileProxyConflict(n.getBooleanValue()); });
return deserializerMap;
}
/**
* 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("autoReconcileProxyConflict", this.getAutoReconcileProxyConflict());
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 autoReconcileProxyConflict property value. The autoReconcileProxyConflict property
* @param value Value to set for the autoReconcileProxyConflict property.
*/
public void setAutoReconcileProxyConflict(@jakarta.annotation.Nullable final Boolean value) {
this.backingStore.set("autoReconcileProxyConflict", 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;
}
}
Loading

0 comments on commit 0116924

Please sign in to comment.