meilisearch / meilisearch-swift

Swift client for the Meilisearch API
https://www.meilisearch.com
MIT License
93 stars 26 forks source link

Make the type of a Task a enum of values #363

Closed brunoocasali closed 1 year ago

brunoocasali commented 1 year ago

In /Sources/MeiliSearch/Model/Task.swift:

The attribute public let type: String should become an enum. The possible values are:

indexCreation, indexUpdate, indexDeletion, indexSwap, documentAdditionOrUpdate, documentDeletion, settingsUpdate, dumpCreation, taskCancelation, taskDeletion, and snapshotCreation
Dishant10 commented 1 year ago

Hii, I would like to fix this issue. Please assign this issue to me and if possible please mention any extra information that is required apart from the above statement. Thank you!!

brunoocasali commented 1 year ago

Hi! @Dishant10. Good to see you again!

This issue is very straightforward! Something I could add to it is the value of the enum should be sent as camelCase eg. "indexUpdate", even if the enum key is INDEX_UPDATE.

You don't need to be assigned to the issue, we usually don't do it since people may not come back! And this could prevent other potential developers to contribute!

See you soon! Let me know if you have any doubts!

Dishant10 commented 1 year ago

Got it! Let me try this one. I'll ask if I get stuck somewhere. Thank you!!!

Dishant10 commented 1 year ago

I've raised a PR, please review it. I'll make any changes if needed. Thank you!!