msgraph-sdk-php icon indicating copy to clipboard operation
msgraph-sdk-php copied to clipboard

Support @odata.bind in our models

Open chems opened this issue 6 years ago • 1 comments

Hello, I think the SetOwners and SetMembers in Microsoft\Graph\Model\Group should have an array key with respectively [email protected] and [email protected] instead of members and owners in _propDict array , line 768 and 675, thx
AB#7588

chems avatar Feb 06 '19 12:02 chems

Setting arbitrary properties key-value pairs is currently done when instantiating an object. We do need to be able to set arbitrary properties after instantiation. We should have a conversation about whether we should support odata.bind scenarios as first class properties on our models - either through generation or extension.

Changes should happen on base objects.

https://docs.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0&tabs=http#example-2-create-a-group-with-owners-and-members

https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http

MIchaelMainer avatar May 26 '21 14:05 MIchaelMainer

Version 2.0 of this SDK now supports @odata.bind using the additionalData property found in all models.

Please check out the relevant code samples in the docs: https://learn.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0&tabs=php#example-2-create-a-group-with-owners-and-members

https://learn.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=php#example-2-add-multiple-members-to-a-group-in-a-single-request

For more on upgrading to v2.0, please see https://devblogs.microsoft.com/microsoft365dev/write-high-quality-code-with-the-microsoft-graph-php-sdk-v2/

Ndiritu avatar Nov 20 '23 14:11 Ndiritu