func (client *Client) UpdateInputContext(
	ctx context.Context, prms *graylog.InputUpdateParams,
) (*graylog.Input, *ErrorInfo, error) {
	if prms == nil {
		return nil, nil, fmt.Errorf("input is nil")
	}
	if prms.ID == "" {
		return nil, nil, errors.New("id is empty")
	}
	u, err := client.Endpoints().Input(prms.ID)
	if err != nil {
		return nil, nil, err
	}
	// change attributes to configuration
	// https://github.com/Graylog2/graylog2-server/issues/3480
	d := map[string]interface{}{
		"title":         prms.Title,
		"type":          prms.Type,
		"configuration": prms.Attrs,
		"global":        prms.Global,
	}
	if prms.Node != "" {
		d["node"] = prms.Node
	}
	input := &graylog.Input{}
	ei, err := client.callPut(ctx, u.String(), &d, input)
	return input, ei, err
}
// UpdateInputContext updates an given input with a context.
UpdateInputContext updates an given input with a context.
// UpdateInputContext updates an given input with a context .
func (client *Client) UpdateInputContext(
	ctx context.Context, prms *graylog.InputUpdateParams,
) (*graylog.Input, *ErrorInfo, error) {
	if prms == nil {
		return nil, nil, fmt.Errorf("input is nil")
	}
	if prms.ID == "" {
		return nil, nil, errors.New("id is empty")
	}
	u, err := client.Endpoints().Input(prms.ID)
	if err != nil {
		return nil, nil, err
	}
	d := map[string]interface{}{
		"title":         prms.Title,
		"type":          prms.Type,
		"configuration": prms.Attrs,
		"global":        prms.Global,
	}
	if prms.Node != "" {
		d["node"] = prms.Node
	}
	input := &graylog.Input{}
	ei, err := client.callPut(ctx, u.String(), &d, input)
	return input, ei, err
}
func ( client * Client ) UpdateInputContext ( ctx context . Context , prms * graylog . InputUpdateParams , ) ( * graylog . Input , * ErrorInfo , error ) { if prms == nil { return nil , nil , fmt . Errorf ( " " ) } if prms . ID == " " { return nil , nil , errors . New ( " " ) } u , err := client . Endpoints ( ) . Input ( prms . ID ) if err != nil { return nil , nil , err } d := map [ string ] interface { } { " " : prms . Title , " " : prms . Type , " " : prms . Attrs , " " : prms . Global , } if prms . Node != " " { d [ " " ] = prms . Node } input := & graylog . Input { } ei , err := client . callPut ( ctx , u . String ( ) , & d , input ) return input , ei , err }
UpdateInputContext updates an given input with a context.
UpdateInputContext updates an given input with a context .
// change attributes to configuration // https://github.com/Graylog2/graylog2-server/issues/3480