Both are right.
The translation is “Je ne me suis pas plaint” (eg1) but if you use it in a different context, you could say “je n’ai pas à me plaindre” (it’s more an “expression”, see below eg2))
Eg1: “Je ne me suis pas plaint du manque de chauffage” (I didn’t complain about the lack of heating)
Eg2 : “J’ai un bon poste, je n’ai pas à me plaindre” (I have a good situation at work, I didn’t complain)
To add to @Raiana’s answer.
“That millionaire guy felt generous when coming out of that bar last night: he gave me $100! Je ne me suis pas plaint!”, generally referring to something in particular.
“- Hows your new job? – Ah! Coworkers are nice, salary is decent, duties are challenging..! Je n’ai pas à me plaindre!”, refers more to a more global situation.
You are right, Google Translate is wrong.
“Ne pas avoir à se plaindre” is quite idiomatic and means approximately “to have no reason to complain”, i.e. to be satisfied with a general situation. The example from Alexandre is a great use of it.
- Hows your new job? – Ah! Coworkers are nice, salary is decent, duties are challenging..! Je n’ai pas à me plaindre!
“Not to complain” would be “ne pas se plaindre”, simply.
Moreover, in that case, Google translate misidentified the tense: it translated a past tense into a present tense. You should indeed use a past tense in French too, the passé composé being the most logical here.
In the end, “ne pas se plaindre”, passé composé first person singular is indeed “Je ne me suis pas plaint”.
I would say : “Je n’ai pas eu à me plaindre.”
But other forms are good too it all depend of the context of the sentence.