-
Notifications
You must be signed in to change notification settings - Fork 4
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 #109 from microsoftgraph/kiota/beta/pipelinebuild/…
…91121 Generated beta models & request builders using Kiota
- Loading branch information
Showing
177 changed files
with
2,030 additions
and
340 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
86 changes: 86 additions & 0 deletions
86
src/Generated/EscapedPrint/Reports/DailyPrintUsage/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,86 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Beta\Generated\EscapedPrint\Reports\DailyPrintUsage\Count; | ||
|
||
use Exception; | ||
use Http\Promise\Promise; | ||
use Http\Promise\RejectedPromise; | ||
use Microsoft\Graph\Beta\Generated\Models\ODataErrors\ODataError; | ||
use Microsoft\Kiota\Abstractions\HttpMethod; | ||
use Microsoft\Kiota\Abstractions\RequestAdapter; | ||
use Microsoft\Kiota\Abstractions\RequestInformation; | ||
use Microsoft\Kiota\Abstractions\RequestOption; | ||
use Microsoft\Kiota\Abstractions\ResponseHandler; | ||
use Microsoft\Kiota\Abstractions\Serialization\Parsable; | ||
use Microsoft\Kiota\Abstractions\Serialization\ParsableFactory; | ||
|
||
class CountRequestBuilder | ||
{ | ||
/** | ||
* @var array<string, mixed> $pathParameters Path parameters for the request | ||
*/ | ||
private array $pathParameters; | ||
|
||
/** | ||
* @var RequestAdapter $requestAdapter The request adapter to use to execute the requests. | ||
*/ | ||
private RequestAdapter $requestAdapter; | ||
|
||
/** | ||
* @var string $urlTemplate Url template to use to build the URL for the current request builder | ||
*/ | ||
private string $urlTemplate; | ||
|
||
/** | ||
* Instantiates a new CountRequestBuilder and sets the default values. | ||
* @param array<string, mixed> $pathParameters Path parameters for the request | ||
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests. | ||
*/ | ||
public function __construct(array $pathParameters, RequestAdapter $requestAdapter) { | ||
$this->urlTemplate = '{+baseurl}/print/reports/dailyPrintUsage/$count'; | ||
$this->requestAdapter = $requestAdapter; | ||
$this->pathParameters = $pathParameters; | ||
} | ||
|
||
/** | ||
* 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 createGetRequestInformation(?CountRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation { | ||
$requestInfo = new RequestInformation(); | ||
$requestInfo->urlTemplate = $this->urlTemplate; | ||
$requestInfo->pathParameters = $this->pathParameters; | ||
$requestInfo->httpMethod = HttpMethod::GET; | ||
$requestInfo->headers = array_merge($requestInfo->headers, ["Accept" => "text/plain"]); | ||
if ($requestConfiguration !== null) { | ||
if ($requestConfiguration->headers !== null) { | ||
$requestInfo->headers = array_merge($requestInfo->headers, $requestConfiguration->headers); | ||
} | ||
if ($requestConfiguration->options !== null) { | ||
$requestInfo->addRequestOptions(...$requestConfiguration->options); | ||
} | ||
} | ||
return $requestInfo; | ||
} | ||
|
||
/** | ||
* Get the number of the resource | ||
* @param CountRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @param ResponseHandler|null $responseHandler Response handler to use in place of the default response handling provided by the core service | ||
* @return Promise | ||
*/ | ||
public function get(?CountRequestBuilderGetRequestConfiguration $requestConfiguration = null, ?ResponseHandler $responseHandler = null): Promise { | ||
$requestInfo = $this->createGetRequestInformation($requestConfiguration); | ||
try { | ||
$errorMappings = [ | ||
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
]; | ||
return $this->requestAdapter->sendPrimitiveAsync($requestInfo, 'int', $responseHandler, $errorMappings); | ||
} catch(Exception $ex) { | ||
return new RejectedPromise($ex); | ||
} | ||
} | ||
|
||
} |
4 changes: 2 additions & 2 deletions
4
...questBuilderPatchRequestConfiguration.php → ...RequestBuilderGetRequestConfiguration.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
143 changes: 143 additions & 0 deletions
143
src/Generated/EscapedPrint/Reports/DailyPrintUsage/DailyPrintUsageRequestBuilder.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,143 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Beta\Generated\EscapedPrint\Reports\DailyPrintUsage; | ||
|
||
use Exception; | ||
use Http\Promise\Promise; | ||
use Http\Promise\RejectedPromise; | ||
use Microsoft\Graph\Beta\Generated\EscapedPrint\Reports\DailyPrintUsage\Count\CountRequestBuilder; | ||
use Microsoft\Graph\Beta\Generated\Models\ODataErrors\ODataError; | ||
use Microsoft\Graph\Beta\Generated\Models\PrintUsage; | ||
use Microsoft\Graph\Beta\Generated\Models\PrintUsageCollectionResponse; | ||
use Microsoft\Kiota\Abstractions\HttpMethod; | ||
use Microsoft\Kiota\Abstractions\RequestAdapter; | ||
use Microsoft\Kiota\Abstractions\RequestInformation; | ||
use Microsoft\Kiota\Abstractions\RequestOption; | ||
use Microsoft\Kiota\Abstractions\ResponseHandler; | ||
use Microsoft\Kiota\Abstractions\Serialization\Parsable; | ||
use Microsoft\Kiota\Abstractions\Serialization\ParsableFactory; | ||
|
||
class DailyPrintUsageRequestBuilder | ||
{ | ||
/** | ||
* The Count property | ||
*/ | ||
public function count(): CountRequestBuilder { | ||
return new CountRequestBuilder($this->pathParameters, $this->requestAdapter); | ||
} | ||
|
||
/** | ||
* @var array<string, mixed> $pathParameters Path parameters for the request | ||
*/ | ||
private array $pathParameters; | ||
|
||
/** | ||
* @var RequestAdapter $requestAdapter The request adapter to use to execute the requests. | ||
*/ | ||
private RequestAdapter $requestAdapter; | ||
|
||
/** | ||
* @var string $urlTemplate Url template to use to build the URL for the current request builder | ||
*/ | ||
private string $urlTemplate; | ||
|
||
/** | ||
* Instantiates a new DailyPrintUsageRequestBuilder and sets the default values. | ||
* @param array<string, mixed> $pathParameters Path parameters for the request | ||
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests. | ||
*/ | ||
public function __construct(array $pathParameters, RequestAdapter $requestAdapter) { | ||
$this->urlTemplate = '{+baseurl}/print/reports/dailyPrintUsage{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}'; | ||
$this->requestAdapter = $requestAdapter; | ||
$this->pathParameters = $pathParameters; | ||
} | ||
|
||
/** | ||
* Get dailyPrintUsage from print | ||
* @param DailyPrintUsageRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return RequestInformation | ||
*/ | ||
public function createGetRequestInformation(?DailyPrintUsageRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation { | ||
$requestInfo = new RequestInformation(); | ||
$requestInfo->urlTemplate = $this->urlTemplate; | ||
$requestInfo->pathParameters = $this->pathParameters; | ||
$requestInfo->httpMethod = HttpMethod::GET; | ||
$requestInfo->headers = array_merge($requestInfo->headers, ["Accept" => "application/json"]); | ||
if ($requestConfiguration !== null) { | ||
if ($requestConfiguration->headers !== null) { | ||
$requestInfo->headers = array_merge($requestInfo->headers, $requestConfiguration->headers); | ||
} | ||
if ($requestConfiguration->queryParameters !== null) { | ||
$requestInfo->setQueryParameters($requestConfiguration->queryParameters); | ||
} | ||
if ($requestConfiguration->options !== null) { | ||
$requestInfo->addRequestOptions(...$requestConfiguration->options); | ||
} | ||
} | ||
return $requestInfo; | ||
} | ||
|
||
/** | ||
* Create new navigation property to dailyPrintUsage for print | ||
* @param PrintUsage $body | ||
* @param DailyPrintUsageRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return RequestInformation | ||
*/ | ||
public function createPostRequestInformation(PrintUsage $body, ?DailyPrintUsageRequestBuilderPostRequestConfiguration $requestConfiguration = null): RequestInformation { | ||
$requestInfo = new RequestInformation(); | ||
$requestInfo->urlTemplate = $this->urlTemplate; | ||
$requestInfo->pathParameters = $this->pathParameters; | ||
$requestInfo->httpMethod = HttpMethod::POST; | ||
$requestInfo->headers = array_merge($requestInfo->headers, ["Accept" => "application/json"]); | ||
if ($requestConfiguration !== null) { | ||
if ($requestConfiguration->headers !== null) { | ||
$requestInfo->headers = array_merge($requestInfo->headers, $requestConfiguration->headers); | ||
} | ||
if ($requestConfiguration->options !== null) { | ||
$requestInfo->addRequestOptions(...$requestConfiguration->options); | ||
} | ||
} | ||
$requestInfo->setContentFromParsable($this->requestAdapter, "application/json", $body); | ||
return $requestInfo; | ||
} | ||
|
||
/** | ||
* Get dailyPrintUsage from print | ||
* @param DailyPrintUsageRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @param ResponseHandler|null $responseHandler Response handler to use in place of the default response handling provided by the core service | ||
* @return Promise | ||
*/ | ||
public function get(?DailyPrintUsageRequestBuilderGetRequestConfiguration $requestConfiguration = null, ?ResponseHandler $responseHandler = null): Promise { | ||
$requestInfo = $this->createGetRequestInformation($requestConfiguration); | ||
try { | ||
$errorMappings = [ | ||
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
]; | ||
return $this->requestAdapter->sendAsync($requestInfo, [PrintUsageCollectionResponse::class, 'createFromDiscriminatorValue'], $responseHandler, $errorMappings); | ||
} catch(Exception $ex) { | ||
return new RejectedPromise($ex); | ||
} | ||
} | ||
|
||
/** | ||
* Create new navigation property to dailyPrintUsage for print | ||
* @param PrintUsage $body | ||
* @param DailyPrintUsageRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @param ResponseHandler|null $responseHandler Response handler to use in place of the default response handling provided by the core service | ||
* @return Promise | ||
*/ | ||
public function post(PrintUsage $body, ?DailyPrintUsageRequestBuilderPostRequestConfiguration $requestConfiguration = null, ?ResponseHandler $responseHandler = null): Promise { | ||
$requestInfo = $this->createPostRequestInformation($body, $requestConfiguration); | ||
try { | ||
$errorMappings = [ | ||
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
]; | ||
return $this->requestAdapter->sendAsync($requestInfo, [PrintUsage::class, 'createFromDiscriminatorValue'], $responseHandler, $errorMappings); | ||
} catch(Exception $ex) { | ||
return new RejectedPromise($ex); | ||
} | ||
} | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
.../EscapedPrint/Reports/DailyPrintUsage/DailyPrintUsageRequestBuilderGetQueryParameters.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,57 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Beta\Generated\EscapedPrint\Reports\DailyPrintUsage; | ||
|
||
use Microsoft\Kiota\Abstractions\QueryParameter; | ||
|
||
class DailyPrintUsageRequestBuilderGetQueryParameters | ||
{ | ||
/** | ||
* @QueryParameter("%24count") | ||
* @var bool|null $count Include count of items | ||
*/ | ||
public ?bool $count = null; | ||
|
||
/** | ||
* @QueryParameter("%24expand") | ||
* @var array<string>|null $expand Expand related entities | ||
*/ | ||
public ?array $expand = null; | ||
|
||
/** | ||
* @QueryParameter("%24filter") | ||
* @var string|null $filter Filter items by property values | ||
*/ | ||
public ?string $filter = null; | ||
|
||
/** | ||
* @QueryParameter("%24orderby") | ||
* @var array<string>|null $orderby Order items by property values | ||
*/ | ||
public ?array $orderby = null; | ||
|
||
/** | ||
* @QueryParameter("%24search") | ||
* @var string|null $search Search items by search phrases | ||
*/ | ||
public ?string $search = null; | ||
|
||
/** | ||
* @QueryParameter("%24select") | ||
* @var array<string>|null $select Select properties to be returned | ||
*/ | ||
public ?array $select = null; | ||
|
||
/** | ||
* @QueryParameter("%24skip") | ||
* @var int|null $skip Skip the first n items | ||
*/ | ||
public ?int $skip = null; | ||
|
||
/** | ||
* @QueryParameter("%24top") | ||
* @var int|null $top Show only the first n items | ||
*/ | ||
public ?int $top = null; | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...pedPrint/Reports/DailyPrintUsage/DailyPrintUsageRequestBuilderGetRequestConfiguration.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,24 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Beta\Generated\EscapedPrint\Reports\DailyPrintUsage; | ||
|
||
use Microsoft\Kiota\Abstractions\RequestOption; | ||
|
||
class DailyPrintUsageRequestBuilderGetRequestConfiguration | ||
{ | ||
/** | ||
* @var array<string, string>|null $headers Request headers | ||
*/ | ||
public ?array $headers = null; | ||
|
||
/** | ||
* @var array<string, RequestOption>|null $options Request options | ||
*/ | ||
public ?array $options = null; | ||
|
||
/** | ||
* @var DailyPrintUsageRequestBuilderGetQueryParameters|null $queryParameters Request query parameters | ||
*/ | ||
public ?DailyPrintUsageRequestBuilderGetQueryParameters $queryParameters = null; | ||
|
||
} |
4 changes: 2 additions & 2 deletions
4
...uestBuilderDeleteRequestConfiguration.php → ...equestBuilderPostRequestConfiguration.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
Oops, something went wrong.