Skip to content

Commit 9b02606

Browse files
authored
Merge pull request #1754 from microsoftgraph/kiota/v1.0/pipelinebuild/207061
Generated models and request builders
2 parents 09fcd7d + 33774bc commit 9b02606

File tree

379 files changed

+24848
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

379 files changed

+24848
-56
lines changed

src/Generated/Admin/AdminRequestBuilder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Microsoft\Graph\Generated\Admin\ReportSettings\ReportSettingsRequestBuilder;
1111
use Microsoft\Graph\Generated\Admin\ServiceAnnouncement\ServiceAnnouncementRequestBuilder;
1212
use Microsoft\Graph\Generated\Admin\Sharepoint\SharepointRequestBuilder;
13+
use Microsoft\Graph\Generated\Admin\Teams\TeamsRequestBuilder;
1314
use Microsoft\Graph\Generated\Models\Admin;
1415
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
1516
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
@@ -64,6 +65,13 @@ public function sharepoint(): SharepointRequestBuilder {
6465
return new SharepointRequestBuilder($this->pathParameters, $this->requestAdapter);
6566
}
6667

68+
/**
69+
* Provides operations to manage the teams property of the microsoft.graph.admin entity.
70+
*/
71+
public function teams(): TeamsRequestBuilder {
72+
return new TeamsRequestBuilder($this->pathParameters, $this->requestAdapter);
73+
}
74+
6775
/**
6876
* Instantiates a new AdminRequestBuilder and sets the default values.
6977
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Admin\Teams;
4+
5+
use Exception;
6+
use Http\Promise\Promise;
7+
use Microsoft\Graph\Generated\Admin\Teams\UserConfigurations\UserConfigurationsRequestBuilder;
8+
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
9+
use Microsoft\Graph\Generated\Models\TeamsAdministration\TeamsAdminRoot;
10+
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
11+
use Microsoft\Kiota\Abstractions\HttpMethod;
12+
use Microsoft\Kiota\Abstractions\RequestAdapter;
13+
use Microsoft\Kiota\Abstractions\RequestInformation;
14+
15+
/**
16+
* Provides operations to manage the teams property of the microsoft.graph.admin entity.
17+
*/
18+
class TeamsRequestBuilder extends BaseRequestBuilder
19+
{
20+
/**
21+
* Provides operations to manage the userConfigurations property of the microsoft.graph.teamsAdministration.teamsAdminRoot entity.
22+
*/
23+
public function userConfigurations(): UserConfigurationsRequestBuilder {
24+
return new UserConfigurationsRequestBuilder($this->pathParameters, $this->requestAdapter);
25+
}
26+
27+
/**
28+
* Instantiates a new TeamsRequestBuilder and sets the default values.
29+
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
30+
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
31+
*/
32+
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
33+
parent::__construct($requestAdapter, [], '{+baseurl}/admin/teams{?%24expand,%24select}');
34+
if (is_array($pathParametersOrRawUrl)) {
35+
$this->pathParameters = $pathParametersOrRawUrl;
36+
} else {
37+
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
38+
}
39+
}
40+
41+
/**
42+
* Delete navigation property teams for admin
43+
* @param TeamsRequestBuilderDeleteRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
44+
* @return Promise<void|null>
45+
* @throws Exception
46+
*/
47+
public function delete(?TeamsRequestBuilderDeleteRequestConfiguration $requestConfiguration = null): Promise {
48+
$requestInfo = $this->toDeleteRequestInformation($requestConfiguration);
49+
$errorMappings = [
50+
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
51+
];
52+
return $this->requestAdapter->sendNoContentAsync($requestInfo, $errorMappings);
53+
}
54+
55+
/**
56+
* Represents a collection of user configurations.
57+
* @param TeamsRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
58+
* @return Promise<TeamsAdminRoot|null>
59+
* @throws Exception
60+
*/
61+
public function get(?TeamsRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
62+
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
63+
$errorMappings = [
64+
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
65+
];
66+
return $this->requestAdapter->sendAsync($requestInfo, [TeamsAdminRoot::class, 'createFromDiscriminatorValue'], $errorMappings);
67+
}
68+
69+
/**
70+
* Update the navigation property teams in admin
71+
* @param TeamsAdminRoot $body The request body
72+
* @param TeamsRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
73+
* @return Promise<TeamsAdminRoot|null>
74+
* @throws Exception
75+
*/
76+
public function patch(TeamsAdminRoot $body, ?TeamsRequestBuilderPatchRequestConfiguration $requestConfiguration = null): Promise {
77+
$requestInfo = $this->toPatchRequestInformation($body, $requestConfiguration);
78+
$errorMappings = [
79+
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
80+
];
81+
return $this->requestAdapter->sendAsync($requestInfo, [TeamsAdminRoot::class, 'createFromDiscriminatorValue'], $errorMappings);
82+
}
83+
84+
/**
85+
* Delete navigation property teams for admin
86+
* @param TeamsRequestBuilderDeleteRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
87+
* @return RequestInformation
88+
*/
89+
public function toDeleteRequestInformation(?TeamsRequestBuilderDeleteRequestConfiguration $requestConfiguration = null): RequestInformation {
90+
$requestInfo = new RequestInformation();
91+
$requestInfo->urlTemplate = $this->urlTemplate;
92+
$requestInfo->pathParameters = $this->pathParameters;
93+
$requestInfo->httpMethod = HttpMethod::DELETE;
94+
if ($requestConfiguration !== null) {
95+
$requestInfo->addHeaders($requestConfiguration->headers);
96+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
97+
}
98+
$requestInfo->tryAddHeader('Accept', "application/json");
99+
return $requestInfo;
100+
}
101+
102+
/**
103+
* Represents a collection of user configurations.
104+
* @param TeamsRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
105+
* @return RequestInformation
106+
*/
107+
public function toGetRequestInformation(?TeamsRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
108+
$requestInfo = new RequestInformation();
109+
$requestInfo->urlTemplate = $this->urlTemplate;
110+
$requestInfo->pathParameters = $this->pathParameters;
111+
$requestInfo->httpMethod = HttpMethod::GET;
112+
if ($requestConfiguration !== null) {
113+
$requestInfo->addHeaders($requestConfiguration->headers);
114+
if ($requestConfiguration->queryParameters !== null) {
115+
$requestInfo->setQueryParameters($requestConfiguration->queryParameters);
116+
}
117+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
118+
}
119+
$requestInfo->tryAddHeader('Accept', "application/json");
120+
return $requestInfo;
121+
}
122+
123+
/**
124+
* Update the navigation property teams in admin
125+
* @param TeamsAdminRoot $body The request body
126+
* @param TeamsRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
127+
* @return RequestInformation
128+
*/
129+
public function toPatchRequestInformation(TeamsAdminRoot $body, ?TeamsRequestBuilderPatchRequestConfiguration $requestConfiguration = null): RequestInformation {
130+
$requestInfo = new RequestInformation();
131+
$requestInfo->urlTemplate = $this->urlTemplate;
132+
$requestInfo->pathParameters = $this->pathParameters;
133+
$requestInfo->httpMethod = HttpMethod::PATCH;
134+
if ($requestConfiguration !== null) {
135+
$requestInfo->addHeaders($requestConfiguration->headers);
136+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
137+
}
138+
$requestInfo->tryAddHeader('Accept', "application/json");
139+
$requestInfo->setContentFromParsable($this->requestAdapter, "application/json", $body);
140+
return $requestInfo;
141+
}
142+
143+
/**
144+
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
145+
* @param string $rawUrl The raw URL to use for the request builder.
146+
* @return TeamsRequestBuilder
147+
*/
148+
public function withUrl(string $rawUrl): TeamsRequestBuilder {
149+
return new TeamsRequestBuilder($rawUrl, $this->requestAdapter);
150+
}
151+
152+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Admin\Teams;
4+
5+
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
6+
use Microsoft\Kiota\Abstractions\RequestOption;
7+
8+
/**
9+
* Configuration for the request such as headers, query parameters, and middleware options.
10+
*/
11+
class TeamsRequestBuilderDeleteRequestConfiguration extends BaseRequestConfiguration
12+
{
13+
/**
14+
* Instantiates a new TeamsRequestBuilderDeleteRequestConfiguration and sets the default values.
15+
* @param array<string, array<string>|string>|null $headers Request headers
16+
* @param array<RequestOption>|null $options Request options
17+
*/
18+
public function __construct(?array $headers = null, ?array $options = null) {
19+
parent::__construct($headers ?? [], $options ?? []);
20+
}
21+
22+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Admin\Teams;
4+
5+
use Microsoft\Kiota\Abstractions\QueryParameter;
6+
7+
/**
8+
* Represents a collection of user configurations.
9+
*/
10+
class TeamsRequestBuilderGetQueryParameters
11+
{
12+
/**
13+
* @QueryParameter("%24expand")
14+
* @var array<string>|null $expand Expand related entities
15+
*/
16+
public ?array $expand = null;
17+
18+
/**
19+
* @QueryParameter("%24select")
20+
* @var array<string>|null $select Select properties to be returned
21+
*/
22+
public ?array $select = null;
23+
24+
/**
25+
* Instantiates a new TeamsRequestBuilderGetQueryParameters and sets the default values.
26+
* @param array<string>|null $expand Expand related entities
27+
* @param array<string>|null $select Select properties to be returned
28+
*/
29+
public function __construct(?array $expand = null, ?array $select = null) {
30+
$this->expand = $expand;
31+
$this->select = $select;
32+
}
33+
34+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Admin\Teams;
4+
5+
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
6+
use Microsoft\Kiota\Abstractions\RequestOption;
7+
8+
/**
9+
* Configuration for the request such as headers, query parameters, and middleware options.
10+
*/
11+
class TeamsRequestBuilderGetRequestConfiguration extends BaseRequestConfiguration
12+
{
13+
/**
14+
* @var TeamsRequestBuilderGetQueryParameters|null $queryParameters Request query parameters
15+
*/
16+
public ?TeamsRequestBuilderGetQueryParameters $queryParameters = null;
17+
18+
/**
19+
* Instantiates a new TeamsRequestBuilderGetRequestConfiguration and sets the default values.
20+
* @param array<string, array<string>|string>|null $headers Request headers
21+
* @param array<RequestOption>|null $options Request options
22+
* @param TeamsRequestBuilderGetQueryParameters|null $queryParameters Request query parameters
23+
*/
24+
public function __construct(?array $headers = null, ?array $options = null, ?TeamsRequestBuilderGetQueryParameters $queryParameters = null) {
25+
parent::__construct($headers ?? [], $options ?? []);
26+
$this->queryParameters = $queryParameters;
27+
}
28+
29+
/**
30+
* Instantiates a new TeamsRequestBuilderGetQueryParameters.
31+
* @param array<string>|null $expand Expand related entities
32+
* @param array<string>|null $select Select properties to be returned
33+
* @return TeamsRequestBuilderGetQueryParameters
34+
*/
35+
public static function createQueryParameters(?array $expand = null, ?array $select = null): TeamsRequestBuilderGetQueryParameters {
36+
return new TeamsRequestBuilderGetQueryParameters($expand, $select);
37+
}
38+
39+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Admin\Teams;
4+
5+
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
6+
use Microsoft\Kiota\Abstractions\RequestOption;
7+
8+
/**
9+
* Configuration for the request such as headers, query parameters, and middleware options.
10+
*/
11+
class TeamsRequestBuilderPatchRequestConfiguration extends BaseRequestConfiguration
12+
{
13+
/**
14+
* Instantiates a new TeamsRequestBuilderPatchRequestConfiguration and sets the default values.
15+
* @param array<string, array<string>|string>|null $headers Request headers
16+
* @param array<RequestOption>|null $options Request options
17+
*/
18+
public function __construct(?array $headers = null, ?array $options = null) {
19+
parent::__construct($headers ?? [], $options ?? []);
20+
}
21+
22+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Admin\Teams\UserConfigurations\Count;
4+
5+
use Exception;
6+
use Http\Promise\Promise;
7+
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
8+
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
9+
use Microsoft\Kiota\Abstractions\HttpMethod;
10+
use Microsoft\Kiota\Abstractions\RequestAdapter;
11+
use Microsoft\Kiota\Abstractions\RequestInformation;
12+
13+
/**
14+
* Provides operations to count the resources in the collection.
15+
*/
16+
class CountRequestBuilder extends BaseRequestBuilder
17+
{
18+
/**
19+
* Instantiates a new CountRequestBuilder and sets the default values.
20+
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
21+
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
22+
*/
23+
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
24+
parent::__construct($requestAdapter, [], '{+baseurl}/admin/teams/userConfigurations/$count{?%24filter,%24search}');
25+
if (is_array($pathParametersOrRawUrl)) {
26+
$this->pathParameters = $pathParametersOrRawUrl;
27+
} else {
28+
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
29+
}
30+
}
31+
32+
/**
33+
* Get the number of the resource
34+
* @param CountRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
35+
* @return Promise<int|null>
36+
* @throws Exception
37+
*/
38+
public function get(?CountRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
39+
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
40+
$errorMappings = [
41+
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
42+
];
43+
/** @var Promise<int|null> $result */
44+
$result = $this->requestAdapter->sendPrimitiveAsync($requestInfo, 'int', $errorMappings);
45+
return $result;
46+
}
47+
48+
/**
49+
* Get the number of the resource
50+
* @param CountRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
51+
* @return RequestInformation
52+
*/
53+
public function toGetRequestInformation(?CountRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
54+
$requestInfo = new RequestInformation();
55+
$requestInfo->urlTemplate = $this->urlTemplate;
56+
$requestInfo->pathParameters = $this->pathParameters;
57+
$requestInfo->httpMethod = HttpMethod::GET;
58+
if ($requestConfiguration !== null) {
59+
$requestInfo->addHeaders($requestConfiguration->headers);
60+
if ($requestConfiguration->queryParameters !== null) {
61+
$requestInfo->setQueryParameters($requestConfiguration->queryParameters);
62+
}
63+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
64+
}
65+
$requestInfo->tryAddHeader('Accept', "text/plain;q=0.9");
66+
return $requestInfo;
67+
}
68+
69+
/**
70+
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
71+
* @param string $rawUrl The raw URL to use for the request builder.
72+
* @return CountRequestBuilder
73+
*/
74+
public function withUrl(string $rawUrl): CountRequestBuilder {
75+
return new CountRequestBuilder($rawUrl, $this->requestAdapter);
76+
}
77+
78+
}

0 commit comments

Comments
 (0)