MSGraph-SDK-Code-Generator icon indicating copy to clipboard operation
MSGraph-SDK-Code-Generator copied to clipboard

feature: support upsert

Open MIchaelMainer opened this issue 3 years ago • 1 comments

Graph Connectors uses an upsert operation to add an item with an identifier supplied by the client. We currently do not support this scenario. We need to process the UpdateRestrictionsType Upsertable=true property to generate a method that submits a request like the one described below:

PUT https://graph.microsoft.com/beta/connections/contosohr/items/TSP228082938
Content-type: application/json

{
  "@odata.type": "microsoft.graph.externalItem",
  "acl": [
    {
      "type": "user",
      "value": "e811976d-83df-4cbd-8b9b-5215b18aa874",
      "accessType": "grant",
      "identitySource": "azureActiveDirectory"
    },
    {
      "type": "group",
      "value": "14m1b9c38qe647f6a",
      "accessType": "deny",
      "identitySource": "external"
    }
  ],
  "properties": {
    "title": "Error in the payment gateway",
    "priority": 1,
    "assignee": "[email protected]"
  },
  "content": {
    "value": "Error in payment gateway...",
    "type": "text"
  }
}

https://docs.microsoft.com/en-us/graph/api/externalconnection-put-items?view=graph-rest-beta&tabs=http http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_UpsertanEntity

In the meantime, for .NET we can mitigate with a partial that supports this that matches the documentation.
AB#6463

We need to consider for PowerShell, Java, and other libraries.

MIchaelMainer avatar Oct 28 '20 05:10 MIchaelMainer

needs to be covered and tested across all SDKs.

ddyett avatar Oct 29 '20 19:10 ddyett