I'm looking at ExternalContactsApi.PostExternalcontactsBulkContactsRemoveAsync(), and see that it needs to be passed a BulkIdsRequest, which contains a list of Entities (List< Entity >).
However, Entity.Id is read-only {get;}. So even though I can create an Entity(), I can't set it's Id and therefore it's of no value, since PostExternalcontactsBulkContactsRemoveAsync is of course expecting entities with Id's.
When I examine BulkIdsRequest definition, I don't see any additional constuctors where I could do something like pass a list of Id strings.
This is more bandaid than anything, but you can do this to make it work if no-one here has an answer for how it was actually expected to work;
ExternalContact externalContact = new ExternalContact(Id: "12345");
Entity e = JsonConvert.DeserializeObject(externalContact.ToJson(), typeof(Entity)) as Entity;
or more accurately;
List<ExternalContact> externalContacts = new List<ExternalContact>() { new ExternalContact(Id: "12345"), new ExternalContact(Id: "67890") };
string json = JsonConvert.SerializeObject(externalContacts);
List<Entity> entities = JsonConvert.DeserializeObject(json, typeof(List<Entity>)) as List<Entity>;
But you could also turn in a bug report through customer care that it's probably not working the way they thought it would, since my guess is the support here is going to tell you to do that.
Please open a case with Genesys Cloud Care to report this bug; the input values should not be read-only. This is an issue with the API's definition as the API documentation and SDKs are both generated from this definition and therefore both have the id property as readonly. The workaround @Eos_Rios mentioned is what I would suggest as well; you can deserialize JSON into a model with readonly properties. The full request body JSON would look like this:
Thanks for the replies. I had already considered using JSON to work around the issue, but before doing so I wanted to see if this was in fact an issue/bug and not a case of my misunderstanding the API/SDK.