** i'm thinking either switch or water fill valve **
I don't know what "switch" you would be referring to other than one which might be inside the icemaker itself? A defective fill valve may be a possibility if the unit is just not filling. Just a frozen closed icemaker fill tube might cause as well.
If you need any further help please post the appliance's *brand name* and its *model number* so we can look up what particular appliance you're dealing with. Not all icemakers are the same.
You can find tips for locating the model and serial number identification tag on your appliances in the 'Repair Parts' section of my web site linked below.