flapjack / flapjack-diner

Consumer of the Flapjack API
http://flapjack.io/
MIT License
17 stars 10 forks source link

README.md omissions and errors #37

Closed ghicks-rmn closed 10 years ago

ghicks-rmn commented 10 years ago

Hi, let me know if I should split these into separate issues.

Flapjack::Diner.create_contacts([{
  :id         => '123',
  :first_name => 'john',
  :last_name  => 'smith',
  :email      => 'johnsmith@github.com',
  :timezone   => 'UTC',
  :tags       => ['foo', 'bar', 'baz'],
  :media => {
    :email => {
      :address => 'johnsmith@github.com', 
      :interval => '60',
      :rollup_threshold => '120'
    }
  }
}])
  1. If I create a new contact with Diner with the above code, it will actually create both the contact and the email address medium for it. This is very useful, but I had to discover it myself as README.md doesn't even say that ":media" can be set.
  2. Several update methods reference ":add_tag" and ":remove_tag" in README.md. So far at least, they don't appear to exist for any of the resource types. Are these just going to be added later?
  3. The header for "create_contact_pagerduty_credentials"'s section says "create_contact_media", and the header for "delete_notification_rules" says "delete_contacts."
ghost commented 10 years ago

No need to split, thanks for pointing these out.

1) is sort of vestigial from pre 1.0 days, the current code would work better with creating the contact and then creating the media as a second operation using create_contact_media.

2) The README in master references the latest code, which may contain unreleased stuff; quite a bit of the tag handling has seen work recently in Flapjack proper and here, I'll check to make sure that they're consistent and also try to make sure we release a new version of diner for the next Flapjack release, which should be soon.

3) is the result of excessive copy & paste, will fix.

I also need to change the docs for all create_* functions to point out that they now return the generated IDs.