func (hc HTTPClient) CreateIncident(ctx context.Context, incident CreateIncidentInput) (output Incident, err error) {
	var res *http.Response
	res, err = hc.Request(ctx,
		r2.OptPost(),
		r2.OptPath("/incidents"),
		r2.OptJSONBody(createIncidentInputWrapper{Incident: incident}),
	).Do()
	if err != nil {
		return
	}
	if statusCode := res.StatusCode; statusCode < 200 || statusCode > 299 {
		err = ex.New(ErrNon200Status, ex.OptMessagef("method: post, path: /incidents, status: %d", statusCode))
		return
	}
	defer res.Body.Close()
	var body createIncidentOutputWrapper
	if err = json.NewDecoder(res.Body).Decode(&body); err != nil {
		err = ex.New(err)
		return
	}
	output = body.Incident
	return
}
// CreateIncident creates an incident using the incident events api.
CreateIncident creates an incident using the incident events api.
// CreateIncident creates an incident using the incident events api .
func (hc HTTPClient) CreateIncident(ctx context.Context, incident CreateIncidentInput) (output Incident, err error) {
	var res *http.Response
	res, err = hc.Request(ctx,
		r2.OptPost(),
		r2.OptPath("/incidents"),
		r2.OptJSONBody(createIncidentInputWrapper{Incident: incident}),
	).Do()
	if err != nil {
		return
	}
	if statusCode := res.StatusCode; statusCode < 200 || statusCode > 299 {
		err = ex.New(ErrNon200Status, ex.OptMessagef("method: post, path: /incidents, status: %d", statusCode))
		return
	}
	defer res.Body.Close()
	var body createIncidentOutputWrapper
	if err = json.NewDecoder(res.Body).Decode(&body); err != nil {
		err = ex.New(err)
		return
	}
	output = body.Incident
	return
}
func ( hc HTTPClient ) CreateIncident ( ctx context . Context , incident CreateIncidentInput ) ( output Incident , err error ) { var res * http . Response res , err = hc . Request ( ctx , r2 . OptPost ( ) , r2 . OptPath ( " " ) , r2 . OptJSONBody ( createIncidentInputWrapper { Incident : incident } ) , ) . Do ( ) if err != nil { return } if statusCode := res . StatusCode ; statusCode < 200 || statusCode > 299 { err = ex . New ( ErrNon200Status , ex . OptMessagef ( " " , statusCode ) ) return } defer res . Body . Close ( ) var body createIncidentOutputWrapper if err = json . NewDecoder ( res . Body ) . Decode ( & body ) ; err != nil { err = ex . New ( err ) return } output = body . Incident return }
CreateIncident creates an incident using the incident events api.
CreateIncident creates an incident using the incident events api .