-
Notifications
You must be signed in to change notification settings - Fork 144
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 #1338 from microsoftgraph/kiota/v1.0/pipelinebuild…
…/124351 Generated models and request builders
- Loading branch information
Showing
243 changed files
with
6,597 additions
and
311 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
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
115 changes: 115 additions & 0 deletions
115
...erated/Communications/Presences/Item/SetStatusMessage/SetStatusMessagePostRequestBody.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,115 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Generated\Communications\Presences\Item\SetStatusMessage; | ||
|
||
use Microsoft\Graph\Generated\Models\PresenceStatusMessage; | ||
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 SetStatusMessagePostRequestBody implements AdditionalDataHolder, BackedModel, Parsable | ||
{ | ||
/** | ||
* @var BackingStore $backingStore Stores model information. | ||
*/ | ||
private BackingStore $backingStore; | ||
|
||
/** | ||
* Instantiates a new setStatusMessagePostRequestBody 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 SetStatusMessagePostRequestBody | ||
*/ | ||
public static function createFromDiscriminatorValue(ParseNode $parseNode): SetStatusMessagePostRequestBody { | ||
return new SetStatusMessagePostRequestBody(); | ||
} | ||
|
||
/** | ||
* 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 [ | ||
'statusMessage' => fn(ParseNode $n) => $o->setStatusMessage($n->getObjectValue([PresenceStatusMessage::class, 'createFromDiscriminatorValue'])), | ||
]; | ||
} | ||
|
||
/** | ||
* Gets the statusMessage property value. The statusMessage property | ||
* @return PresenceStatusMessage|null | ||
*/ | ||
public function getStatusMessage(): ?PresenceStatusMessage { | ||
$val = $this->getBackingStore()->get('statusMessage'); | ||
if (is_null($val) || $val instanceof PresenceStatusMessage) { | ||
return $val; | ||
} | ||
throw new \UnexpectedValueException("Invalid type found in backing store for 'statusMessage'"); | ||
} | ||
|
||
/** | ||
* Serializes information the current object | ||
* @param SerializationWriter $writer Serialization writer to use to serialize this model | ||
*/ | ||
public function serialize(SerializationWriter $writer): void { | ||
$writer->writeObjectValue('statusMessage', $this->getStatusMessage()); | ||
$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 statusMessage property value. The statusMessage property | ||
* @param PresenceStatusMessage|null $value Value to set for the statusMessage property. | ||
*/ | ||
public function setStatusMessage(?PresenceStatusMessage $value): void { | ||
$this->getBackingStore()->set('statusMessage', $value); | ||
} | ||
|
||
} |
80 changes: 80 additions & 0 deletions
80
...nerated/Communications/Presences/Item/SetStatusMessage/SetStatusMessageRequestBuilder.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,80 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Generated\Communications\Presences\Item\SetStatusMessage; | ||
|
||
use Exception; | ||
use Http\Promise\Promise; | ||
use Http\Promise\RejectedPromise; | ||
use Microsoft\Graph\Generated\Models\ODataErrors\ODataError; | ||
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 setStatusMessage method. | ||
*/ | ||
class SetStatusMessageRequestBuilder extends BaseRequestBuilder | ||
{ | ||
/** | ||
* Instantiates a new SetStatusMessageRequestBuilder 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}/communications/presences/{presence%2Did}/setStatusMessage'); | ||
if (is_array($pathParametersOrRawUrl)) { | ||
$this->pathParameters = $pathParametersOrRawUrl; | ||
} else { | ||
$this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl]; | ||
} | ||
} | ||
|
||
/** | ||
* Invoke action setStatusMessage | ||
* @param SetStatusMessagePostRequestBody $body The request body | ||
* @param SetStatusMessageRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return Promise | ||
*/ | ||
public function post(SetStatusMessagePostRequestBody $body, ?SetStatusMessageRequestBuilderPostRequestConfiguration $requestConfiguration = null): Promise { | ||
$requestInfo = $this->toPostRequestInformation($body, $requestConfiguration); | ||
try { | ||
$errorMappings = [ | ||
'4XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
'5XX' => [ODataError::class, 'createFromDiscriminatorValue'], | ||
]; | ||
return $this->requestAdapter->sendNoContentAsync($requestInfo, $errorMappings); | ||
} catch(Exception $ex) { | ||
return new RejectedPromise($ex); | ||
} | ||
} | ||
|
||
/** | ||
* Invoke action setStatusMessage | ||
* @param SetStatusMessagePostRequestBody $body The request body | ||
* @param SetStatusMessageRequestBuilderPostRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. | ||
* @return RequestInformation | ||
*/ | ||
public function toPostRequestInformation(SetStatusMessagePostRequestBody $body, ?SetStatusMessageRequestBuilderPostRequestConfiguration $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->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 SetStatusMessageRequestBuilder | ||
*/ | ||
public function withUrl(string $rawUrl): SetStatusMessageRequestBuilder { | ||
return new SetStatusMessageRequestBuilder($rawUrl, $this->requestAdapter); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...resences/Item/SetStatusMessage/SetStatusMessageRequestBuilderPostRequestConfiguration.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,22 @@ | ||
<?php | ||
|
||
namespace Microsoft\Graph\Generated\Communications\Presences\Item\SetStatusMessage; | ||
|
||
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration; | ||
use Microsoft\Kiota\Abstractions\RequestOption; | ||
|
||
/** | ||
* Configuration for the request such as headers, query parameters, and middleware options. | ||
*/ | ||
class SetStatusMessageRequestBuilderPostRequestConfiguration extends BaseRequestConfiguration | ||
{ | ||
/** | ||
* Instantiates a new setStatusMessageRequestBuilderPostRequestConfiguration 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 ?? []); | ||
} | ||
|
||
} |
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
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
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
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.