func (client *Client) CreateStreamRuleContext(
	ctx context.Context, rule *graylog.StreamRule,
) (*ErrorInfo, error) {
	// POST /streams/{streamid}/rules Create a stream rule
	if rule == nil {
		return nil, errors.New("rule is required")
	}
	u, err := client.Endpoints().StreamRules(rule.StreamID)
	if err != nil {
		return nil, err
	}

	cr := *rule
	cr.StreamID = ""
	body := &streamRuleIDBody{}
	ei, err := client.callPost(ctx, u.String(), &cr, body)
	rule.ID = body.StreamRuleID
	return ei, err
}
// CreateStreamRuleContext creates a stream with a context
CreateStreamRuleContext creates a stream with a context
// CreateStreamRuleContext creates a stream with a context
func (client *Client) CreateStreamRuleContext(
	ctx context.Context, rule *graylog.StreamRule,
) (*ErrorInfo, error) {
	if rule == nil {
		return nil, errors.New("rule is required")
	}
	u, err := client.Endpoints().StreamRules(rule.StreamID)
	if err != nil {
		return nil, err
	}
	cr := *rule
	cr.StreamID = ""
	body := &streamRuleIDBody{}
	ei, err := client.callPost(ctx, u.String(), &cr, body)
	rule.ID = body.StreamRuleID
	return ei, err
}
func ( client * Client ) CreateStreamRuleContext ( ctx context . Context , rule * graylog . StreamRule , ) ( * ErrorInfo , error ) { if rule == nil { return nil , errors . New ( " " ) } u , err := client . Endpoints ( ) . StreamRules ( rule . StreamID ) if err != nil { return nil , err } cr := * rule cr . StreamID = " " body := & streamRuleIDBody { } ei , err := client . callPost ( ctx , u . String ( ) , & cr , body ) rule . ID = body . StreamRuleID return ei , err }
CreateStreamRuleContext creates a stream with a context
CreateStreamRuleContext creates a stream with a context
// POST /streams/{streamid}/rules Create a stream rule