-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathChatItemRequestBuilder.php
More file actions
283 lines (255 loc) · 13.8 KB
/
ChatItemRequestBuilder.php
File metadata and controls
283 lines (255 loc) · 13.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<?php
namespace Microsoft\Graph\Beta\Generated\Chats\Item;
use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\Beta\Generated\Chats\Item\CompleteMigration\CompleteMigrationRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\HideForUser\HideForUserRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\InstalledApps\InstalledAppsRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\LastMessagePreview\LastMessagePreviewRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\MarkChatReadForUser\MarkChatReadForUserRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\MarkChatUnreadForUser\MarkChatUnreadForUserRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\Members\MembersRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\Messages\MessagesRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\Operations\OperationsRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\PermissionGrants\PermissionGrantsRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\PinnedMessages\PinnedMessagesRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\RemoveAllAccessForUser\RemoveAllAccessForUserRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\SendActivityNotification\SendActivityNotificationRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\StartMigration\StartMigrationRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\Tabs\TabsRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\TargetedMessages\TargetedMessagesRequestBuilder;
use Microsoft\Graph\Beta\Generated\Chats\Item\UnhideForUser\UnhideForUserRequestBuilder;
use Microsoft\Graph\Beta\Generated\Models\Chat;
use Microsoft\Graph\Beta\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 manage the collection of chat entities.
*/
class ChatItemRequestBuilder extends BaseRequestBuilder
{
/**
* Provides operations to call the completeMigration method.
*/
public function completeMigration(): CompleteMigrationRequestBuilder {
return new CompleteMigrationRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to call the hideForUser method.
*/
public function hideForUser(): HideForUserRequestBuilder {
return new HideForUserRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to manage the installedApps property of the microsoft.graph.chat entity.
*/
public function installedApps(): InstalledAppsRequestBuilder {
return new InstalledAppsRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to manage the lastMessagePreview property of the microsoft.graph.chat entity.
*/
public function lastMessagePreview(): LastMessagePreviewRequestBuilder {
return new LastMessagePreviewRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to call the markChatReadForUser method.
*/
public function markChatReadForUser(): MarkChatReadForUserRequestBuilder {
return new MarkChatReadForUserRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to call the markChatUnreadForUser method.
*/
public function markChatUnreadForUser(): MarkChatUnreadForUserRequestBuilder {
return new MarkChatUnreadForUserRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to manage the members property of the microsoft.graph.chat entity.
*/
public function members(): MembersRequestBuilder {
return new MembersRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to manage the messages property of the microsoft.graph.chat entity.
*/
public function messages(): MessagesRequestBuilder {
return new MessagesRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to manage the operations property of the microsoft.graph.chat entity.
*/
public function operations(): OperationsRequestBuilder {
return new OperationsRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to manage the permissionGrants property of the microsoft.graph.chat entity.
*/
public function permissionGrants(): PermissionGrantsRequestBuilder {
return new PermissionGrantsRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to manage the pinnedMessages property of the microsoft.graph.chat entity.
*/
public function pinnedMessages(): PinnedMessagesRequestBuilder {
return new PinnedMessagesRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to call the removeAllAccessForUser method.
*/
public function removeAllAccessForUser(): RemoveAllAccessForUserRequestBuilder {
return new RemoveAllAccessForUserRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to call the sendActivityNotification method.
*/
public function sendActivityNotification(): SendActivityNotificationRequestBuilder {
return new SendActivityNotificationRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to call the startMigration method.
*/
public function startMigration(): StartMigrationRequestBuilder {
return new StartMigrationRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to manage the tabs property of the microsoft.graph.chat entity.
*/
public function tabs(): TabsRequestBuilder {
return new TabsRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to manage the targetedMessages property of the microsoft.graph.chat entity.
*/
public function targetedMessages(): TargetedMessagesRequestBuilder {
return new TargetedMessagesRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Provides operations to call the unhideForUser method.
*/
public function unhideForUser(): UnhideForUserRequestBuilder {
return new UnhideForUserRequestBuilder($this->pathParameters, $this->requestAdapter);
}
/**
* Instantiates a new ChatItemRequestBuilder 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}{?%24expand,%24select}');
if (is_array($pathParametersOrRawUrl)) {
$this->pathParameters = $pathParametersOrRawUrl;
} else {
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
}
}
/**
* Soft-delete a chat. When invoked with delegated permissions, this operation only works for tenant admins and Teams service admins.
* @param ChatItemRequestBuilderDeleteRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<void|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/chat-delete?view=graph-rest-beta Find more info here
*/
public function delete(?ChatItemRequestBuilderDeleteRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toDeleteRequestInformation($requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendNoContentAsync($requestInfo, $errorMappings);
}
/**
* Retrieve a single chat (without its messages). This method supports federation. To access a chat, at least one chat member must belong to the tenant the request initiated from.
* @param ChatItemRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<Chat|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/chat-get?view=graph-rest-beta Find more info here
*/
public function get(?ChatItemRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [Chat::class, 'createFromDiscriminatorValue'], $errorMappings);
}
/**
* Update the properties of a chat object.
* @param Chat $body The request body
* @param ChatItemRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<Chat|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/chat-patch?view=graph-rest-beta Find more info here
*/
public function patch(Chat $body, ?ChatItemRequestBuilderPatchRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPatchRequestInformation($body, $requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [Chat::class, 'createFromDiscriminatorValue'], $errorMappings);
}
/**
* Soft-delete a chat. When invoked with delegated permissions, this operation only works for tenant admins and Teams service admins.
* @param ChatItemRequestBuilderDeleteRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toDeleteRequestInformation(?ChatItemRequestBuilderDeleteRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::DELETE;
if ($requestConfiguration !== null) {
$requestInfo->addHeaders($requestConfiguration->headers);
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json");
return $requestInfo;
}
/**
* Retrieve a single chat (without its messages). This method supports federation. To access a chat, at least one chat member must belong to the tenant the request initiated from.
* @param ChatItemRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toGetRequestInformation(?ChatItemRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::GET;
if ($requestConfiguration !== null) {
$requestInfo->addHeaders($requestConfiguration->headers);
if ($requestConfiguration->queryParameters !== null) {
$requestInfo->setQueryParameters($requestConfiguration->queryParameters);
}
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json");
return $requestInfo;
}
/**
* Update the properties of a chat object.
* @param Chat $body The request body
* @param ChatItemRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toPatchRequestInformation(Chat $body, ?ChatItemRequestBuilderPatchRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::PATCH;
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 ChatItemRequestBuilder
*/
public function withUrl(string $rawUrl): ChatItemRequestBuilder {
return new ChatItemRequestBuilder($rawUrl, $this->requestAdapter);
}
}