0

I'm not a Java developer, but I need to automate creating email export for my Google domain and only .NET and Java are supported. Specifically, I'm attempting to replicate the snippet provided here: https://developers.google.com/google-apps/email-audit/#creating_a_mailbox_for_export

Unfortunately, I get I cannot resolve the following imports:

import com.google.gdata.client.appsforyourdomain.audit.AuditService;
import com.google.gdata.client.appsforyourdomain.audit.MailBoxDumpRequest;
import com.google.gdata.data.appsforyourdomain.generic.GenericEntry;

Oddly this import works:

import com.google.gdata.client.appsforyourdomain.AppsForYourDomainService;

I've tried using the libraries from the latest available download and from the source repository with no luck. Apologies for my misunderstanding of Java imports and packages, but I would appreciate guidance as to resolving the three above imports.

mjw
  • 11
  • 1

1 Answers1

1

Unfortunately I was unable to solve the problem in Java. However, after investigating the Python implementation of the API I was able to match the functions well enough to get by with the PyDoc info.

The original goal was to export Gmail mailbox contents. The solution, in Python, is as follows:

from gdata.apps.audit.service import AuditService
audit_service = AuditService(domain="example.com")
audit_service.ClientLogin(admin_user, passwd)
audit_service.createMailboxExportRequest(user="target_user")

#check the status
audit_service.getAllMailboxExportRequestsStatus()

As typical Google/gData caveats you need to make sure your user account has appropriate permissions, you have enabled service, the API is authorized to use the service, gdata is install, updated, and in your PYTHONPATH, and that you've uploaded GPG keys to encrypt the data.

mjw
  • 11
  • 1