-
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 #101 from microsoftgraph/dev
Release 2.0.0-RC10
- Loading branch information
Showing
251 changed files
with
9,668 additions
and
345 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
85 changes: 85 additions & 0 deletions
85
.../DeviceManagement/ComanagedDevices/Item/EnrollNowAction/EnrollNowActionRequestBuilder.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,85 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Beta\Generated\DeviceManagement\ComanagedDevices\Item\EnrollNowAction; | ||
|
||
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 EnrollNowActionRequestBuilder | ||
{ | ||
/** | ||
* @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 EnrollNowActionRequestBuilder 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}/deviceManagement/comanagedDevices/{managedDevice%2Did}/microsoft.graph.enrollNowAction'; | ||
$this->requestAdapter = $requestAdapter; | ||
$this->pathParameters = $pathParameters; | ||
} | ||
|
||
/** | ||
* Trigger comanagement enrollment action on ConfigurationManager client | ||
* @param EnrollNowActionRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return RequestInformation | ||
*/ | ||
public function createPostRequestInformation(?EnrollNowActionRequestBuilderPostRequestConfiguration $requestConfiguration = null): RequestInformation { | ||
$requestInfo = new RequestInformation(); | ||
$requestInfo->urlTemplate = $this->urlTemplate; | ||
$requestInfo->pathParameters = $this->pathParameters; | ||
$requestInfo->httpMethod = HttpMethod::POST; | ||
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; | ||
} | ||
|
||
/** | ||
* Trigger comanagement enrollment action on ConfigurationManager client | ||
* @param EnrollNowActionRequestBuilderPostRequestConfiguration|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(?EnrollNowActionRequestBuilderPostRequestConfiguration $requestConfiguration = null, ?ResponseHandler $responseHandler = null): Promise { | ||
$requestInfo = $this->createPostRequestInformation($requestConfiguration); | ||
try { | ||
$errorMappings = [ | ||
'4XX' => array(ODataError::class, 'createFromDiscriminatorValue'), | ||
'5XX' => array(ODataError::class, 'createFromDiscriminatorValue'), | ||
]; | ||
return $this->requestAdapter->sendNoContentAsync($requestInfo, $responseHandler, $errorMappings); | ||
} catch(Exception $ex) { | ||
return new RejectedPromise($ex); | ||
} | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...gedDevices/Item/EnrollNowAction/EnrollNowActionRequestBuilderPostRequestConfiguration.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,19 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Beta\Generated\DeviceManagement\ComanagedDevices\Item\EnrollNowAction; | ||
|
||
use Microsoft\Kiota\Abstractions\RequestOption; | ||
|
||
class EnrollNowActionRequestBuilderPostRequestConfiguration | ||
{ | ||
/** | ||
* @var array<string, string>|null $headers Request headers | ||
*/ | ||
public ?array $headers = null; | ||
|
||
/** | ||
* @var array<string, RequestOption>|null $options Request options | ||
*/ | ||
public ?array $options = null; | ||
|
||
} |
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
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.