# REST Resource: projects.locations.dependencies

- [Resource: Dependency](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#Dependency)
  - [JSON representation](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#Dependency.SCHEMA_REPRESENTATION)
- [DependencyEntityReference](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyEntityReference)
  - [JSON representation](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyEntityReference.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#State)
- [DiscoveryMode](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DiscoveryMode)
- [DependencyErrorDetail](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyErrorDetail)
  - [JSON representation](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyErrorDetail.SCHEMA_REPRESENTATION)
- [Error](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#Error)
- [Methods](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#METHODS_SUMMARY)

## Resource: Dependency

A dependency resource defined in the API hub describes a dependency directed from a consumer to a supplier entity. A dependency can be defined between two `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.operations#ApiOperation` or between an `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.operations#ApiOperation` and `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.externalApis#ExternalApi`.

| JSON representation |
|---|
| ``` { "name": string, "consumer": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyEntityReference`) }, "supplier": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyEntityReference`) }, "state": enum (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#State`), "description": string, "discoveryMode": enum (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DiscoveryMode`), "errorDetail": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyErrorDetail`) }, "createTime": string, "updateTime": string, "attributes": { string: { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/AttributeValues`) }, ... } } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The name of the dependency in the API Hub. Format: `projects/{project}/locations/{location}/dependencies/{dependency}` |
| `consumer` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyEntityReference`)`` Required. Immutable. The entity acting as the consumer in the dependency. |
| `supplier` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyEntityReference`)`` Required. Immutable. The entity acting as the supplier in the dependency. |
| `state` | ``enum (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#State`)`` Output only. State of the dependency. |
| `description` | `string` Optional. Human readable description corresponding of the dependency. |
| `discoveryMode` | ``enum (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DiscoveryMode`)`` Output only. Discovery mode of the dependency. |
| `errorDetail` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#DependencyErrorDetail`)`` Output only. Error details of a dependency if the system has detected it internally. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time at which the dependency was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time at which the dependency was last updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `attributes` | ``map (key: string, value: object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/AttributeValues`))`` Optional. The list of user defined attributes associated with the dependency resource. The key is the attribute name. It will be of the format: `projects/{project}/locations/{location}/attributes/{attribute}`. The value is the attribute values associated with the resource. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

## DependencyEntityReference

Reference to an entity participating in a dependency.

| JSON representation |
|---|
| ``` { "displayName": string, // Union field `identifier` can be only one of the following: "operationResourceName": string, "externalApiResourceName": string // End of list of possible types for union field `identifier`. } ``` |

| Fields ||
|---|---|
| `displayName` | `string` Output only. Display name of the entity. |
| Union field `identifier`. Required. Unique identifier for the participating entity. `identifier` can be only one of the following: ||
| `operationResourceName` | `string` The resource name of an operation in the API Hub. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` |
| `externalApiResourceName` | `string` The resource name of an external API in the API Hub. Format: `projects/{project}/locations/{location}/externalApis/{externalApi}` |

## State

Possible states for a dependency.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Default value. This value is unused. |
| `PROPOSED` | Dependency will be in a proposed state when it is newly identified by the API hub on its own. |
| `VALIDATED` | Dependency will be in a validated state when it is validated by the admin or manually created in the API hub. |

## DiscoveryMode

Possible modes of discovering the dependency.

| Enums ||
|---|---|
| `DISCOVERY_MODE_UNSPECIFIED` | Default value. This value is unused. |
| `MANUAL` | Manual mode of discovery when the dependency is defined by the user. |

## DependencyErrorDetail

Details describing error condition of a dependency.

| JSON representation |
|---|
| ``` { "error": enum (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#Error`), "errorTime": string } ``` |

| Fields ||
|---|---|
| `error` | ``enum (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies#Error`)`` Optional. Error in the dependency. |
| `errorTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Optional. Timestamp at which the error was found. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## Error

Possible values representing an error in the dependency.

| Enums ||
|---|---|
| `ERROR_UNSPECIFIED` | Default value used for no error in the dependency. |
| `SUPPLIER_NOT_FOUND` | Supplier entity has been deleted. |
| `SUPPLIER_RECREATED` | Supplier entity has been recreated. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/create` | Create a dependency between two entities in the API hub. |
| ### `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/delete` | Delete the dependency resource. |
| ### `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/get` | Get details about a dependency resource in the API hub. |
| ### `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/list` | List dependencies based on the provided filter and pagination parameters. |
| ### `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/patch` | Update a dependency based on the `https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.dependencies/patch#body.QUERY_PARAMETERS.update_mask` provided in the request. |