def deleteNickname(domain, auth_token, nickname): server = "apps-apis.google.com" path = "/a/feeds/{0}/nickname/2.0/{1}".format(domain, nickname) header = { "Content-type" : "application/atom+xml" , "Authorization": "GoogleLogin auth={0}".format(auth_token) } # HTTP Request (response, status) = http.httpsDELETERequest(server, path, header) nickname_entry = data.NicknameEntry(status, xml_string=response) return True
def deleteOwnerFromGroup(domain, auth_token, owner_name, group_id): server = "apps-apis.google.com" path = ( "/a/feeds/group/2.0/{0}/{1}/owner/{2}" .format(domain, group_id, owner_name) ) header = { "Content-type" : "application/atom+xml" , "Authorization" : "GoogleLogin auth={0}".format(auth_token) } # HTTP Request (response, status) = http.httpsDELETERequest(server, path, header) group_owner_entry = data.GroupOwnerEntry(status, xml_string=response) return True
def deleteAlias(domain, auth_token, alias_email): # Get additional domain (_, mail_domain) = alias_email.split("@") server = "apps-apis.google.com" path = "/a/feeds/alias/2.0/{0}/{1}".format(mail_domain, alias_email) header = { "Content-type" : "application/atom+xml" , "Authorization": "GoogleLogin auth={0}".format(auth_token) } # HTTP Request (response, status) = http.httpsDELETERequest(server, path, header) nickname_entry = data.AliasEntry_M(status, xml_string=response) return True
def deleteOu(auth_token, customer_id, ou_path): ou_path_rel = urllib.quote(ou_path[1:]) if ou_path_rel == "": raise errors.ArgumentsError("Cannot delete root ou\n") server = "apps-apis.google.com" path = "/a/feeds/orgunit/2.0/{0}/{1}".format(customer_id, ou_path_rel) header = { "Content-type" : "application/atom+xml" , "Authorization": "GoogleLogin auth={0}".format(auth_token) } # HTTP Request (response, status) = http.httpsDELETERequest(server, path, header) ou_entry = data.OuEntry(status, xml_string=response) return True