Wrong property types in MessageRuleActions
Hello,
I am currently trying to set an e-mail redirection using MessageRule and MessageRuleActions. I have noticed that the API expects the "redirectTo" property (the same applies to the two forwardTo properties) to be a collection, according to the official docs and the metadata.xml you are using to generate the models.
It seems that there is a bug in the generation process though, as the setter for the redirectTo property expects a single recipient, not a collection.
The problem is not that important since you can still pass an array of Microsoft\Graph\Model\Recipient objects instead of a single one, but PHPStorm for example marks it as a warning.
Is it possible to change the PHPDoc? I assume this gets automatically generated as well?
I doubt that it's necessary but here's a code snippet
$recipient = new Recipient();
// fill the object with stuff
// create the rule object and create an array of recipients instead of using the object directly
$rule = (new MessageRule())
->setActions(
(new MessageRuleActions())->setRedirectTo([$recipient])->setStopProcessingRules(false)
)->setDisplayName($displayName)
->setSequence(1)
->setIsEnabled(true);
SDK Version 1.33.0 PHP 7.4 AB#9620
Hello @fanonwue, thanks for reporting this and sorry for the inconvenience caused, we are working on fixing the issue with setters and getters for collection types which should be available in the next release. This relates to #97 and #76
PHPDoc issues were resolved.