I want to view the Metadata(RecordType, VF access, Apex class access,etc.) from Profile using Tooling API. My code looks similar to this
ToolingAPI toolingAPI = new ToolingAPI();
List<ToolingAPIWSDL.sObject_x> profileObject = (List<ToolingAPIWSDL.sObject_x>)toolingAPI.query('Select Description, FullName, Metadata From Profile Where FullName = \'Admin\'').records;
System.debug('Description' + profileObject.Description);
System.debug('FullName' + profileObject.FullName);
System.debug('Metadata' + profileObject.Metadata);
System.debug('RT' + profileObject.Metadata.ProfileRecordTypeVisibility);
System.debug('VF' + profileObject.Metadata.ProfileApexPageAccess );
By this code i can see in the debug description, fullname correctly stated, but metadata receive null values for all fields like ProfileRecordTypeVisibility, ProfileApexPageAccess, etc. Where could be the problem? How can I get any list for record types, apex classes, pages for any profile?