Skip to content

Commit 29fcb26

Browse files
authored
Merge pull request #1365 from microsoftgraph/kiota/v1.0/pipelinebuild/127020
Generated models and request builders
2 parents 4df189b + 66e2363 commit 29fcb26

File tree

273 files changed

+2212
-839
lines changed

Some content is hidden

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

273 files changed

+2212
-839
lines changed

src/Generated/Admin/AdminRequestBuilder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Http\Promise\Promise;
77
use Http\Promise\RejectedPromise;
88
use Microsoft\Graph\Generated\Admin\Edge\EdgeRequestBuilder;
9+
use Microsoft\Graph\Generated\Admin\People\PeopleRequestBuilder;
910
use Microsoft\Graph\Generated\Admin\ServiceAnnouncement\ServiceAnnouncementRequestBuilder;
1011
use Microsoft\Graph\Generated\Admin\Sharepoint\SharepointRequestBuilder;
1112
use Microsoft\Graph\Generated\Models\Admin;
@@ -27,6 +28,13 @@ public function edge(): EdgeRequestBuilder {
2728
return new EdgeRequestBuilder($this->pathParameters, $this->requestAdapter);
2829
}
2930

31+
/**
32+
* Provides operations to manage the people property of the microsoft.graph.admin entity.
33+
*/
34+
public function people(): PeopleRequestBuilder {
35+
return new PeopleRequestBuilder($this->pathParameters, $this->requestAdapter);
36+
}
37+
3038
/**
3139
* Provides operations to manage the serviceAnnouncement property of the microsoft.graph.admin entity.
3240
*/
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Admin\People;
4+
5+
use Exception;
6+
use Http\Promise\Promise;
7+
use Http\Promise\RejectedPromise;
8+
use Microsoft\Graph\Generated\Admin\People\ProfileCardProperties\ProfileCardPropertiesRequestBuilder;
9+
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
10+
use Microsoft\Graph\Generated\Models\PeopleAdminSettings;
11+
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
12+
use Microsoft\Kiota\Abstractions\HttpMethod;
13+
use Microsoft\Kiota\Abstractions\RequestAdapter;
14+
use Microsoft\Kiota\Abstractions\RequestInformation;
15+
16+
/**
17+
* Provides operations to manage the people property of the microsoft.graph.admin entity.
18+
*/
19+
class PeopleRequestBuilder extends BaseRequestBuilder
20+
{
21+
/**
22+
* Provides operations to manage the profileCardProperties property of the microsoft.graph.peopleAdminSettings entity.
23+
*/
24+
public function profileCardProperties(): ProfileCardPropertiesRequestBuilder {
25+
return new ProfileCardPropertiesRequestBuilder($this->pathParameters, $this->requestAdapter);
26+
}
27+
28+
/**
29+
* Instantiates a new PeopleRequestBuilder and sets the default values.
30+
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
31+
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
32+
*/
33+
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
34+
parent::__construct($requestAdapter, [], '{+baseurl}/admin/people{?%24select,%24expand}');
35+
if (is_array($pathParametersOrRawUrl)) {
36+
$this->pathParameters = $pathParametersOrRawUrl;
37+
} else {
38+
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
39+
}
40+
}
41+
42+
/**
43+
* Get people from admin
44+
* @param PeopleRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
45+
* @return Promise
46+
*/
47+
public function get(?PeopleRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
48+
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
49+
try {
50+
$errorMappings = [
51+
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'],
52+
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'],
53+
];
54+
return $this->requestAdapter->sendAsync($requestInfo, [PeopleAdminSettings::class, 'createFromDiscriminatorValue'], $errorMappings);
55+
} catch(Exception $ex) {
56+
return new RejectedPromise($ex);
57+
}
58+
}
59+
60+
/**
61+
* Update the navigation property people in admin
62+
* @param PeopleAdminSettings $body The request body
63+
* @param PeopleRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
64+
* @return Promise
65+
*/
66+
public function patch(PeopleAdminSettings $body, ?PeopleRequestBuilderPatchRequestConfiguration $requestConfiguration = null): Promise {
67+
$requestInfo = $this->toPatchRequestInformation($body, $requestConfiguration);
68+
try {
69+
$errorMappings = [
70+
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'],
71+
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'],
72+
];
73+
return $this->requestAdapter->sendAsync($requestInfo, [PeopleAdminSettings::class, 'createFromDiscriminatorValue'], $errorMappings);
74+
} catch(Exception $ex) {
75+
return new RejectedPromise($ex);
76+
}
77+
}
78+
79+
/**
80+
* Get people from admin
81+
* @param PeopleRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
82+
* @return RequestInformation
83+
*/
84+
public function toGetRequestInformation(?PeopleRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
85+
$requestInfo = new RequestInformation();
86+
$requestInfo->urlTemplate = $this->urlTemplate;
87+
$requestInfo->pathParameters = $this->pathParameters;
88+
$requestInfo->httpMethod = HttpMethod::GET;
89+
$requestInfo->addHeader('Accept', "application/json");
90+
if ($requestConfiguration !== null) {
91+
$requestInfo->addHeaders($requestConfiguration->headers);
92+
if ($requestConfiguration->queryParameters !== null) {
93+
$requestInfo->setQueryParameters($requestConfiguration->queryParameters);
94+
}
95+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
96+
}
97+
return $requestInfo;
98+
}
99+
100+
/**
101+
* Update the navigation property people in admin
102+
* @param PeopleAdminSettings $body The request body
103+
* @param PeopleRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
104+
* @return RequestInformation
105+
*/
106+
public function toPatchRequestInformation(PeopleAdminSettings $body, ?PeopleRequestBuilderPatchRequestConfiguration $requestConfiguration = null): RequestInformation {
107+
$requestInfo = new RequestInformation();
108+
$requestInfo->urlTemplate = $this->urlTemplate;
109+
$requestInfo->pathParameters = $this->pathParameters;
110+
$requestInfo->httpMethod = HttpMethod::PATCH;
111+
$requestInfo->addHeader('Accept', "application/json");
112+
if ($requestConfiguration !== null) {
113+
$requestInfo->addHeaders($requestConfiguration->headers);
114+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
115+
}
116+
$requestInfo->setContentFromParsable($this->requestAdapter, "application/json", $body);
117+
return $requestInfo;
118+
}
119+
120+
/**
121+
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
122+
* @param string $rawUrl The raw URL to use for the request builder.
123+
* @return PeopleRequestBuilder
124+
*/
125+
public function withUrl(string $rawUrl): PeopleRequestBuilder {
126+
return new PeopleRequestBuilder($rawUrl, $this->requestAdapter);
127+
}
128+
129+
}
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\People;
4+
5+
use Microsoft\Kiota\Abstractions\QueryParameter;
6+
7+
/**
8+
* Get people from admin
9+
*/
10+
class PeopleRequestBuilderGetQueryParameters
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 peopleRequestBuilderGetQueryParameters 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\People;
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 PeopleRequestBuilderGetRequestConfiguration extends BaseRequestConfiguration
12+
{
13+
/**
14+
* @var PeopleRequestBuilderGetQueryParameters|null $queryParameters Request query parameters
15+
*/
16+
public ?PeopleRequestBuilderGetQueryParameters $queryParameters = null;
17+
18+
/**
19+
* Instantiates a new peopleRequestBuilderGetRequestConfiguration 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 PeopleRequestBuilderGetQueryParameters|null $queryParameters Request query parameters
23+
*/
24+
public function __construct(?array $headers = null, ?array $options = null, ?PeopleRequestBuilderGetQueryParameters $queryParameters = null) {
25+
parent::__construct($headers ?? [], $options ?? []);
26+
$this->queryParameters = $queryParameters;
27+
}
28+
29+
/**
30+
* Instantiates a new peopleRequestBuilderGetQueryParameters.
31+
* @param array<string>|null $expand Expand related entities
32+
* @param array<string>|null $select Select properties to be returned
33+
* @return PeopleRequestBuilderGetQueryParameters
34+
*/
35+
public static function createQueryParameters(?array $expand = null, ?array $select = null): PeopleRequestBuilderGetQueryParameters {
36+
return new PeopleRequestBuilderGetQueryParameters($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\People;
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 PeopleRequestBuilderPatchRequestConfiguration extends BaseRequestConfiguration
12+
{
13+
/**
14+
* Instantiates a new peopleRequestBuilderPatchRequestConfiguration 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: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Admin\People\ProfileCardProperties\Count;
4+
5+
use Exception;
6+
use Http\Promise\Promise;
7+
use Http\Promise\RejectedPromise;
8+
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
9+
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
10+
use Microsoft\Kiota\Abstractions\HttpMethod;
11+
use Microsoft\Kiota\Abstractions\RequestAdapter;
12+
use Microsoft\Kiota\Abstractions\RequestInformation;
13+
14+
/**
15+
* Provides operations to count the resources in the collection.
16+
*/
17+
class CountRequestBuilder extends BaseRequestBuilder
18+
{
19+
/**
20+
* Instantiates a new CountRequestBuilder and sets the default values.
21+
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
22+
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
23+
*/
24+
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
25+
parent::__construct($requestAdapter, [], '{+baseurl}/admin/people/profileCardProperties/$count{?%24search,%24filter}');
26+
if (is_array($pathParametersOrRawUrl)) {
27+
$this->pathParameters = $pathParametersOrRawUrl;
28+
} else {
29+
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
30+
}
31+
}
32+
33+
/**
34+
* Get the number of the resource
35+
* @param CountRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
36+
* @return Promise
37+
*/
38+
public function get(?CountRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
39+
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
40+
try {
41+
$errorMappings = [
42+
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'],
43+
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'],
44+
];
45+
return $this->requestAdapter->sendPrimitiveAsync($requestInfo, 'int', $errorMappings);
46+
} catch(Exception $ex) {
47+
return new RejectedPromise($ex);
48+
}
49+
}
50+
51+
/**
52+
* Get the number of the resource
53+
* @param CountRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
54+
* @return RequestInformation
55+
*/
56+
public function toGetRequestInformation(?CountRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
57+
$requestInfo = new RequestInformation();
58+
$requestInfo->urlTemplate = $this->urlTemplate;
59+
$requestInfo->pathParameters = $this->pathParameters;
60+
$requestInfo->httpMethod = HttpMethod::GET;
61+
$requestInfo->addHeader('Accept', "text/plain");
62+
if ($requestConfiguration !== null) {
63+
$requestInfo->addHeaders($requestConfiguration->headers);
64+
if ($requestConfiguration->queryParameters !== null) {
65+
$requestInfo->setQueryParameters($requestConfiguration->queryParameters);
66+
}
67+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
68+
}
69+
return $requestInfo;
70+
}
71+
72+
/**
73+
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
74+
* @param string $rawUrl The raw URL to use for the request builder.
75+
* @return CountRequestBuilder
76+
*/
77+
public function withUrl(string $rawUrl): CountRequestBuilder {
78+
return new CountRequestBuilder($rawUrl, $this->requestAdapter);
79+
}
80+
81+
}
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\People\ProfileCardProperties\Count;
4+
5+
use Microsoft\Kiota\Abstractions\QueryParameter;
6+
7+
/**
8+
* Get the number of the resource
9+
*/
10+
class CountRequestBuilderGetQueryParameters
11+
{
12+
/**
13+
* @QueryParameter("%24filter")
14+
* @var string|null $filter Filter items by property values
15+
*/
16+
public ?string $filter = null;
17+
18+
/**
19+
* @QueryParameter("%24search")
20+
* @var string|null $search Search items by search phrases
21+
*/
22+
public ?string $search = null;
23+
24+
/**
25+
* Instantiates a new CountRequestBuilderGetQueryParameters and sets the default values.
26+
* @param string|null $filter Filter items by property values
27+
* @param string|null $search Search items by search phrases
28+
*/
29+
public function __construct(?string $filter = null, ?string $search = null) {
30+
$this->filter = $filter;
31+
$this->search = $search;
32+
}
33+
34+
}

0 commit comments

Comments
 (0)