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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Generated/Devices/DevicesRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Microsoft\Graph\Generated\Devices\GetAvailableExtensionProperties\GetAvailableExtensionPropertiesRequestBuilder;
use Microsoft\Graph\Generated\Devices\GetByIds\GetByIdsRequestBuilder;
use Microsoft\Graph\Generated\Devices\Item\DeviceItemRequestBuilder;
use Microsoft\Graph\Generated\Devices\Provision\ProvisionRequestBuilder;
use Microsoft\Graph\Generated\Devices\ValidateProperties\ValidatePropertiesRequestBuilder;
use Microsoft\Graph\Generated\Models\Device;
use Microsoft\Graph\Generated\Models\DeviceCollectionResponse;
Expand Down Expand Up @@ -51,6 +52,13 @@ public function getByIds(): GetByIdsRequestBuilder {
return new GetByIdsRequestBuilder($this->pathParameters, $this->requestAdapter);
}

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

/**
* Provides operations to call the validateProperties method.
*/
Expand Down
114 changes: 114 additions & 0 deletions src/Generated/Devices/Provision/ProvisionPostRequestBody.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?php

namespace Microsoft\Graph\Generated\Devices\Provision;

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 ProvisionPostRequestBody implements AdditionalDataHolder, BackedModel, Parsable
{
/**
* @var BackingStore $backingStore Stores model information.
*/
private BackingStore $backingStore;

/**
* Instantiates a new ProvisionPostRequestBody 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 ProvisionPostRequestBody
*/
public static function createFromDiscriminatorValue(ParseNode $parseNode): ProvisionPostRequestBody {
return new ProvisionPostRequestBody();
}

/**
* 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 [
'provisioningBlob' => fn(ParseNode $n) => $o->setProvisioningBlob($n->getStringValue()),
];
}

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

/**
* Serializes information the current object
* @param SerializationWriter $writer Serialization writer to use to serialize this model
*/
public function serialize(SerializationWriter $writer): void {
$writer->writeStringValue('provisioningBlob', $this->getProvisioningBlob());
$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 provisioningBlob property value. The provisioningBlob property
* @param string|null $value Value to set for the provisioningBlob property.
*/
public function setProvisioningBlob(?string $value): void {
$this->getBackingStore()->set('provisioningBlob', $value);
}

}
78 changes: 78 additions & 0 deletions src/Generated/Devices/Provision/ProvisionRequestBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php

namespace Microsoft\Graph\Generated\Devices\Provision;

use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
use Microsoft\Graph\Generated\Models\ProvisionResponse;
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 provision method.
*/
class ProvisionRequestBuilder extends BaseRequestBuilder
{
/**
* Instantiates a new ProvisionRequestBuilder 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}/devices/provision');
if (is_array($pathParametersOrRawUrl)) {
$this->pathParameters = $pathParametersOrRawUrl;
} else {
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
}
}

/**
* Provision a device on behalf of an approved Virtual Desktop Infrastructure (VDI) provider. This action wraps the Zero Touch Deployment (ZTD) protocol to create a device in a pending state in the customer's directory. The device can't be used for authentication until it completes its registration. The created device is stamped with a system label that identifies the approved VDI provider. Only VDI applications on Microsoft's approved list of VDI providers can successfully call this action. Calls from other applications are blocked even when the application is granted the required permission.
* @param ProvisionPostRequestBody $body The request body
* @param ProvisionRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<ProvisionResponse|null>
* @throws Exception
* @link https://learn.microsoft.com/graph/api/device-provision?view=graph-rest-1.0 Find more info here
*/
public function post(ProvisionPostRequestBody $body, ?ProvisionRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [ProvisionResponse::class, 'createFromDiscriminatorValue'], $errorMappings);
}

/**
* Provision a device on behalf of an approved Virtual Desktop Infrastructure (VDI) provider. This action wraps the Zero Touch Deployment (ZTD) protocol to create a device in a pending state in the customer's directory. The device can't be used for authentication until it completes its registration. The created device is stamped with a system label that identifies the approved VDI provider. Only VDI applications on Microsoft's approved list of VDI providers can successfully call this action. Calls from other applications are blocked even when the application is granted the required permission.
* @param ProvisionPostRequestBody $body The request body
* @param ProvisionRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toPostRequestInformation(ProvisionPostRequestBody $body, ?ProvisionRequestBuilderPostRequestConfiguration $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 ProvisionRequestBuilder
*/
public function withUrl(string $rawUrl): ProvisionRequestBuilder {
return new ProvisionRequestBuilder($rawUrl, $this->requestAdapter);
}

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

namespace Microsoft\Graph\Generated\Devices\Provision;

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

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

namespace Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\RefreshStatus;

use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
use Microsoft\Graph\Generated\Models\RelatedTenantsRefreshStatus;
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 refreshStatus method.
*/
class RefreshStatusRequestBuilder extends BaseRequestBuilder
{
/**
* Instantiates a new RefreshStatusRequestBuilder 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}/directory/tenantGovernance/relatedTenants/refreshStatus()');
if (is_array($pathParametersOrRawUrl)) {
$this->pathParameters = $pathParametersOrRawUrl;
} else {
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
}
}

/**
* Invoke function refreshStatus
* @param RefreshStatusRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return Promise<RelatedTenantsRefreshStatus|null>
* @throws Exception
*/
public function get(?RefreshStatusRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
$errorMappings = [
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
];
return $this->requestAdapter->sendAsync($requestInfo, [RelatedTenantsRefreshStatus::class, 'createFromDiscriminatorValue'], $errorMappings);
}

/**
* Invoke function refreshStatus
* @param RefreshStatusRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
* @return RequestInformation
*/
public function toGetRequestInformation(?RefreshStatusRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
$requestInfo = new RequestInformation();
$requestInfo->urlTemplate = $this->urlTemplate;
$requestInfo->pathParameters = $this->pathParameters;
$requestInfo->httpMethod = HttpMethod::GET;
if ($requestConfiguration !== null) {
$requestInfo->addHeaders($requestConfiguration->headers);
$requestInfo->addRequestOptions(...$requestConfiguration->options);
}
$requestInfo->tryAddHeader('Accept', "application/json");
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 RefreshStatusRequestBuilder
*/
public function withUrl(string $rawUrl): RefreshStatusRequestBuilder {
return new RefreshStatusRequestBuilder($rawUrl, $this->requestAdapter);
}

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

namespace Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\RefreshStatus;

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

/**
* Configuration for the request such as headers, query parameters, and middleware options.
*/
class RefreshStatusRequestBuilderGetRequestConfiguration extends BaseRequestConfiguration
{
/**
* Instantiates a new RefreshStatusRequestBuilderGetRequestConfiguration 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
Expand Up @@ -7,6 +7,7 @@
use Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\Count\CountRequestBuilder;
use Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\Item\RelatedTenantItemRequestBuilder;
use Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\Refresh\RefreshRequestBuilder;
use Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\RefreshStatus\RefreshStatusRequestBuilder;
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
use Microsoft\Graph\Generated\Models\RelatedTenant;
use Microsoft\Graph\Generated\Models\RelatedTenantCollectionResponse;
Expand Down Expand Up @@ -34,6 +35,13 @@ public function refresh(): RefreshRequestBuilder {
return new RefreshRequestBuilder($this->pathParameters, $this->requestAdapter);
}

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

/**
* Provides operations to manage the relatedTenants property of the microsoft.graph.tenantGovernance entity.
* @param string $relatedTenantId The unique identifier of relatedTenant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Exception;
use Http\Promise\Promise;
use Microsoft\Graph\Generated\Drives\Item\EscapedList\Items\Item\Permissions\Item\Grant\GrantRequestBuilder;
use Microsoft\Graph\Generated\Drives\Item\EscapedList\Items\Item\Permissions\Item\RevokeGrants\RevokeGrantsRequestBuilder;
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
use Microsoft\Graph\Generated\Models\Permission;
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
Expand All @@ -24,6 +25,13 @@ public function grant(): GrantRequestBuilder {
return new GrantRequestBuilder($this->pathParameters, $this->requestAdapter);
}

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

/**
* Instantiates a new PermissionItemRequestBuilder and sets the default values.
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
Expand Down
Loading
Loading