-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1365 from microsoftgraph/kiota/v1.0/pipelinebuild…
…/127020 Generated models and request builders
- Loading branch information
Showing
273 changed files
with
2,212 additions
and
839 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Generated\Admin\People; | ||
|
||
use Exception; | ||
use Http\Promise\Promise; | ||
use Http\Promise\RejectedPromise; | ||
use Microsoft\Graph\Generated\Admin\People\ProfileCardProperties\ProfileCardPropertiesRequestBuilder; | ||
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError; | ||
use Microsoft\Graph\Generated\Models\PeopleAdminSettings; | ||
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 people property of the microsoft.graph.admin entity. | ||
*/ | ||
class PeopleRequestBuilder extends BaseRequestBuilder | ||
{ | ||
/** | ||
* Provides operations to manage the profileCardProperties property of the microsoft.graph.peopleAdminSettings entity. | ||
*/ | ||
public function profileCardProperties(): ProfileCardPropertiesRequestBuilder { | ||
return new ProfileCardPropertiesRequestBuilder($this->pathParameters, $this->requestAdapter); | ||
} | ||
|
||
/** | ||
* Instantiates a new PeopleRequestBuilder 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}/admin/people{?%24select,%24expand}'); | ||
if (is_array($pathParametersOrRawUrl)) { | ||
$this->pathParameters = $pathParametersOrRawUrl; | ||
} else { | ||
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl]; | ||
} | ||
} | ||
|
||
/** | ||
* Get people from admin | ||
* @param PeopleRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return Promise | ||
*/ | ||
public function get(?PeopleRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise { | ||
$requestInfo = $this->toGetRequestInformation($requestConfiguration); | ||
try { | ||
$errorMappings = [ | ||
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
]; | ||
return $this->requestAdapter->sendAsync($requestInfo, [PeopleAdminSettings::class, 'createFromDiscriminatorValue'], $errorMappings); | ||
} catch(Exception $ex) { | ||
return new RejectedPromise($ex); | ||
} | ||
} | ||
|
||
/** | ||
* Update the navigation property people in admin | ||
* @param PeopleAdminSettings $body The request body | ||
* @param PeopleRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return Promise | ||
*/ | ||
public function patch(PeopleAdminSettings $body, ?PeopleRequestBuilderPatchRequestConfiguration $requestConfiguration = null): Promise { | ||
$requestInfo = $this->toPatchRequestInformation($body, $requestConfiguration); | ||
try { | ||
$errorMappings = [ | ||
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
]; | ||
return $this->requestAdapter->sendAsync($requestInfo, [PeopleAdminSettings::class, 'createFromDiscriminatorValue'], $errorMappings); | ||
} catch(Exception $ex) { | ||
return new RejectedPromise($ex); | ||
} | ||
} | ||
|
||
/** | ||
* Get people from admin | ||
* @param PeopleRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return RequestInformation | ||
*/ | ||
public function toGetRequestInformation(?PeopleRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation { | ||
$requestInfo = new RequestInformation(); | ||
$requestInfo->urlTemplate = $this->urlTemplate; | ||
$requestInfo->pathParameters = $this->pathParameters; | ||
$requestInfo->httpMethod = HttpMethod::GET; | ||
$requestInfo->addHeader('Accept', "application/json"); | ||
if ($requestConfiguration !== null) { | ||
$requestInfo->addHeaders($requestConfiguration->headers); | ||
if ($requestConfiguration->queryParameters !== null) { | ||
$requestInfo->setQueryParameters($requestConfiguration->queryParameters); | ||
} | ||
$requestInfo->addRequestOptions(...$requestConfiguration->options); | ||
} | ||
return $requestInfo; | ||
} | ||
|
||
/** | ||
* Update the navigation property people in admin | ||
* @param PeopleAdminSettings $body The request body | ||
* @param PeopleRequestBuilderPatchRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return RequestInformation | ||
*/ | ||
public function toPatchRequestInformation(PeopleAdminSettings $body, ?PeopleRequestBuilderPatchRequestConfiguration $requestConfiguration = null): RequestInformation { | ||
$requestInfo = new RequestInformation(); | ||
$requestInfo->urlTemplate = $this->urlTemplate; | ||
$requestInfo->pathParameters = $this->pathParameters; | ||
$requestInfo->httpMethod = HttpMethod::PATCH; | ||
$requestInfo->addHeader('Accept', "application/json"); | ||
if ($requestConfiguration !== null) { | ||
$requestInfo->addHeaders($requestConfiguration->headers); | ||
$requestInfo->addRequestOptions(...$requestConfiguration->options); | ||
} | ||
$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 PeopleRequestBuilder | ||
*/ | ||
public function withUrl(string $rawUrl): PeopleRequestBuilder { | ||
return new PeopleRequestBuilder($rawUrl, $this->requestAdapter); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/Generated/Admin/People/PeopleRequestBuilderGetQueryParameters.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Generated\Admin\People; | ||
|
||
use Microsoft\Kiota\Abstractions\QueryParameter; | ||
|
||
/** | ||
* Get people from admin | ||
*/ | ||
class PeopleRequestBuilderGetQueryParameters | ||
{ | ||
/** | ||
* @QueryParameter("%24expand") | ||
* @var array<string>|null $expand Expand related entities | ||
*/ | ||
public ?array $expand = null; | ||
|
||
/** | ||
* @QueryParameter("%24select") | ||
* @var array<string>|null $select Select properties to be returned | ||
*/ | ||
public ?array $select = null; | ||
|
||
/** | ||
* Instantiates a new peopleRequestBuilderGetQueryParameters and sets the default values. | ||
* @param array<string>|null $expand Expand related entities | ||
* @param array<string>|null $select Select properties to be returned | ||
*/ | ||
public function __construct(?array $expand = null, ?array $select = null) { | ||
$this->expand = $expand; | ||
$this->select = $select; | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
src/Generated/Admin/People/PeopleRequestBuilderGetRequestConfiguration.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Generated\Admin\People; | ||
|
||
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration; | ||
use Microsoft\Kiota\Abstractions\RequestOption; | ||
|
||
/** | ||
* Configuration for the request such as headers, query parameters, and middleware options. | ||
*/ | ||
class PeopleRequestBuilderGetRequestConfiguration extends BaseRequestConfiguration | ||
{ | ||
/** | ||
* @var PeopleRequestBuilderGetQueryParameters|null $queryParameters Request query parameters | ||
*/ | ||
public ?PeopleRequestBuilderGetQueryParameters $queryParameters = null; | ||
|
||
/** | ||
* Instantiates a new peopleRequestBuilderGetRequestConfiguration and sets the default values. | ||
* @param array<string, array<string>|string>|null $headers Request headers | ||
* @param array<RequestOption>|null $options Request options | ||
* @param PeopleRequestBuilderGetQueryParameters|null $queryParameters Request query parameters | ||
*/ | ||
public function __construct(?array $headers = null, ?array $options = null, ?PeopleRequestBuilderGetQueryParameters $queryParameters = null) { | ||
parent::__construct($headers ?? [], $options ?? []); | ||
$this->queryParameters = $queryParameters; | ||
} | ||
|
||
/** | ||
* Instantiates a new peopleRequestBuilderGetQueryParameters. | ||
* @param array<string>|null $expand Expand related entities | ||
* @param array<string>|null $select Select properties to be returned | ||
* @return PeopleRequestBuilderGetQueryParameters | ||
*/ | ||
public static function createQueryParameters(?array $expand = null, ?array $select = null): PeopleRequestBuilderGetQueryParameters { | ||
return new PeopleRequestBuilderGetQueryParameters($expand, $select); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/Generated/Admin/People/PeopleRequestBuilderPatchRequestConfiguration.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Generated\Admin\People; | ||
|
||
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration; | ||
use Microsoft\Kiota\Abstractions\RequestOption; | ||
|
||
/** | ||
* Configuration for the request such as headers, query parameters, and middleware options. | ||
*/ | ||
class PeopleRequestBuilderPatchRequestConfiguration extends BaseRequestConfiguration | ||
{ | ||
/** | ||
* Instantiates a new peopleRequestBuilderPatchRequestConfiguration 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 ?? []); | ||
} | ||
|
||
} |
81 changes: 81 additions & 0 deletions
81
src/Generated/Admin/People/ProfileCardProperties/Count/CountRequestBuilder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Generated\Admin\People\ProfileCardProperties\Count; | ||
|
||
use Exception; | ||
use Http\Promise\Promise; | ||
use Http\Promise\RejectedPromise; | ||
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 count the resources in the collection. | ||
*/ | ||
class CountRequestBuilder extends BaseRequestBuilder | ||
{ | ||
/** | ||
* Instantiates a new CountRequestBuilder 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}/admin/people/profileCardProperties/$count{?%24search,%24filter}'); | ||
if (is_array($pathParametersOrRawUrl)) { | ||
$this->pathParameters = $pathParametersOrRawUrl; | ||
} else { | ||
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl]; | ||
} | ||
} | ||
|
||
/** | ||
* Get the number of the resource | ||
* @param CountRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return Promise | ||
*/ | ||
public function get(?CountRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise { | ||
$requestInfo = $this->toGetRequestInformation($requestConfiguration); | ||
try { | ||
$errorMappings = [ | ||
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
]; | ||
return $this->requestAdapter->sendPrimitiveAsync($requestInfo, 'int', $errorMappings); | ||
} catch(Exception $ex) { | ||
return new RejectedPromise($ex); | ||
} | ||
} | ||
|
||
/** | ||
* Get the number of the resource | ||
* @param CountRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return RequestInformation | ||
*/ | ||
public function toGetRequestInformation(?CountRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation { | ||
$requestInfo = new RequestInformation(); | ||
$requestInfo->urlTemplate = $this->urlTemplate; | ||
$requestInfo->pathParameters = $this->pathParameters; | ||
$requestInfo->httpMethod = HttpMethod::GET; | ||
$requestInfo->addHeader('Accept', "text/plain"); | ||
if ($requestConfiguration !== null) { | ||
$requestInfo->addHeaders($requestConfiguration->headers); | ||
if ($requestConfiguration->queryParameters !== null) { | ||
$requestInfo->setQueryParameters($requestConfiguration->queryParameters); | ||
} | ||
$requestInfo->addRequestOptions(...$requestConfiguration->options); | ||
} | ||
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 CountRequestBuilder | ||
*/ | ||
public function withUrl(string $rawUrl): CountRequestBuilder { | ||
return new CountRequestBuilder($rawUrl, $this->requestAdapter); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
...erated/Admin/People/ProfileCardProperties/Count/CountRequestBuilderGetQueryParameters.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Generated\Admin\People\ProfileCardProperties\Count; | ||
|
||
use Microsoft\Kiota\Abstractions\QueryParameter; | ||
|
||
/** | ||
* Get the number of the resource | ||
*/ | ||
class CountRequestBuilderGetQueryParameters | ||
{ | ||
/** | ||
* @QueryParameter("%24filter") | ||
* @var string|null $filter Filter items by property values | ||
*/ | ||
public ?string $filter = null; | ||
|
||
/** | ||
* @QueryParameter("%24search") | ||
* @var string|null $search Search items by search phrases | ||
*/ | ||
public ?string $search = null; | ||
|
||
/** | ||
* Instantiates a new CountRequestBuilderGetQueryParameters and sets the default values. | ||
* @param string|null $filter Filter items by property values | ||
* @param string|null $search Search items by search phrases | ||
*/ | ||
public function __construct(?string $filter = null, ?string $search = null) { | ||
$this->filter = $filter; | ||
$this->search = $search; | ||
} | ||
|
||
} |
Oops, something went wrong.