Skip to content

Commit

Permalink
Merge pull request #109 from microsoftgraph/kiota/beta/pipelinebuild/…
Browse files Browse the repository at this point in the history
…91121

Generated beta models & request builders using Kiota
  • Loading branch information
Ndiritu authored Nov 1, 2022
2 parents 9b74111 + 6af8cbe commit d8cc0f2
Show file tree
Hide file tree
Showing 177 changed files with 2,030 additions and 340 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ You can install the Beta PHP SDK with Composer by editing your `composer.json` f
{
"minimum-stability": "RC",
"require": {
"microsoft/microsoft-graph-beta": "^2.0.0-RC11",
"microsoft/microsoft-graph-beta": "^2.0.0-RC12",
}
}
```
OR
```
{
"require": {
"microsoft/microsoft-graph-beta": "^2.0.0-RC11",
"microsoft/microsoft-graph-beta": "^2.0.0-RC12",
"microsoft/microsoft-graph-core": "@RC"
}
}
Expand Down
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);
}
}

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Microsoft\Graph\Beta\Generated\Identity\ConditionalAccess\Templates\Item;
namespace Microsoft\Graph\Beta\Generated\EscapedPrint\Reports\DailyPrintUsage\Count;

use Microsoft\Kiota\Abstractions\RequestOption;

class ConditionalAccessTemplateItemRequestBuilderPatchRequestConfiguration
class CountRequestBuilderGetRequestConfiguration
{
/**
* @var array<string, string>|null $headers Request headers
Expand Down
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);
}
}

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

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

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Microsoft\Graph\Beta\Generated\Identity\ConditionalAccess\Templates\Item;
namespace Microsoft\Graph\Beta\Generated\EscapedPrint\Reports\DailyPrintUsage;

use Microsoft\Kiota\Abstractions\RequestOption;

class ConditionalAccessTemplateItemRequestBuilderDeleteRequestConfiguration
class DailyPrintUsageRequestBuilderPostRequestConfiguration
{
/**
* @var array<string, string>|null $headers Request headers
Expand Down
Loading

0 comments on commit d8cc0f2

Please sign in to comment.