Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated models and request builders #1581

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions src/Generated/Applications/Item/Restore/RestorePostRequestBody.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?php

namespace Microsoft\Graph\Generated\Applications\Item\Restore;

use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
use Microsoft\Kiota\Abstractions\Store\BackedModel;
use Microsoft\Kiota\Abstractions\Store\BackingStore;
use Microsoft\Kiota\Abstractions\Store\BackingStoreFactorySingleton;

class RestorePostRequestBody implements AdditionalDataHolder, BackedModel, Parsable
{
/**
* @var BackingStore $backingStore Stores model information.
*/
private BackingStore $backingStore;

/**
* Instantiates a new RestorePostRequestBody and sets the default values.
*/
public function __construct() {
$this->backingStore = BackingStoreFactorySingleton::getInstance()->createBackingStore();
$this->setAdditionalData([]);
}

/**
* Creates a new instance of the appropriate class based on discriminator value
* @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object
* @return RestorePostRequestBody
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): RestorePostRequestBody {
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 array<string, mixed>|null
*/
public function getAdditionalData(): ?array {
$val = $this->getBackingStore()->get('additionalData');
if (is_null($val) || is_array($val)) {
/** @var array<string, mixed>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'additionalData'");
}

/**
* Gets the autoReconcileProxyConflict property value. The autoReconcileProxyConflict property
* @return bool|null
*/
public function getAutoReconcileProxyConflict(): ?bool {
$val = $this->getBackingStore()->get('autoReconcileProxyConflict');
if (is_null($val) || is_bool($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'autoReconcileProxyConflict'");
}

/**
* Gets the BackingStore property value. Stores model information.
* @return BackingStore
*/
public function getBackingStore(): BackingStore {
return $this->backingStore;
}

/**
* The deserialization information for the current model
* @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array {
$o = $this;
return [
'autoReconcileProxyConflict' => fn(ParseNode $n) => $o->setAutoReconcileProxyConflict($n->getBooleanValue()),
];
}

/**
* Serializes information the current object
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void {
$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 array<string,mixed> $value Value to set for the AdditionalData property.
*/
public function setAdditionalData(?array $value): void {
$this->getBackingStore()->set('additionalData', $value);
}

/**
* Sets the autoReconcileProxyConflict property value. The autoReconcileProxyConflict property
* @param bool|null $value Value to set for the autoReconcileProxyConflict property.
*/
public function setAutoReconcileProxyConflict(?bool $value): void {
$this->getBackingStore()->set('autoReconcileProxyConflict', $value);
}

/**
* Sets the BackingStore property value. Stores model information.
* @param BackingStore $value Value to set for the BackingStore property.
*/
public function setBackingStore(BackingStore $value): void {
$this->backingStore = $value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,28 @@ public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdap
}

/**
* 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 RestorePostRequestBody $body The request body
* @param RestoreRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<DirectoryObject|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/directory-deleteditems-restore?view=graph-rest-1.0 Find more info here
*/
public function post(?RestoreRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPostRequestInformation($requestConfiguration);
public function post(RestorePostRequestBody $body, ?RestoreRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [DirectoryObject::class, 'createFromDiscriminatorValue'], $errorMappings);
}

/**
* 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 RestorePostRequestBody $body The request body
* @param RestoreRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toPostRequestInformation(?RestoreRequestBuilderPostRequestConfiguration $requestConfiguration = null): RequestInformation {
public function toPostRequestInformation(RestorePostRequestBody $body, ?RestoreRequestBuilderPostRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
Expand All @@ -60,6 +62,7 @@ public function toPostRequestInformation(?RestoreRequestBuilderPostRequestConfig
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json");
$requestInfo->setContentFromParsable($this->requestAdapter, "application/json", $body);
return $requestInfo;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public function delete(?ConversationMemberItemRequestBuilderDeleteRequestConfigu
}

/**
* Retrieve a conversationMember from a chat or channel.
* Retrieve a conversationMember from a chat.
* @param ConversationMemberItemRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<ConversationMember|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/conversationmember-get?view=graph-rest-1.0 Find more info here
* @link https://learn.microsoft.com/graph/api/chat-get-members?view=graph-rest-1.0 Find more info here
*/
public function get(?ConversationMemberItemRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
Expand Down Expand Up @@ -94,7 +94,7 @@ public function toDeleteRequestInformation(?ConversationMemberItemRequestBuilder
}

/**
* Retrieve a conversationMember from a chat or channel.
* Retrieve a conversationMember from a chat.
* @param ConversationMemberItemRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Microsoft\Kiota\Abstractions\QueryParameter;

/**
* Retrieve a conversationMember from a chat or channel.
* Retrieve a conversationMember from a chat.
*/
class ConversationMemberItemRequestBuilderGetQueryParameters
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ public function get(?MessagesRequestBuilderGetRequestConfiguration $requestConfi
}

/**
* Send a new chatMessage in the specified channel or a chat.
* Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
* @param ChatMessage $body The request body
* @param MessagesRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<ChatMessage|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/chatmessage-post?view=graph-rest-1.0 Find more info here
* @link https://learn.microsoft.com/graph/api/chat-post-messages?view=graph-rest-1.0 Find more info here
*/
public function post(ChatMessage $body, ?MessagesRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration);
Expand Down Expand Up @@ -112,7 +112,7 @@ public function toGetRequestInformation(?MessagesRequestBuilderGetRequestConfigu
}

/**
* Send a new chatMessage in the specified channel or a chat.
* Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
* @param ChatMessage $body The request body
* @param MessagesRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdap
}

/**
* Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
* Invite participants to the active call. For more information about how to handle operations, see commsOperation.
* @param InvitePostRequestBody $body The request body
* @param InviteRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<InviteParticipantsOperation|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/participant-delete?view=graph-rest-1.0 Find more info here
* @link https://learn.microsoft.com/graph/api/participant-invite?view=graph-rest-1.0 Find more info here
*/
public function post(InvitePostRequestBody $body, ?InviteRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration);
Expand All @@ -47,7 +47,7 @@ public function post(InvitePostRequestBody $body, ?InviteRequestBuilderPostReque
}

/**
* Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
* Invite participants to the active call. For more information about how to handle operations, see commsOperation.
* @param InvitePostRequestBody $body The request body
* @param InviteRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
Expand Down
114 changes: 114 additions & 0 deletions src/Generated/Contacts/Item/Restore/RestorePostRequestBody.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?php

namespace Microsoft\Graph\Generated\Contacts\Item\Restore;

use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
use Microsoft\Kiota\Abstractions\Store\BackedModel;
use Microsoft\Kiota\Abstractions\Store\BackingStore;
use Microsoft\Kiota\Abstractions\Store\BackingStoreFactorySingleton;

class RestorePostRequestBody implements AdditionalDataHolder, BackedModel, Parsable
{
/**
* @var BackingStore $backingStore Stores model information.
*/
private BackingStore $backingStore;

/**
* Instantiates a new RestorePostRequestBody and sets the default values.
*/
public function __construct() {
$this->backingStore = BackingStoreFactorySingleton::getInstance()->createBackingStore();
$this->setAdditionalData([]);
}

/**
* Creates a new instance of the appropriate class based on discriminator value
* @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object
* @return RestorePostRequestBody
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): RestorePostRequestBody {
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 array<string, mixed>|null
*/
public function getAdditionalData(): ?array {
$val = $this->getBackingStore()->get('additionalData');
if (is_null($val) || is_array($val)) {
/** @var array<string, mixed>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'additionalData'");
}

/**
* Gets the autoReconcileProxyConflict property value. The autoReconcileProxyConflict property
* @return bool|null
*/
public function getAutoReconcileProxyConflict(): ?bool {
$val = $this->getBackingStore()->get('autoReconcileProxyConflict');
if (is_null($val) || is_bool($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'autoReconcileProxyConflict'");
}

/**
* Gets the BackingStore property value. Stores model information.
* @return BackingStore
*/
public function getBackingStore(): BackingStore {
return $this->backingStore;
}

/**
* The deserialization information for the current model
* @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array {
$o = $this;
return [
'autoReconcileProxyConflict' => fn(ParseNode $n) => $o->setAutoReconcileProxyConflict($n->getBooleanValue()),
];
}

/**
* Serializes information the current object
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void {
$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 array<string,mixed> $value Value to set for the AdditionalData property.
*/
public function setAdditionalData(?array $value): void {
$this->getBackingStore()->set('additionalData', $value);
}

/**
* Sets the autoReconcileProxyConflict property value. The autoReconcileProxyConflict property
* @param bool|null $value Value to set for the autoReconcileProxyConflict property.
*/
public function setAutoReconcileProxyConflict(?bool $value): void {
$this->getBackingStore()->set('autoReconcileProxyConflict', $value);
}

/**
* Sets the BackingStore property value. Stores model information.
* @param BackingStore $value Value to set for the BackingStore property.
*/
public function setBackingStore(BackingStore $value): void {
$this->backingStore = $value;
}

}
Loading