Skip to content

Commit

Permalink
Merge pull request #1365 from microsoftgraph/kiota/v1.0/pipelinebuild…
Browse files Browse the repository at this point in the history
…/127020

Generated  models and request builders
  • Loading branch information
Ndiritu authored Oct 18, 2023
2 parents 4df189b + 66e2363 commit 29fcb26
Show file tree
Hide file tree
Showing 273 changed files with 2,212 additions and 839 deletions.
8 changes: 8 additions & 0 deletions src/Generated/Admin/AdminRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Http\Promise\Promise;
use Http\Promise\RejectedPromise;
use Microsoft\Graph\Generated\Admin\Edge\EdgeRequestBuilder;
use Microsoft\Graph\Generated\Admin\People\PeopleRequestBuilder;
use Microsoft\Graph\Generated\Admin\ServiceAnnouncement\ServiceAnnouncementRequestBuilder;
use Microsoft\Graph\Generated\Admin\Sharepoint\SharepointRequestBuilder;
use Microsoft\Graph\Generated\Models\Admin;
Expand All @@ -27,6 +28,13 @@ public function edge(): EdgeRequestBuilder {
return new EdgeRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to manage the people property of the microsoft.graph.admin entity.
*/
public function people(): PeopleRequestBuilder {
return new PeopleRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to manage the serviceAnnouncement property of the microsoft.graph.admin entity.
*/
Expand Down
129 changes: 129 additions & 0 deletions src/Generated/Admin/People/PeopleRequestBuilder.php
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);
}

}
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;
}

}
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);
}

}
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 ?? []);
}

}
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);
}

}
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;
}

}
Loading

0 comments on commit 29fcb26

Please sign in to comment.