// Get method retrieves specified alert details from OpsGenie. func (cli *OpsGenieAlertClient) Get(req alerts.GetAlertRequest) (*alerts.GetAlertResponse, error) { req.APIKey = cli.apiKey resp, err := cli.sendRequest(cli.buildGetRequest(getAlertURL, req)) if resp == nil { return nil, err } defer resp.Body.Close() var getAlertResp alerts.GetAlertResponse if err = resp.Body.FromJsonTo(&getAlertResp); err != nil { message := "Server response can not be parsed, " + err.Error() logging.Logger().Warn(message) return nil, errors.New(message) } return &getAlertResp, nil }