daveaglick / NetlifySharp

A .NET API Client for Netlify
http://netlifysharp.netlify.com/
MIT License
15 stars 6 forks source link

Draft deploy #2

Open TechWatching opened 5 years ago

TechWatching commented 5 years ago

Is there a way to use the UpdateSite method but specifying that this is a draft deploy to avoid publishing directly the new deploy to the site ?

I am a bit confuse as the Netlify Open API does not specify the route used by the UpdateSite method. However this route is mentionned on the Netlify documentation. I know that this is possible when using file diggest but it is not implemented in NetlifySharp. Are there plans to update the NetlifySharp library ? Is implementing the whole Netlify API still a goal ?

daveaglick commented 5 years ago

Is there a way to use the UpdateSite method but specifying that this is a draft deploy

As far as I know, the implemented endpoints support all the available options. Though it's been a little while since I worked on them, so it's possible Netlify has added more properties since then. I'm not sure if the UpdateSite endpoint accepts a "draft" flag (or what that would do - does Netlify have the concept of "drafts"?)

Are there plans to update the NetlifySharp library? Is implementing the whole Netlify API still a goal?

Yes - I plan to eventually add missing endpoints and am happy to take a look at expending the endpoints that have already been implemented if there are new properties. I'd love to get support for things like forms implemented - just a matter of finding the time.

TechWatching commented 5 years ago

Yes Netlify has the concept of draft:

When creating a new deploy, you can set "draft": true to mark the deploy as a draft deploy. Draft deploys works just like normal deploys, but they won’t change the active deploy of the site once they’re done processing.

But from what I understand the draft flag should be set in the body of POST request to /api/v1/sites/:site_id/deploys which is not the endpoint the UpdateSite uses.

I will play a little with the Netlify API when I will have some time, to see if the draft flag can easily be added to NetlifySharp. What is deconcerting is that Netlify documentation and their swagger don't have the same information.