createHook method

Future<Hook> createHook(
  1. String org,
  2. CreateHook hook
)

Creates an organization hook based on the specified hook.

API docs: https://developer.github.com/v3/orgs/hooks/#create-a-hook

Implementation

Future<Hook> createHook(String org, CreateHook hook) {
  return github.postJSON('/orgs/$org/hooks',
      convert: (Map<String, dynamic> i) => Hook.fromJson(i)..repoName = org,
      body: GitHubJson.encode(hook));
}