Skip to content

Commit 8c322bf

Browse files
feat(generation): update request builders and models (#1816)
Update generated files with build 251993. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 380ba4d9-c690-4da5-a384-5263d2f0cdf1
1 parent 463dedf commit 8c322bf

114 files changed

Lines changed: 5578 additions & 55 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎src/Generated/Devices/DevicesRequestBuilder.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Microsoft\Graph\Generated\Devices\GetAvailableExtensionProperties\GetAvailableExtensionPropertiesRequestBuilder;
1010
use Microsoft\Graph\Generated\Devices\GetByIds\GetByIdsRequestBuilder;
1111
use Microsoft\Graph\Generated\Devices\Item\DeviceItemRequestBuilder;
12+
use Microsoft\Graph\Generated\Devices\Provision\ProvisionRequestBuilder;
1213
use Microsoft\Graph\Generated\Devices\ValidateProperties\ValidatePropertiesRequestBuilder;
1314
use Microsoft\Graph\Generated\Models\Device;
1415
use Microsoft\Graph\Generated\Models\DeviceCollectionResponse;
@@ -51,6 +52,13 @@ public function getByIds(): GetByIdsRequestBuilder {
5152
return new GetByIdsRequestBuilder($this->pathParameters, $this->requestAdapter);
5253
}
5354

55+
/**
56+
* Provides operations to call the provision method.
57+
*/
58+
public function provision(): ProvisionRequestBuilder {
59+
return new ProvisionRequestBuilder($this->pathParameters, $this->requestAdapter);
60+
}
61+
5462
/**
5563
* Provides operations to call the validateProperties method.
5664
*/
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Devices\Provision;
4+
5+
use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
6+
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
7+
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
8+
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
9+
use Microsoft\Kiota\Abstractions\Store\BackedModel;
10+
use Microsoft\Kiota\Abstractions\Store\BackingStore;
11+
use Microsoft\Kiota\Abstractions\Store\BackingStoreFactorySingleton;
12+
13+
class ProvisionPostRequestBody implements AdditionalDataHolder, BackedModel, Parsable
14+
{
15+
/**
16+
* @var BackingStore $backingStore Stores model information.
17+
*/
18+
private BackingStore $backingStore;
19+
20+
/**
21+
* Instantiates a new ProvisionPostRequestBody and sets the default values.
22+
*/
23+
public function __construct() {
24+
$this->backingStore = BackingStoreFactorySingleton::getInstance()->createBackingStore();
25+
$this->setAdditionalData([]);
26+
}
27+
28+
/**
29+
* Creates a new instance of the appropriate class based on discriminator value
30+
* @param ParseNode $parseNode The parse node to use to read the discriminator value and create the object
31+
* @return ProvisionPostRequestBody
32+
*/
33+
public static function createFromDiscriminatorValue(ParseNode $parseNode): ProvisionPostRequestBody {
34+
return new ProvisionPostRequestBody();
35+
}
36+
37+
/**
38+
* Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
39+
* @return array<string, mixed>|null
40+
*/
41+
public function getAdditionalData(): ?array {
42+
$val = $this->getBackingStore()->get('additionalData');
43+
if (is_null($val) || is_array($val)) {
44+
/** @var array<string, mixed>|null $val */
45+
return $val;
46+
}
47+
throw new \UnexpectedValueException("Invalid type found in backing store for 'additionalData'");
48+
}
49+
50+
/**
51+
* Gets the BackingStore property value. Stores model information.
52+
* @return BackingStore
53+
*/
54+
public function getBackingStore(): BackingStore {
55+
return $this->backingStore;
56+
}
57+
58+
/**
59+
* The deserialization information for the current model
60+
* @return array<string, callable(ParseNode): void>
61+
*/
62+
public function getFieldDeserializers(): array {
63+
$o = $this;
64+
return [
65+
'provisioningBlob' => fn(ParseNode $n) => $o->setProvisioningBlob($n->getStringValue()),
66+
];
67+
}
68+
69+
/**
70+
* Gets the provisioningBlob property value. The provisioningBlob property
71+
* @return string|null
72+
*/
73+
public function getProvisioningBlob(): ?string {
74+
$val = $this->getBackingStore()->get('provisioningBlob');
75+
if (is_null($val) || is_string($val)) {
76+
return $val;
77+
}
78+
throw new \UnexpectedValueException("Invalid type found in backing store for 'provisioningBlob'");
79+
}
80+
81+
/**
82+
* Serializes information the current object
83+
* @param SerializationWriter $writer Serialization writer to use to serialize this model
84+
*/
85+
public function serialize(SerializationWriter $writer): void {
86+
$writer->writeStringValue('provisioningBlob', $this->getProvisioningBlob());
87+
$writer->writeAdditionalData($this->getAdditionalData());
88+
}
89+
90+
/**
91+
* Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
92+
* @param array<string,mixed> $value Value to set for the AdditionalData property.
93+
*/
94+
public function setAdditionalData(?array $value): void {
95+
$this->getBackingStore()->set('additionalData', $value);
96+
}
97+
98+
/**
99+
* Sets the BackingStore property value. Stores model information.
100+
* @param BackingStore $value Value to set for the BackingStore property.
101+
*/
102+
public function setBackingStore(BackingStore $value): void {
103+
$this->backingStore = $value;
104+
}
105+
106+
/**
107+
* Sets the provisioningBlob property value. The provisioningBlob property
108+
* @param string|null $value Value to set for the provisioningBlob property.
109+
*/
110+
public function setProvisioningBlob(?string $value): void {
111+
$this->getBackingStore()->set('provisioningBlob', $value);
112+
}
113+
114+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Devices\Provision;
4+
5+
use Exception;
6+
use Http\Promise\Promise;
7+
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
8+
use Microsoft\Graph\Generated\Models\ProvisionResponse;
9+
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
10+
use Microsoft\Kiota\Abstractions\HttpMethod;
11+
use Microsoft\Kiota\Abstractions\RequestAdapter;
12+
use Microsoft\Kiota\Abstractions\RequestInformation;
13+
14+
/**
15+
* Provides operations to call the provision method.
16+
*/
17+
class ProvisionRequestBuilder extends BaseRequestBuilder
18+
{
19+
/**
20+
* Instantiates a new ProvisionRequestBuilder and sets the default values.
21+
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
22+
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
23+
*/
24+
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
25+
parent::__construct($requestAdapter, [], '{+baseurl}/devices/provision');
26+
if (is_array($pathParametersOrRawUrl)) {
27+
$this->pathParameters = $pathParametersOrRawUrl;
28+
} else {
29+
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
30+
}
31+
}
32+
33+
/**
34+
* 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.
35+
* @param ProvisionPostRequestBody $body The request body
36+
* @param ProvisionRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
37+
* @return Promise<ProvisionResponse|null>
38+
* @throws Exception
39+
* @link https://learn.microsoft.com/graph/api/device-provision?view=graph-rest-1.0 Find more info here
40+
*/
41+
public function post(ProvisionPostRequestBody $body, ?ProvisionRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise {
42+
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration);
43+
$errorMappings = [
44+
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
45+
];
46+
return $this->requestAdapter->sendAsync($requestInfo, [ProvisionResponse::class, 'createFromDiscriminatorValue'], $errorMappings);
47+
}
48+
49+
/**
50+
* 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.
51+
* @param ProvisionPostRequestBody $body The request body
52+
* @param ProvisionRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
53+
* @return RequestInformation
54+
*/
55+
public function toPostRequestInformation(ProvisionPostRequestBody $body, ?ProvisionRequestBuilderPostRequestConfiguration $requestConfiguration = null): RequestInformation {
56+
$requestInfo = new RequestInformation();
57+
$requestInfo->urlTemplate = $this->urlTemplate;
58+
$requestInfo->pathParameters = $this->pathParameters;
59+
$requestInfo->httpMethod = HttpMethod::POST;
60+
if ($requestConfiguration !== null) {
61+
$requestInfo->addHeaders($requestConfiguration->headers);
62+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
63+
}
64+
$requestInfo->tryAddHeader('Accept', "application/json");
65+
$requestInfo->setContentFromParsable($this->requestAdapter, "application/json", $body);
66+
return $requestInfo;
67+
}
68+
69+
/**
70+
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
71+
* @param string $rawUrl The raw URL to use for the request builder.
72+
* @return ProvisionRequestBuilder
73+
*/
74+
public function withUrl(string $rawUrl): ProvisionRequestBuilder {
75+
return new ProvisionRequestBuilder($rawUrl, $this->requestAdapter);
76+
}
77+
78+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Devices\Provision;
4+
5+
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
6+
use Microsoft\Kiota\Abstractions\RequestOption;
7+
8+
/**
9+
* Configuration for the request such as headers, query parameters, and middleware options.
10+
*/
11+
class ProvisionRequestBuilderPostRequestConfiguration extends BaseRequestConfiguration
12+
{
13+
/**
14+
* Instantiates a new ProvisionRequestBuilderPostRequestConfiguration and sets the default values.
15+
* @param array<string, array<string>|string>|null $headers Request headers
16+
* @param array<RequestOption>|null $options Request options
17+
*/
18+
public function __construct(?array $headers = null, ?array $options = null) {
19+
parent::__construct($headers ?? [], $options ?? []);
20+
}
21+
22+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\RefreshStatus;
4+
5+
use Exception;
6+
use Http\Promise\Promise;
7+
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
8+
use Microsoft\Graph\Generated\Models\RelatedTenantsRefreshStatus;
9+
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
10+
use Microsoft\Kiota\Abstractions\HttpMethod;
11+
use Microsoft\Kiota\Abstractions\RequestAdapter;
12+
use Microsoft\Kiota\Abstractions\RequestInformation;
13+
14+
/**
15+
* Provides operations to call the refreshStatus method.
16+
*/
17+
class RefreshStatusRequestBuilder extends BaseRequestBuilder
18+
{
19+
/**
20+
* Instantiates a new RefreshStatusRequestBuilder and sets the default values.
21+
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.
22+
* @param RequestAdapter $requestAdapter The request adapter to use to execute the requests.
23+
*/
24+
public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) {
25+
parent::__construct($requestAdapter, [], '{+baseurl}/directory/tenantGovernance/relatedTenants/refreshStatus()');
26+
if (is_array($pathParametersOrRawUrl)) {
27+
$this->pathParameters = $pathParametersOrRawUrl;
28+
} else {
29+
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl];
30+
}
31+
}
32+
33+
/**
34+
* Invoke function refreshStatus
35+
* @param RefreshStatusRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
36+
* @return Promise<RelatedTenantsRefreshStatus|null>
37+
* @throws Exception
38+
*/
39+
public function get(?RefreshStatusRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise {
40+
$requestInfo = $this->toGetRequestInformation($requestConfiguration);
41+
$errorMappings = [
42+
'XXX' => [ODataError::class, 'createFromDiscriminatorValue'],
43+
];
44+
return $this->requestAdapter->sendAsync($requestInfo, [RelatedTenantsRefreshStatus::class, 'createFromDiscriminatorValue'], $errorMappings);
45+
}
46+
47+
/**
48+
* Invoke function refreshStatus
49+
* @param RefreshStatusRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
50+
* @return RequestInformation
51+
*/
52+
public function toGetRequestInformation(?RefreshStatusRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation {
53+
$requestInfo = new RequestInformation();
54+
$requestInfo->urlTemplate = $this->urlTemplate;
55+
$requestInfo->pathParameters = $this->pathParameters;
56+
$requestInfo->httpMethod = HttpMethod::GET;
57+
if ($requestConfiguration !== null) {
58+
$requestInfo->addHeaders($requestConfiguration->headers);
59+
$requestInfo->addRequestOptions(...$requestConfiguration->options);
60+
}
61+
$requestInfo->tryAddHeader('Accept', "application/json");
62+
return $requestInfo;
63+
}
64+
65+
/**
66+
* Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
67+
* @param string $rawUrl The raw URL to use for the request builder.
68+
* @return RefreshStatusRequestBuilder
69+
*/
70+
public function withUrl(string $rawUrl): RefreshStatusRequestBuilder {
71+
return new RefreshStatusRequestBuilder($rawUrl, $this->requestAdapter);
72+
}
73+
74+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\RefreshStatus;
4+
5+
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
6+
use Microsoft\Kiota\Abstractions\RequestOption;
7+
8+
/**
9+
* Configuration for the request such as headers, query parameters, and middleware options.
10+
*/
11+
class RefreshStatusRequestBuilderGetRequestConfiguration extends BaseRequestConfiguration
12+
{
13+
/**
14+
* Instantiates a new RefreshStatusRequestBuilderGetRequestConfiguration and sets the default values.
15+
* @param array<string, array<string>|string>|null $headers Request headers
16+
* @param array<RequestOption>|null $options Request options
17+
*/
18+
public function __construct(?array $headers = null, ?array $options = null) {
19+
parent::__construct($headers ?? [], $options ?? []);
20+
}
21+
22+
}

‎src/Generated/Directory/TenantGovernance/RelatedTenants/RelatedTenantsRequestBuilder.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\Count\CountRequestBuilder;
88
use Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\Item\RelatedTenantItemRequestBuilder;
99
use Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\Refresh\RefreshRequestBuilder;
10+
use Microsoft\Graph\Generated\Directory\TenantGovernance\RelatedTenants\RefreshStatus\RefreshStatusRequestBuilder;
1011
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
1112
use Microsoft\Graph\Generated\Models\RelatedTenant;
1213
use Microsoft\Graph\Generated\Models\RelatedTenantCollectionResponse;
@@ -34,6 +35,13 @@ public function refresh(): RefreshRequestBuilder {
3435
return new RefreshRequestBuilder($this->pathParameters, $this->requestAdapter);
3536
}
3637

38+
/**
39+
* Provides operations to call the refreshStatus method.
40+
*/
41+
public function refreshStatus(): RefreshStatusRequestBuilder {
42+
return new RefreshStatusRequestBuilder($this->pathParameters, $this->requestAdapter);
43+
}
44+
3745
/**
3846
* Provides operations to manage the relatedTenants property of the microsoft.graph.tenantGovernance entity.
3947
* @param string $relatedTenantId The unique identifier of relatedTenant

‎src/Generated/Drives/Item/EscapedList/Items/Item/Permissions/Item/PermissionItemRequestBuilder.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Exception;
66
use Http\Promise\Promise;
77
use Microsoft\Graph\Generated\Drives\Item\EscapedList\Items\Item\Permissions\Item\Grant\GrantRequestBuilder;
8+
use Microsoft\Graph\Generated\Drives\Item\EscapedList\Items\Item\Permissions\Item\RevokeGrants\RevokeGrantsRequestBuilder;
89
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError;
910
use Microsoft\Graph\Generated\Models\Permission;
1011
use Microsoft\Kiota\Abstractions\BaseRequestBuilder;
@@ -24,6 +25,13 @@ public function grant(): GrantRequestBuilder {
2425
return new GrantRequestBuilder($this->pathParameters, $this->requestAdapter);
2526
}
2627

28+
/**
29+
* Provides operations to call the revokeGrants method.
30+
*/
31+
public function revokeGrants(): RevokeGrantsRequestBuilder {
32+
return new RevokeGrantsRequestBuilder($this->pathParameters, $this->requestAdapter);
33+
}
34+
2735
/**
2836
* Instantiates a new PermissionItemRequestBuilder and sets the default values.
2937
* @param array<string, mixed>|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL.

0 commit comments

Comments
 (0)