123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125moduleError=structtypet=|BadAuthentication|NotVerified|TermsNotAgreed|CaptchaRequired|Unknown|AccountDeleted|AccountDisabled|ServiceDisabled|ServiceUnavailable|GenericErrorofstringletof_strings=matchswith|"BadAuthentication"->BadAuthentication|"NotVerified"->NotVerified|"TermsNotAgreed"->TermsNotAgreed|"CaptchaRequired"->CaptchaRequired|"Unknown"->Unknown|"AccountDeleted"->AccountDeleted|"AccountDisabled"->AccountDisabled|"ServiceDisabled"->ServiceDisabled|"ServiceUnavailable"->ServiceUnavailable|s->GenericErrorsletdescriptionerror=matcherrorwith|BadAuthentication->"Invalid username or password."|NotVerified->"The account email address has not been verified."|TermsNotAgreed->"The user has not agreed to terms."|CaptchaRequired->"A CAPTCHA is required."|Unknown->"Unknown or unspecified error."|AccountDeleted->"The user account has been deleted."|AccountDisabled->"The user account has been disabled."|ServiceDisabled->"The user's access to the specified service has been disabled."|ServiceUnavailable->"The service is not available; try again later."|GenericErrors->sendmoduleService=structtypet=|GoogleAnalytics|GoogleApps|GoogleBase|GoogleSites|Blogger|BookSearch|Calendar|GoogleCodeSearch|Contacts|DocumentsList|Finance|Gmail|Health|HealthSandbox|Maps|Picasa|Sidewiki|Spreadsheets|WebmasterTools|YouTube|OtherServiceofstringletstring_ofservice=matchservicewith|GoogleAnalytics->"analytics"|GoogleApps->"apps"|GoogleBase->"gbase"|GoogleSites->"jotspot"|Blogger->"blogger"|BookSearch->"print"|Calendar->"cl"|GoogleCodeSearch->"codesearch"|Contacts->"cp"|DocumentsList->"writely"|Finance->"finance"|Gmail->"mail"|Health->"health"|HealthSandbox->"weaver"|Maps->"local"|Picasa->"lh2"|Sidewiki->"annotateweb"|Spreadsheets->"wise"|WebmasterTools->"sitemaps"|YouTube->"youtube"|OtherServices->sendexceptionLoginExceptionofError.tletget_auth_token?(account_type="HOSTED_OR_GOOGLE")?(url="https://www.google.com/accounts/ClientLogin")~email~password~source~servicesession=letrecparse_next_linepipe=tryletline=GapiPipe.OcamlnetPipe.read_linepipeinletkey,value=GapiUtils.divide_stringline'='inmatchkeywith|"Auth"->GapiConversation.Done(GapiAuthResponse.ClientLoginAuthTokenvalue)|"Error"->GapiConversation.Errorvalue|_->GapiConversation.Continueparse_next_linewithEnd_of_file->GapiConversation.Error"Invalid response: authentication token not found"inletparse_login_responsepipe___=GapiConversation.loopparse_next_linepipeinletpost_data=GapiCore.PostData.Fields[("Email",email);("Passwd",password);("accountType",account_type);("source",source);("service",Service.string_ofservice);]intryGapiConversation.request~post_dataGapiCore.HttpMethod.POSTsessionurlparse_login_responsewithGapiConversation.ConversationExceptionmessage->raise(LoginException(Error.of_stringmessage))