Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions src/Generated/EscapedPrint/PrintRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Microsoft\Graph\Generated\EscapedPrint\Connectors\ConnectorsRequestBuilder;
use Microsoft\Graph\Generated\EscapedPrint\Operations\OperationsRequestBuilder;
use Microsoft\Graph\Generated\EscapedPrint\Printers\PrintersRequestBuilder;
use Microsoft\Graph\Generated\EscapedPrint\PullPrintPrinters\PullPrintPrintersRequestBuilder;
use Microsoft\Graph\Generated\EscapedPrint\Services\ServicesRequestBuilder;
use Microsoft\Graph\Generated\EscapedPrint\Shares\SharesRequestBuilder;
use Microsoft\Graph\Generated\EscapedPrint\TaskDefinitions\TaskDefinitionsRequestBuilder;
Expand Down Expand Up @@ -43,6 +44,13 @@ public function printers(): PrintersRequestBuilder {
return new PrintersRequestBuilder($this->pathParameters, $this->requestAdapter);
}

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

/**
* Provides operations to manage the services property of the microsoft.graph.print entity.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use Http\Promise\Promise;
use Microsoft\Graph\Generated\EscapedPrint\Printers\Item\Jobs\Count\CountRequestBuilder;
use Microsoft\Graph\Generated\EscapedPrint\Printers\Item\Jobs\Item\PrintJobItemRequestBuilder;
use Microsoft\Graph\Generated\EscapedPrint\Printers\Item\Jobs\Release\ReleaseRequestBuilder;
use Microsoft\Graph\Generated\EscapedPrint\Printers\Item\Jobs\ReleaseWait\ReleaseWaitRequestBuilder;
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
use Microsoft\Graph\Generated\Models\PrintJob;
use Microsoft\Graph\Generated\Models\PrintJobCollectionResponse;
Expand All @@ -26,6 +28,20 @@ public function count(): CountRequestBuilder {
return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to call the release method.
*/
public function release(): ReleaseRequestBuilder {
return new ReleaseRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to call the releaseWait method.
*/
public function releaseWait(): ReleaseWaitRequestBuilder {
return new ReleaseWaitRequestBuilder($this->pathParameters, $this->requestAdapter);
}

/**
* Provides operations to manage the jobs property of the microsoft.graph.printerBase entity.
* @param string $printJobId The unique identifier of printJob
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?php

namespace Microsoft\Graph\Generated\EscapedPrint\Printers\Item\Jobs\Release;

use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
use Microsoft\Kiota\Abstractions\Store\BackedModel;
use Microsoft\Kiota\Abstractions\Store\BackingStore;
use Microsoft\Kiota\Abstractions\Store\BackingStoreFactorySingleton;

class ReleasePostRequestBody implements AdditionalDataHolder, BackedModel, Parsable
{
/**
* @var BackingStore $backingStore Stores model information.
*/
private BackingStore $backingStore;

/**
* Instantiates a new ReleasePostRequestBody and sets the default values.
*/
public function __construct() {
$this->backingStore = BackingStoreFactorySingleton::getInstance()->createBackingStore();
$this->setAdditionalData([]);
}

/**
* Creates a new instance of the appropriate class based on discriminator value
* @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object
* @return ReleasePostRequestBody
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): ReleasePostRequestBody {
return new ReleasePostRequestBody();
}

/**
* Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
* @return array<string, mixed>|null
*/
public function getAdditionalData(): ?array {
$val = $this->getBackingStore()->get('additionalData');
if (is_null($val) || is_array($val)) {
/** @var array<string, mixed>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'additionalData'");
}

/**
* Gets the BackingStore property value. Stores model information.
* @return BackingStore
*/
public function getBackingStore(): BackingStore {
return $this->backingStore;
}

/**
* The deserialization information for the current model
* @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array {
$o = $this;
return [
'jobId' => fn(ParseNode $n) => $o->setJobId($n->getStringValue()),
];
}

/**
* Gets the jobId property value. The jobId property
* @return string|null
*/
public function getJobId(): ?string {
$val = $this->getBackingStore()->get('jobId');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'jobId'");
}

/**
* Serializes information the current object
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void {
$writer->writeStringValue('jobId', $this->getJobId());
$writer->writeAdditionalData($this->getAdditionalData());
}

/**
* Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
* @param array<string,mixed> $value Value to set for the AdditionalData property.
*/
public function setAdditionalData(?array $value): void {
$this->getBackingStore()->set('additionalData', $value);
}

/**
* Sets the BackingStore property value. Stores model information.
* @param BackingStore $value Value to set for the BackingStore property.
*/
public function setBackingStore(BackingStore $value): void {
$this->backingStore = $value;
}

/**
* Sets the jobId property value. The jobId property
* @param string|null $value Value to set for the jobId property.
*/
public function setJobId(?string $value): void {
$this->getBackingStore()->set('jobId', $value);
}

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

namespace Microsoft\Graph\Generated\EscapedPrint\Printers\Item\Jobs\Release;

use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
use Microsoft\Graph\Generated\Models\PrintJob;
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
use Microsoft\Kiota\Abstractions\HttpMethod;
use Microsoft\Kiota\Abstractions\RequestAdapter;
use Microsoft\Kiota\Abstractions\RequestInformation;

/**
* Provides operations to call the release method.
*/
class ReleaseRequestBuilder extends BaseRequestBuilder
{
/**
* Instantiates a new ReleaseRequestBuilder 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}/print/printers/{printer%2Did}/jobs/release');
if (is_array($pathParametersOrRawUrl)) {
$this->pathParameters = $pathParametersOrRawUrl;
} else {
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
}
}

/**
* Release a printJob held in the cloud for secure release to print it at the target printer.
* @param ReleasePostRequestBody $body The request body
* @param ReleaseRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<PrintJob|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/printjob-release?view=graph-rest-1.0 Find more info here
*/
public function post(ReleasePostRequestBody $body, ?ReleaseRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [PrintJob::class, 'createFromDiscriminatorValue'], $errorMappings);
}

/**
* Release a printJob held in the cloud for secure release to print it at the target printer.
* @param ReleasePostRequestBody $body The request body
* @param ReleaseRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toPostRequestInformation(ReleasePostRequestBody $body, ?ReleaseRequestBuilderPostRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::POST;
if ($requestConfiguration !== null) {
$requestInfo->addHeaders($requestConfiguration->headers);
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json");
$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 ReleaseRequestBuilder
*/
public function withUrl(string $rawUrl): ReleaseRequestBuilder {
return new ReleaseRequestBuilder($rawUrl, $this->requestAdapter);
}

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

namespace Microsoft\Graph\Generated\EscapedPrint\Printers\Item\Jobs\Release;

use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
use Microsoft\Kiota\Abstractions\RequestOption;

/**
* Configuration for the request such as headers, query parameters, and middleware options.
*/
class ReleaseRequestBuilderPostRequestConfiguration extends BaseRequestConfiguration
{
/**
* Instantiates a new ReleaseRequestBuilderPostRequestConfiguration 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,72 @@
<?php

namespace Microsoft\Graph\Generated\EscapedPrint\Printers\Item\Jobs\ReleaseWait;

use Microsoft\Graph\Generated\Models\BaseCollectionPaginationCountResponse;
use Microsoft\Graph\Generated\Models\PrintJob;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
use Microsoft\Kiota\Abstractions\Types\TypeUtils;

class ReleaseWaitGetResponse extends BaseCollectionPaginationCountResponse implements Parsable
{
/**
* Instantiates a new ReleaseWaitGetResponse and sets the default values.
*/
public function __construct() {
parent::__construct();
}

/**
* Creates a new instance of the appropriate class based on discriminator value
* @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object
* @return ReleaseWaitGetResponse
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): ReleaseWaitGetResponse {
return new ReleaseWaitGetResponse();
}

/**
* The deserialization information for the current model
* @return array<string, callable(ParseNode): void>
*/
public function getFieldDeserializers(): array {
$o = $this;
return array_merge(parent::getFieldDeserializers(), [
'value' => fn(ParseNode $n) => $o->setValue($n->getCollectionOfObjectValues([PrintJob::class, 'createFromDiscriminatorValue'])),
]);
}

/**
* Gets the value property value. The value property
* @return array<PrintJob>|null
*/
public function getValue(): ?array {
$val = $this->getBackingStore()->get('value');
if (is_array($val) || is_null($val)) {
TypeUtils::validateCollectionValues($val, PrintJob::class);
/** @var array<PrintJob>|null $val */
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'value'");
}

/**
* Serializes information the current object
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void {
parent::serialize($writer);
$writer->writeCollectionOfObjectValues('value', $this->getValue());
}

/**
* Sets the value property value. The value property
* @param array<PrintJob>|null $value Value to set for the value property.
*/
public function setValue(?array $value): void {
$this->getBackingStore()->set('value', $value);
}

}
Loading
Loading