0

Сегодня Google announced - новая версия API миграции электронной почты. API, как представляется, следит за обычным форматом REST Google, но мне не удалось определить имя службы и информацию о версии для API, чтобы использовать ее с google-api-python-client.Документ обнаружения для API переноса электронной почты Google v2?

Есть ли документ для открытия нового API, и если да, то каково имя службы и версия?

ответ

1

Открытие документа несколько запаздывает от фактического выпуска, но это теперь доступно через discovery service или непосредственно here.

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" 
     } 
     } 
     } 
    } 
    } 
    } 
    } 
}