heroku / platform-api

Ruby HTTP client for the Heroku API
MIT License
214 stars 85 forks source link

Installing a buildpack #53

Closed jshapiro26 closed 7 years ago

jshapiro26 commented 7 years ago

I can't seem to find the correct name to use for installing a buildpack via the gem. Let's say I initialized a connection and assigned it to platform_api. To update the installation of buildpacks for an app, I would assume it would be something like:

platform_api.buildpack_installation.update("my_app", {"buildpack" => "nameofbuildpack"})

However I just get 422's back saying that buildpack is an unknown param. Looking at the platform api documentation here: https://devcenter.heroku.com/articles/platform-api-reference#buildpack-installations It looks like I should be sending an array but it doesn't look like any of the other actions send arrays in this gem. I can't seem to find any working combination. Any help would be appreciated.

geemus commented 7 years ago

Yeah, that is strange one, I think what you want is this:

platform_api.buildpack_installation.update(
  "my_app",
  {
    "updates" => [
      { "buildpack" => "nameofbuildpack" }
    ]
  }
)

Hope that solves it for you, but just let me know if you have further questions. Thanks!

jshapiro26 commented 7 years ago

Thanks! works just as expected.