Google Email Migration API v2的发现文档?

时间:2013-07-17 00:30:39

标签: gmail google-apps google-admin-sdk google-email-migration

今天Google announced新版本的电子邮件迁移API。该API似乎遵循Google的常规REST格式,但我无法确定API的服务名称和版本信息,以便将其与google-api-python-client一起使用。

是否有新API的发现文档,如果有,那么服务名称和版本是什么?

2 个答案:

答案 0 :(得分:1)

发现文件与实际版本稍有延迟,但现在可通过discovery service或直接here获取。

答案 1 :(得分:0)

现在,我已经能够自己写non-standard discovery document了。它可能是错误的/不完整的,但它对我来说是测试消息和Python API Client

{
 "kind": "discovery#restDescription",
 "etag": "\"BgGz67p-6wsAbOn4St98QhtBGbA/blODPd9XLaVQKZp7pexaIpilnaw\"",
 "discoveryVersion": "v1",
 "id": "emailmigration:v2",
 "name": "emailmigration",
 "version": "v2",
 "revision": "20130717",
 "title": "Email Migration API",
 "description": "API to migrate messages to Google Apps Gmail Accounts",
 "ownerDomain": "google.com",
 "ownerName": "Google",
 "documentationLink": "https://developers.google.com/admin-sdk/email-migration/",
 "protocol": "rest",
 "baseUrl": "https://www.googleapis.com/email/v2/",
 "basePath": "/email/v2/users/",
 "rootUrl": "https://www.googleapis.com/",
 "servicePath": "email/v2/users/",
 "batchPath": "batch",
 "parameters": {
  "alt": {
   "type": "string",
   "description": "Data format for the response.",
   "default": "json",
   "enum": [
    "json"
   ],
   "enumDescriptions": [
    "Responses with Content-Type of application/json"
   ],
   "location": "query"
  },
  "fields": {
   "type": "string",
   "description": "Selector specifying which fields to include in a partial response.",
   "location": "query"
  },
  "key": {
   "type": "string",
   "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
   "location": "query"
  },
  "oauth_token": {
   "type": "string",
   "description": "OAuth 2.0 token for the current user.",
   "location": "query"
  },
  "prettyPrint": {
   "type": "boolean",
   "description": "Returns response with indentations and line breaks.",
   "default": "true",
   "location": "query"
  },
  "quotaUser": {
   "type": "string",
   "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
   "location": "query"
  },
  "userIp": {
   "type": "string",
   "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
   "location": "query"
  }
 },
 "auth": {
  "oauth2": {
   "scopes": {
    "https://www.googleapis.com/auth/email.migration": {
     "description": "Write access to Email Migration API v2."
    }
   }
  }
 },
 "schemas": {
   "Mail": {
    "id": "Mail",
    "type": "object",
    "description": "The metadata for a mail message.",
    "properties": {
     "isDraft": {
      "type": "boolean",
      "description": "The message is marked as a draft when migrated to the Gmail mailbox."
     },
     "isInbox": {
      "type": "boolean",
      "description": "The message should appear in the Inbox, regardless of its labels. By default, a migrated mail message will appear in the Inbox only if it has no labels."
     },
     "isSent": {
      "type": "boolean",
      "description": "The message is marked as \"Sent Mail\" when migrated to the Gmail mailbox."
     },
     "isStarred": {
      "type": "boolean",
      "description": "The message is starred when migrated."
     },
     "isTrash": {
      "type": "boolean",
      "description": "The message is marked as \"Trash\" when migrated."
     },
     "isUnread": {
      "type": "boolean",
      "description": "The message is marked as unread when migrated. Without this property, a migrated mail message is marked as read."
     },
     "isDeleted": {
      "type": "boolean",
      "description": "The message is migrated directly into Google Vault. Once archived in Google Vault, the message is only visible to a Vault administrator."
     },
     "labels": {
      "type": "array",
      "description": "The labels applied to the message when migrated.",
      "items": {
        "type": "string"
      }
     }
    }
   }
  },
  "resources": {
   "mail": {
    "methods": {
     "insert": {
      "id": "emailmigration.mail.insert",
      "path": "{userKey}/mail",
      "httpMethod": "POST",
      "description": "Insert a Mail resource into a user's Gmail account.",
      "parameters": {
       "userKey": {
        "type": "string",
        "description": "The email address or email alias of the user's mailbox to migrate the message to.",
        "required": true,
        "location": "path"
       }
      },
      "request": {
       "$ref": "Mail"
      },
      "scopes": [
       "https://www.googleapis.com/auth/email.migration"
      ],
      "supportsMediaUpload": true,
      "mediaUpload": {
       "accept": [
        "message/rfc822"
        ],
       "maxSize": "32MB",
       "protocols": {
        "simple": {
         "multipart": true,
         "path": "/upload/email/v2/users/{userKey}/mail"
        },
        "resumable": {
         "multipart": true,
         "path": "/upload/email/v2/users/{userKey}/mail"
        }
       }
      }
     }
    }
   }
  }
}