// Disable method disables an Integration at OpsGenie. func (cli *OpsGenieIntegrationClient) Disable(req integration.DisableIntegrationRequest) (*integration.DisableIntegrationResponse, error) { req.APIKey = cli.apiKey resp, err := cli.sendRequest(cli.buildPostRequest(disableIntegrationURL, req)) if resp == nil { return nil, err } defer resp.Body.Close() var disableIntegrationResp integration.DisableIntegrationResponse if err = resp.Body.FromJsonTo(&disableIntegrationResp); err != nil { message := "Server response can not be parsed, " + err.Error() logging.Logger().Warn(message) return nil, errors.New(message) } return &disableIntegrationResp, nil }