func GetRoleOrCreate(cl *client.Client, name string) (*graylog.Role, error) {
	role, ei, err := cl.GetRole(name)
	if err == nil {
		return role, nil
	}
	if ei == nil || ei.Response == nil || ei.Response.StatusCode != 404 {
		return nil, err
	}
	role = Role()
	role.Name = name
	if _, err := cl.CreateRole(role); err != nil {
		return nil, err
	}
	return role, nil
}
// GetRoleOrCreate gets a given name's role.
// If no role whose name is a given name exists, create a role with a given name and returns it.
GetRoleOrCreate gets a given name's role.
If no role whose name is a given name exists, create a role with a given name and returns it.
// GetRoleOrCreate gets a given name ' s role . // If no role whose name is a given name exists create a role with a given name and returns it .
func GetRoleOrCreate(cl *client.Client, name string) (*graylog.Role, error) {
	role, ei, err := cl.GetRole(name)
	if err == nil {
		return role, nil
	}
	if ei == nil || ei.Response == nil || ei.Response.StatusCode != 404 {
		return nil, err
	}
	role = Role()
	role.Name = name
	if _, err := cl.CreateRole(role); err != nil {
		return nil, err
	}
	return role, nil
}
func GetRoleOrCreate ( cl * client . Client , name string ) ( * graylog . Role , error ) { role , ei , err := cl . GetRole ( name ) if err == nil { return role , nil } if ei == nil || ei . Response == nil || ei . Response . StatusCode != 404 { return nil , err } role = Role ( ) role . Name = name if _ , err := cl . CreateRole ( role ) ; err != nil { return nil , err } return role , nil }
GetRoleOrCreate gets a given name's role.
GetRoleOrCreate gets a given name ' s role .