While creating gsuite user using directory api (python lib: google-api-python-client), values of certain parameters,viz., "emails", "externalIDs", "phones", "organisations", "gender", and all others that do not have simple string values, but rather accept values as an object or an array of objects, are not being uploaded despite using the described format in the references.
The python template is strictly followed from here and the values inserted are in accordance with the Request Body mentioned in this.
Although the user is being created successfully, but I am unable to feed values to the following parameters:
emails, phones, externalIds, gender
Even copying a json example from here, giving the appropriate values and executing here didn't produce required results.
Is this the issue with directory-api itself?
eg of body sent to the insert function as arg:
{'addresses': '',
'posixAccounts': '',
'thumbnailPhotoEtag': '',
'suspended': False,
'keywords': '',
'aliases': [],
'nonEditableAliases': [],
'suspensionReason': '',
'thumbnailPhotoUrl': '',
'isAdmin': False,
'relations': '',
'languages': '',
'ims': '',
'lastLoginTime': '',
'orgUnitPath': '',
'agreedToTerms': True,
'ipWhitelisted': True,
'sshPublicKeys': '',
'primaryEmail': 'abcdef@org.in',
'password': 'SXXXXXXXXU',
'emails': [{'customType': '',
'type': 'home',
'primary': False,
'address': 'abctest02@gmail.com'},
{'customType': '',
'type': 'work',
'primary': True,
'address': 'abcdef@org.in'}],
'organizations': '',
'kind': 'admin#directory#user',
'hashFunction': None,
'name': {'fullName': 'abcTT def',
'givenName': 'abcTT',
'familyName': 'def'},
'gender': {'customGender': '',
'type': 'male'},
'notes': '',
'creationTime': '',
'phones': ([{'type': 'work',
'value': '+91 123 456 7895'}],),
'locations': '',
'isDelegatedAdmin': False,
'id': '',
'customSchemas': {},
'deletionTime': '',
'isEnrolledIn2Sv': False,
'includeInGlobalAddressList': True,
'etag': '',
'externalIds': [{'type': 'organization',
'value': '22222222'}],
'isEnforcedIn2Sv': False,
'isMailboxSetup': False,
'websites': '',
'changePasswordAtNextLogin': True,
'customerId': ''}