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 175190
  • Loading branch information
Microsoft Graph DevX Tooling authored and Microsoft Graph DevX Tooling committed Dec 31, 2024
1 parent 340d420 commit 43a031f
Show file tree
Hide file tree
Showing 136 changed files with 4,137 additions and 225 deletions.
8 changes: 8 additions & 0 deletions src/Generated/Chats/Item/Members/MembersRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Microsoft\Graph\Generated\Chats\Item\Members\Add\AddRequestBuilder;
use Microsoft\Graph\Generated\Chats\Item\Members\Count\CountRequestBuilder;
use Microsoft\Graph\Generated\Chats\Item\Members\Item\ConversationMemberItemRequestBuilder;
use Microsoft\Graph\Generated\Chats\Item\Members\Remove\RemoveRequestBuilder;
use Microsoft\Graph\Generated\Models\ConversationMember;
use Microsoft\Graph\Generated\Models\ConversationMemberCollectionResponse;
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
Expand Down Expand Up @@ -34,6 +35,13 @@ public function count(): CountRequestBuilder {
return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to call the remove method.
*/
public function remove(): RemoveRequestBuilder {
return new RemoveRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to manage the members property of the microsoft.graph.chat entity.
* @param string $conversationMemberId The unique identifier of conversationMember
Expand Down
118 changes: 118 additions & 0 deletions src/Generated/Chats/Item/Members/Remove/RemovePostRequestBody.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?php

namespace Microsoft\Graph\Generated\Chats\Item\Members\Remove;

use Microsoft\Graph\Generated\Models\ConversationMember;
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;
use Microsoft\Kiota\Abstractions\Types\TypeUtils;

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

/**
* Instantiates a new RemovePostRequestBody 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 RemovePostRequestBody
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): RemovePostRequestBody {
return new RemovePostRequestBody();
}

/**
* 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 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 [
'values' => fn(ParseNode $n) => $o->setValues($n->getCollectionOfObjectValues([ConversationMember::class, 'createFromDiscriminatorValue'])),
];
}

/**
* Gets the values property value. The values property
* @return array<ConversationMember>|null
*/
public function getValues(): ?array {
$val = $this->getBackingStore()->get('values');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, ConversationMember::class);
/** @var array<ConversationMember>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'values'");
}

/**
* Serializes information the current object
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void {
$writer->writeCollectionOfObjectValues('values', $this->getValues());
$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 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;
}

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

}
72 changes: 72 additions & 0 deletions src/Generated/Chats/Item/Members/Remove/RemovePostResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace Microsoft\Graph\Generated\Chats\Item\Members\Remove;

use Microsoft\Graph\Generated\Models\ActionResultPart;
use Microsoft\Graph\Generated\Models\BaseCollectionPaginationCountResponse;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
use Microsoft\Kiota\Abstractions\Types\TypeUtils;

class RemovePostResponse extends BaseCollectionPaginationCountResponse implements Parsable
{
/**
* Instantiates a new RemovePostResponse and sets the default values.
*/
public function __construct() {
parent::__construct();
}

/**
* 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 RemovePostResponse
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): RemovePostResponse {
return new RemovePostResponse();
}

/**
* The deserialization information for the current model
* @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array {
$o = $this;
return array_merge(parent::getFieldDeserializers(), [
'value' => fn(ParseNode $n) => $o->setValue($n->getCollectionOfObjectValues([ActionResultPart::class, 'createFromDiscriminatorValue'])),
]);
}

/**
* Gets the value property value. The value property
* @return array<ActionResultPart>|null
*/
public function getValue(): ?array {
$val = $this->getBackingStore()->get('value');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, ActionResultPart::class);
/** @var array<ActionResultPart>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'value'");
}

/**
* Serializes information the current object
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void {
parent::serialize($writer);
$writer->writeCollectionOfObjectValues('value', $this->getValue());
}

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

}
77 changes: 77 additions & 0 deletions src/Generated/Chats/Item/Members/Remove/RemoveRequestBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

namespace Microsoft\Graph\Generated\Chats\Item\Members\Remove;

use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
use Microsoft\Kiota\Abstractions\HttpMethod;
use Microsoft\Kiota\Abstractions\RequestAdapter;
use Microsoft\Kiota\Abstractions\RequestInformation;

/**
* Provides operations to call the remove method.
*/
class RemoveRequestBuilder extends BaseRequestBuilder
{
/**
* Instantiates a new RemoveRequestBuilder and sets the default values.
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
*/
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
parent::__construct($requestAdapter, [], '{+baseurl}/chats/{chat%2Did}/members/remove');
if (is_array($pathParametersOrRawUrl)) {
$this->pathParameters = $pathParametersOrRawUrl;
} else {
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
}
}

/**
* Remove multiple members from a team in a single request. The response provides details about which memberships could and couldn't be removed.
* @param RemovePostRequestBody $body The request body
* @param RemoveRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<RemovePostResponse|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/conversationmember-remove?view=graph-rest-1.0 Find more info here
*/
public function post(RemovePostRequestBody $body, ?RemoveRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [RemovePostResponse::class, 'createFromDiscriminatorValue'], $errorMappings);
}

/**
* Remove multiple members from a team in a single request. The response provides details about which memberships could and couldn't be removed.
* @param RemovePostRequestBody $body The request body
* @param RemoveRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toPostRequestInformation(RemovePostRequestBody $body, ?RemoveRequestBuilderPostRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::POST;
if ($requestConfiguration !== null) {
$requestInfo->addHeaders($requestConfiguration->headers);
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json");
$requestInfo->setContentFromParsable($this->requestAdapter, "application/json", $body);
return $requestInfo;
}

/**
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
* @param string $rawUrl The raw URL to use for the request builder.
* @return RemoveRequestBuilder
*/
public function withUrl(string $rawUrl): RemoveRequestBuilder {
return new RemoveRequestBuilder($rawUrl, $this->requestAdapter);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Microsoft\Graph\Generated\Chats\Item\Members\Remove;

use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
use Microsoft\Kiota\Abstractions\RequestOption;

/**
* Configuration for the request such as headers, query parameters, and middleware options.
*/
class RemoveRequestBuilderPostRequestConfiguration extends BaseRequestConfiguration
{
/**
* Instantiates a new RemoveRequestBuilderPostRequestConfiguration and sets the default values.
* @param array<string, array<string>|string>|null $headers Request headers
* @param array<RequestOption>|null $options Request options
*/
public function __construct(?array $headers = null, ?array $options = null) {
parent::__construct($headers ?? [], $options ?? []);
}

}
6 changes: 3 additions & 3 deletions src/Generated/Chats/Item/Messages/MessagesRequestBuilder.php
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 @@ -155,7 +155,7 @@ public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdap
* @param DeviceAppManagementRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<DeviceAppManagement|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/intune-books-deviceappmanagement-get?view=graph-rest-1.0 Find more info here
* @link https://learn.microsoft.com/graph/api/intune-partnerintegration-deviceappmanagement-get?view=graph-rest-1.0 Find more info here
*/
public function get(?DeviceAppManagementRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
Expand All @@ -171,7 +171,7 @@ public function get(?DeviceAppManagementRequestBuilderGetRequestConfiguration $r
* @param DeviceAppManagementRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<DeviceAppManagement|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/intune-partnerintegration-deviceappmanagement-update?view=graph-rest-1.0 Find more info here
* @link https://learn.microsoft.com/graph/api/intune-unlock-deviceappmanagement-update?view=graph-rest-1.0 Find more info here
*/
public function patch(DeviceAppManagement $body, ?DeviceAppManagementRequestBuilderPatchRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPatchRequestInformation($body, $requestConfiguration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdap
}

/**
* List properties and relationships of the targetedManagedAppProtection objects.
* List properties and relationships of the managedAppProtection objects.
* @param ManagedAppPoliciesRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<ManagedAppPolicyCollectionResponse|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/intune-mam-targetedmanagedappprotection-list?view=graph-rest-1.0 Find more info here
* @link https://learn.microsoft.com/graph/api/intune-mam-managedappprotection-list?view=graph-rest-1.0 Find more info here
*/
public function get(?ManagedAppPoliciesRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
Expand All @@ -82,7 +82,7 @@ public function post(ManagedAppPolicy $body, ?ManagedAppPoliciesRequestBuilderPo
}

/**
* List properties and relationships of the targetedManagedAppProtection objects.
* List properties and relationships of the managedAppProtection objects.
* @param ManagedAppPoliciesRequestBuilderGetRequestConfiguration|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;

/**
* List properties and relationships of the targetedManagedAppProtection objects.
* List properties and relationships of the managedAppProtection objects.
*/
class ManagedAppPoliciesRequestBuilderGetQueryParameters
{
Expand Down
Loading

0 comments on commit 43a031f

Please sign in to comment.