Calling a Type Provider in a Configuration

This page describes how to use a type provider that you have created with Deployment Manager. It does not describe how to create a type provider. To learn how to create a type provider, read Creating a Type Provider.

Before you begin

Accessing type providers

Types providers are a per-project resource and are accessible according to the permissions described on the Access Control documentation. That is:

  • Project editors and viewers can create and use types available to that project.
  • Type viewers can get a list of and use types available to that project.

You can also add another project as a type viewer so they can access your types. Read Sharing Types Across Projects.

Using a type provider

To use a type exposed by a type provider in your configuration, use the following syntax:

type: [PROJECT_ID]/[TYPE_NAME]:[COLLECTION]
  • If this API is backed by an OpenAPI specification, [COLLECTION] would be the REST identifier for the path to the resource. For example:

    type: my-project/emailAddressesTypeProvider:emailAddresses/v1beta/people
    
  • If the API is backed by a Google Discovery document, [COLLECTION] is the path of resources leading to your desired resource in the API. For example, to create a service account key, the collection would be:

    type: my-project/example-type-provider:projects.serviceAccounts.keys
    

Now you continue configuring your type as required by the underlying API:

resources:
- name: Jane
  type: my-project/emailAddressesTypeProvider:emailAddresses/v1beta/people
  properties:
  - displayName: Jane
    email: jane@example.com
    ...

What's next