// Enable method enables an Policy at OpsGenie. func (cli *OpsGeniePolicyClient) Enable(req policy.EnablePolicyRequest) (*policy.EnablePolicyResponse, error) { req.APIKey = cli.apiKey resp, err := cli.sendRequest(cli.buildPostRequest(enablePolicyURL, req)) if resp == nil { return nil, err } defer resp.Body.Close() var enablePolicyResp policy.EnablePolicyResponse if err = resp.Body.FromJsonTo(&enablePolicyResp); err != nil { message := "Server response can not be parsed, " + err.Error() logging.Logger().Warn(message) return nil, errors.New(message) } return &enablePolicyResp, nil }