AIP-2713

One team owns each type

This guidance supplements AIP-213.

Sharing types is tempting, and it is possible. However, it is surrounded by some complicated issues.

We will consider making shared types for classes that are useful across multiple Apps APIs, we just will not do it lightly. If you feel you have a case for this, please contact us at apps-api-reviewers@google.com.

Guidance

Each API owns its own types.

If your API needs to reference another API’s objects, your API must contain a reference (resource name or ID) that can be used to get the information from that other API. For example, if your API wants to reference a relevant Gmail message, you must store a Gmail message name, and the message itself will be accessed via the Gmail API, passing in that name. Your API must not contain an actual Gmail message object.

For smaller types, it is also reasonable to make a copy of the class.