// Vendored from github.com/authzed/api@b550d757d703fd39ea28799b30daa4de78cd1987, annotations stripped by vendor.py. Apache-2.0. syntax = "proto3"; package authzed.api.v1; import "authzed/api/v1/core.proto"; import "authzed/api/v1/debug.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; option go_package = "github.com/authzed/authzed-go/proto/authzed/api/v1"; option java_multiple_files = true; option java_package = "com.authzed.api.v1"; // PermissionsService implements a set of RPCs that perform operations on // relationships and permissions. service PermissionsService { // ReadRelationships reads a set of the relationships matching one or more // filters. rpc ReadRelationships(ReadRelationshipsRequest) returns (stream ReadRelationshipsResponse) { } // WriteRelationships atomically writes and/or deletes a set of specified // relationships. An optional set of preconditions can be provided that must // be satisfied for the operation to commit. rpc WriteRelationships(WriteRelationshipsRequest) returns (WriteRelationshipsResponse) { } // DeleteRelationships atomically bulk deletes all relationships matching the // provided filter. If no relationships match, none will be deleted and the // operation will succeed. An optional set of preconditions can be provided that must // be satisfied for the operation to commit. rpc DeleteRelationships(DeleteRelationshipsRequest) returns (DeleteRelationshipsResponse) { } // CheckPermission determines for a given resource whether a subject computes // to having a permission or is a direct member of a particular relation. rpc CheckPermission(CheckPermissionRequest) returns (CheckPermissionResponse) { } // CheckBulkPermissions evaluates the given list of permission checks // and returns the list of results. rpc CheckBulkPermissions(CheckBulkPermissionsRequest) returns (CheckBulkPermissionsResponse) { } // ExpandPermissionTree reveals the graph structure for a resource's // permission or relation. This RPC does not recurse infinitely deep and may // require multiple calls to fully unnest a deeply nested graph. rpc ExpandPermissionTree(ExpandPermissionTreeRequest) returns (ExpandPermissionTreeResponse) { } // LookupResources returns all the resources of a given type that a subject // can access whether via a computed permission or relation membership. // // Results are streamed and **not guaranteed to be unique**: the same resource // may be returned more than once (for example via caveated/conditional // results, or when a limit is set), possibly with differing permissionship. // Callers that require uniqueness should deduplicate results. rpc LookupResources(LookupResourcesRequest) returns (stream LookupResourcesResponse) { } // LookupSubjects returns all the subjects of a given type that // have access whether via a computed permission or relation membership. // // Results are streamed and **not guaranteed to be unique**: the same subject // may be returned more than once, possibly with differing permissionship. // Callers that require uniqueness should deduplicate results. rpc LookupSubjects(LookupSubjectsRequest) returns (stream LookupSubjectsResponse) { } // ImportBulkRelationships is a faster path to writing a large number of // relationships at once. It is both batched and streaming. For maximum // performance, the caller should attempt to write relationships in as close // to relationship sort order as possible: (resource.object_type, // resource.object_id, relation, subject.object.object_type, // subject.object.object_id, subject.optional_relation). All relationships // written are done so under a single transaction. rpc ImportBulkRelationships(stream ImportBulkRelationshipsRequest) returns (ImportBulkRelationshipsResponse) { } // ExportBulkRelationships is the fastest path available to exporting // relationships from the server. It is resumable, and will return results // in an order determined by the server. rpc ExportBulkRelationships(ExportBulkRelationshipsRequest) returns (stream ExportBulkRelationshipsResponse) { } } // Consistency will define how a request is handled by the backend. // By defining a consistency requirement, and a token at which those // requirements should be applied, where applicable. message Consistency { oneof requirement { // minimize_latency indicates that the latency for the call should be // minimized by having the system select the fastest snapshot available. bool minimize_latency = 1 ; // at_least_as_fresh indicates that all data used in the API call must be // *at least as fresh* as that found in the ZedToken; more recent data might // be used if available or faster. ZedToken at_least_as_fresh = 2; // at_exact_snapshot indicates that all data used in the API call must be // *at the given* snapshot in time; if the snapshot is no longer available, // an error will be returned to the caller. ZedToken at_exact_snapshot = 3; // fully_consistent indicates that all data used in the API call *must* be // at the most recent snapshot found. // // NOTE: using this method can be *quite slow*, so unless there is a need to // do so, it is recommended to use `at_least_as_fresh` with a stored // ZedToken. bool fully_consistent = 4 ; } } // RelationshipFilter is a collection of filters which when applied to a // relationship will return relationships that have exactly matching fields. // // All fields are optional and if left unspecified will not filter relationships, // but at least one field must be specified. // // NOTE: The performance of the API will be affected by the selection of fields // on which to filter. If a field is not indexed, the performance of the API // can be significantly slower. message RelationshipFilter { // resource_type is the *optional* resource type of the relationship. // NOTE: It is not prefixed with "optional_" for legacy compatibility. string resource_type = 1 ; // optional_resource_id is the *optional* resource ID of the relationship. // If specified, optional_resource_id_prefix cannot be specified. string optional_resource_id = 2 ; // optional_resource_id_prefix is the *optional* prefix for the resource ID of the relationship. // If specified, optional_resource_id cannot be specified. string optional_resource_id_prefix = 5 ; // relation is the *optional* relation of the relationship. string optional_relation = 3 ; // optional_subject_filter is the optional filter for the subjects of the relationships. SubjectFilter optional_subject_filter = 4; } // SubjectFilter specifies a filter on the subject of a relationship. // // subject_type is required and all other fields are optional, and will not // impose any additional requirements if left unspecified. message SubjectFilter { message RelationFilter { string relation = 1 ; } string subject_type = 1 ; string optional_subject_id = 2 ; RelationFilter optional_relation = 3; } // ReadRelationshipsRequest specifies one or more filters used to read matching // relationships within the system. message ReadRelationshipsRequest { Consistency consistency = 1; // relationship_filter defines the filter to be applied to the relationships // to be returned. RelationshipFilter relationship_filter = 2 ; // optional_limit, if non-zero, specifies the limit on the number of relationships to return // before the stream is closed on the server side. By default, the stream will continue // resolving relationships until exhausted or the stream is closed due to the client or a // network issue. uint32 optional_limit = 3 ; // optional_cursor, if specified, indicates the cursor after which results should resume being returned. // The cursor can be found on the ReadRelationshipsResponse object. Cursor optional_cursor = 4; } // ReadRelationshipsResponse contains a Relationship found that matches the // specified relationship filter(s). A instance of this response message will // be streamed to the client for each relationship found. message ReadRelationshipsResponse { // read_at is the ZedToken at which the relationship was found. ZedToken read_at = 1 ; // relationship is the found relationship. Relationship relationship = 2 ; // after_result_cursor holds a cursor that can be used to resume the ReadRelationships stream after this // result. Cursor after_result_cursor = 3; } // Precondition specifies how and the existence or absence of certain // relationships as expressed through the accompanying filter should affect // whether or not the operation proceeds. // // MUST_NOT_MATCH will fail the parent request if any relationships match the // relationships filter. // MUST_MATCH will fail the parent request if there are no // relationships that match the filter. message Precondition { enum Operation { OPERATION_UNSPECIFIED = 0; OPERATION_MUST_NOT_MATCH = 1; OPERATION_MUST_MATCH = 2; } Operation operation = 1 ; RelationshipFilter filter = 2 ; } // WriteRelationshipsRequest contains a list of Relationship mutations that // should be applied to the service. If the optional_preconditions parameter // is included, all of the specified preconditions must also be satisfied before // the write will be committed. All updates will be applied transactionally, // and if any preconditions fail, the entire transaction will be reverted. message WriteRelationshipsRequest { repeated RelationshipUpdate updates = 1 ; repeated Precondition optional_preconditions = 2 ; // To be bounded by configuration // optional_transaction_metadata is an optional field that can be used to store metadata about the transaction. // If specified, this metadata will be supplied in the WatchResponse for the updates associated with this // transaction. google.protobuf.Struct optional_transaction_metadata = 3 ; } message WriteRelationshipsResponse { // written_at is the revision at which the relationships were written or deleted. ZedToken written_at = 1; } // DeleteRelationshipsRequest specifies which Relationships should be deleted, // requesting the delete of *ALL* relationships that match the specified // filters. If the optional_preconditions parameter is included, all of the // specified preconditions must also be satisfied before the delete will be // executed. message DeleteRelationshipsRequest { RelationshipFilter relationship_filter = 1 ; repeated Precondition optional_preconditions = 2 ; // To be bounded by configuration // optional_limit, if non-zero, specifies the limit on the number of relationships to be deleted. // If there are more matching relationships found to be deleted than the limit specified here, // the deletion call will fail with an error to prevent partial deletion. If partial deletion // is needed, specify below that partial deletion is allowed. Partial deletions can be used // in a loop to delete large amounts of relationships in a *non-transactional* manner. uint32 optional_limit = 3 ; // optional_allow_partial_deletions, if true and a limit is specified, will delete matching found // relationships up to the count specified in optional_limit, and no more. bool optional_allow_partial_deletions = 4; // optional_transaction_metadata is an optional field that can be used to store metadata about the transaction. // If specified, this metadata will be supplied in the WatchResponse for the deletions associated with // this transaction. google.protobuf.Struct optional_transaction_metadata = 5 ; // optional_cursor, if specified, indicates the cursor after which deletion should resume. It is used to // continue a batched, partial deletion where a previous call left off, by passing back the // after_result_cursor returned on the previous DeleteRelationshipsResponse. // // A cursor allows a large deletion to be performed as a series of calls without re-examining the // relationships already deleted by earlier calls. It therefore requires optional_limit and // optional_allow_partial_deletions to be set, and is only supported by datastores whose deletion can be // ordered and resumed; datastores that do not support cursored deletion will return an error if a cursor // is provided. Cursor optional_cursor = 6; } message DeleteRelationshipsResponse { enum DeletionProgress { DELETION_PROGRESS_UNSPECIFIED = 0; // DELETION_PROGRESS_COMPLETE indicates that all remaining relationships matching the filter // were deleted. Will be returned even if no relationships were deleted. DELETION_PROGRESS_COMPLETE = 1; // DELETION_PROGRESS_PARTIAL indicates that a subset of the relationships matching the filter // were deleted. Only returned if optional_allow_partial_deletions was true, an optional_limit was // specified, and there existed more relationships matching the filter than optional_limit would allow. // Once all remaining relationships have been deleted, DELETION_PROGRESS_COMPLETE will be returned. DELETION_PROGRESS_PARTIAL = 2; } // deleted_at is the revision at which the relationships were deleted. ZedToken deleted_at = 1; // deletion_progress is an enumeration of the possible outcomes that occurred when attempting to delete the specified relationships. DeletionProgress deletion_progress = 2; // relationships_deleted_count is the number of relationships that were deleted. uint64 relationships_deleted_count = 3; // after_result_cursor holds a cursor that can be used to resume the deletion after the relationships // deleted by this call, by supplying it as the optional_cursor on a subsequent DeleteRelationshipsRequest. // // It is populated only when deletion_progress is DELETION_PROGRESS_PARTIAL and the datastore supports // cursored deletion; it is unset once DELETION_PROGRESS_COMPLETE is returned. Cursor after_result_cursor = 4; } // CheckPermissionRequest issues a check on whether a subject has a permission // or is a member of a relation, on a specific resource. message CheckPermissionRequest { Consistency consistency = 1; // resource is the resource on which to check the permission or relation. ObjectReference resource = 2 ; // permission is the name of the permission (or relation) on which to execute // the check. string permission = 3 ; // subject is the subject that will be checked for the permission or relation. SubjectReference subject = 4 ; // context consists of named values that are injected into the caveat evaluation context google.protobuf.Struct context = 5 ; // with_tracing, if true, indicates that the response should include a debug trace. // This can be useful for debugging and performance analysis, but adds a small amount // of compute overhead to the request. bool with_tracing = 6; } message CheckPermissionResponse { enum Permissionship { // PERMISSIONSHIP_UNSPECIFIED is the default value and should not be used or // relied upon. Servers should not return this value. PERMISSIONSHIP_UNSPECIFIED = 0; // PERMISSIONSHIP_NO_PERMISSION indicates that the subject does not have the // requested permission on the resource. PERMISSIONSHIP_NO_PERMISSION = 1; // PERMISSIONSHIP_HAS_PERMISSION indicates that the subject has the requested // permission on the resource. PERMISSIONSHIP_HAS_PERMISSION = 2; // PERMISSIONSHIP_CONDITIONAL_PERMISSION indicates that the subject has the // requested permission on the resource, but only if a caveat condition is met. // The `partial_caveat_info` field in the response should contain the missing // context fields that must be provided to fully evaluate the caveat. PERMISSIONSHIP_CONDITIONAL_PERMISSION = 3; } ZedToken checked_at = 1 ; // Permissionship communicates whether or not the subject has the requested // permission or has a relationship with the given resource, over the given // relation. // // This value will be authzed.api.v1.PERMISSIONSHIP_HAS_PERMISSION if the // requested subject is a member of the computed permission set or there // exists a relationship with the requested relation from the given resource // to the given subject. Permissionship permissionship = 2 ; // partial_caveat_info holds information of a partially-evaluated caveated response PartialCaveatInfo partial_caveat_info = 3 ; // debug_trace is the debugging trace of this check, if requested. DebugInformation debug_trace = 4; // optional_expires_at is the time at which at least one of the relationships used to // compute this result, expires (if any). This is *not* related to the caching window. google.protobuf.Timestamp optional_expires_at = 5; } // CheckBulkPermissionsRequest issues a check on whether a subject has permission // or is a member of a relation on a specific resource for each item in the list. // // The ordering of the items in the response is maintained in the response. // Checks with the same subject/permission will automatically be batched for performance optimization. message CheckBulkPermissionsRequest { Consistency consistency = 1; repeated CheckBulkPermissionsRequestItem items = 2 ; // with_tracing, if true, indicates that each response should include a debug trace. // This can be useful for debugging and performance analysis, but adds a small amount // of compute overhead to the request. bool with_tracing = 3; } message CheckBulkPermissionsRequestItem { ObjectReference resource = 1 ; string permission = 2 ; SubjectReference subject = 3 ; google.protobuf.Struct context = 4 ; } message CheckBulkPermissionsResponse { ZedToken checked_at = 1 ; repeated CheckBulkPermissionsPair pairs = 2 ; } message CheckBulkPermissionsPair { CheckBulkPermissionsRequestItem request = 1; oneof response { CheckBulkPermissionsResponseItem item = 2; google.rpc.Status error = 3; } } message CheckBulkPermissionsResponseItem { CheckPermissionResponse.Permissionship permissionship = 1 ; PartialCaveatInfo partial_caveat_info = 2 ; // debug_trace is the debugging trace of this check, if requested. DebugInformation debug_trace = 3; } // ExpandPermissionTreeRequest returns a tree representing the expansion of all // relationships found accessible from a permission or relation on a particular // resource. // // ExpandPermissionTreeRequest is typically used to determine the full set of // subjects with a permission, along with the relationships that grant said // access. message ExpandPermissionTreeRequest { Consistency consistency = 1; // resource is the resource over which to run the expansion. ObjectReference resource = 2 ; // permission is the name of the permission or relation over which to run the // expansion for the resource. string permission = 3 ; } message ExpandPermissionTreeResponse { ZedToken expanded_at = 1; // tree_root is a tree structure whose leaf nodes are subjects, and // intermediate nodes represent the various operations (union, intersection, // exclusion) to reach those subjects. PermissionRelationshipTree tree_root = 2; } // LookupResourcesRequest performs a lookup of all resources of a particular // kind on which the subject has the specified permission or the relation in // which the subject exists, streaming back the IDs of those resources. message LookupResourcesRequest { Consistency consistency = 1; // resource_object_type is the type of resource object for which the IDs will // be returned. string resource_object_type = 2 ; // permission is the name of the permission or relation for which the subject // must Check. string permission = 3 ; // subject is the subject with access to the resources. SubjectReference subject = 4 ; // context consists of named values that are injected into the caveat evaluation context google.protobuf.Struct context = 5 ; // optional_limit, if non-zero, specifies the limit on the number of resources to return // before the stream is closed on the server side. By default, the stream will continue // resolving resources until exhausted or the stream is closed due to the client or a // network issue. uint32 optional_limit = 6 ; // optional_cursor, if specified, indicates the cursor after which results should resume being returned. // The cursor can be found on the LookupResourcesResponse object. Cursor optional_cursor = 7; // // with_debug, if true, indicates that the response should return debug information // if present and available. For now, ONLY enables debugging of maximum recursion depth // errors, with additional context being returned in error details, but this may be // extended in the future. bool with_debug = 8; // optional_response_batch_size, if non-zero, requests that the server return // multiple resources per response message (up to this many) in // LookupResourcesResponse.batched, instead of a single resource per message. // Zero (the default) preserves one-resource-per-message streaming for // backward compatibility. // // The batch size trades time-to-first-result against overall throughput: a // larger batch size increases throughput (fewer, larger messages, less // per-message overhead) but delays the first results, since the server // accumulates more of them before sending a message; a smaller batch size // returns initial results sooner. A value around 1000 is a good default. // // The maximum batch size is bounded by a server-side configuration flag; // requesting more than the server allows is rejected. uint32 optional_response_batch_size = 9; } // LookupPermissionship represents whether a Lookup response was partially evaluated or not enum LookupPermissionship { // LOOKUP_PERMISSIONSHIP_UNSPECIFIED is the default value and should not be used or // relied upon. Servers should not return this value. LOOKUP_PERMISSIONSHIP_UNSPECIFIED = 0; // LOOKUP_PERMISSIONSHIP_HAS_PERMISSION indicates that the subject has permission // on the resource with no missing caveat context. LOOKUP_PERMISSIONSHIP_HAS_PERMISSION = 1; // LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION indicates that the subject has // permission on the resource, but only if a caveat condition is met. The // `partial_caveat_info` field in the response should contain the missing context // fields that must be provided to fully evaluate the caveat. LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION = 2; } // LookupResourcesResponse contains a single matching resource object ID for the // requested object type, permission, and subject. message LookupResourcesResponse { // looked_up_at is the ZedToken at which the resource was found. ZedToken looked_up_at = 1; // resource_object_id is the object ID of the found resource. string resource_object_id = 2; // permissionship indicates whether the response was partially evaluated or not LookupPermissionship permissionship = 3 ; // partial_caveat_info holds information of a partially-evaluated caveated response PartialCaveatInfo partial_caveat_info = 4 ; // after_result_cursor holds a cursor that can be used to resume the LookupResources stream after this // result. Used only for the singular, one-resource-per-message form. Cursor after_result_cursor = 5; // batched, when set, holds multiple found resources in a single response // message along with a single resume cursor for the batch. It is populated // instead of the singular fields above when the request set // optional_response_batch_size > 0. A response message uses either the // singular fields or batched, never both. LookupResourcesBatch batched = 6; } // LookupResourcesBatch holds multiple found resources returned in a single // LookupResourcesResponse, together with one cursor that resumes the stream // after the last result in the batch. Grouping the results with a single cursor // (rather than a cursor per result) keeps the response compact: a stream is // consumed message-by-message, so only one resume point per message is ever // needed. message LookupResourcesBatch { // results holds the found resources, in stream order. repeated LookupResourcesResult results = 1; // after_cursor holds a cursor that can be used to resume the LookupResources // stream after the last result in this batch. Cursor after_cursor = 2; } // LookupResourcesResult is a single found resource within a batched // LookupResourcesResponse (see LookupResourcesBatch.results). message LookupResourcesResult { // resource_object_id is the object ID of the found resource. string resource_object_id = 1; // permissionship indicates whether the result was partially evaluated or not. LookupPermissionship permissionship = 2 ; // partial_caveat_info holds information of a partially-evaluated caveated result. PartialCaveatInfo partial_caveat_info = 3 ; } // LookupSubjectsRequest performs a lookup of all subjects of a particular // kind for which the subject has the specified permission or the relation in // which the subject exists, streaming back the IDs of those subjects. message LookupSubjectsRequest { enum WildcardOption { WILDCARD_OPTION_UNSPECIFIED = 0; WILDCARD_OPTION_INCLUDE_WILDCARDS = 1; WILDCARD_OPTION_EXCLUDE_WILDCARDS = 2; } Consistency consistency = 1; // resource is the resource for which all matching subjects for the permission // or relation will be returned. ObjectReference resource = 2 ; // permission is the name of the permission (or relation) for which to find // the subjects. string permission = 3 ; // subject_object_type is the type of subject object for which the IDs will // be returned. string subject_object_type = 4 ; // optional_subject_relation is the optional relation for the subject. string optional_subject_relation = 5 ; // context consists of named values that are injected into the caveat evaluation context google.protobuf.Struct context = 6 ; // optional_concrete_limit is currently unimplemented for LookupSubjects // and will return an error as of SpiceDB version 1.40.1. This will // be implemented in a future version of SpiceDB. uint32 optional_concrete_limit = 7 ; // optional_cursor is not currently supported for LookupSubjects and this // field will be ignored. Cursoring support will be added in a future version. Cursor optional_cursor = 8; // wildcard_option specifies whether wildcards should be returned by LookupSubjects. // For backwards compatibility, defaults to WILDCARD_OPTION_INCLUDE_WILDCARDS if unspecified. WildcardOption wildcard_option = 9; } // LookupSubjectsResponse contains a single matching subject object ID for the // requested subject object type on the permission or relation. message LookupSubjectsResponse { ZedToken looked_up_at = 1; // subject_object_id is the Object ID of the subject found. May be a `*` if // a wildcard was found. // deprecated: use `subject` string subject_object_id = 2 [deprecated = true]; // excluded_subject_ids are the Object IDs of the subjects excluded. This list // will only contain object IDs if `subject_object_id` is a wildcard (`*`) and // will only be populated if exclusions exist from the wildcard. // deprecated: use `excluded_subjects` repeated string excluded_subject_ids = 3 [deprecated = true]; // permissionship indicates whether the response was partially evaluated or not // deprecated: use `subject.permissionship` LookupPermissionship permissionship = 4 ; // partial_caveat_info holds information of a partially-evaluated caveated response // deprecated: use `subject.partial_caveat_info` PartialCaveatInfo partial_caveat_info = 5 ; // subject is the subject found, along with its permissionship. ResolvedSubject subject = 6; // excluded_subjects are the subjects excluded. This list // will only contain subjects if `subject.subject_object_id` is a wildcard (`*`) and // will only be populated if exclusions exist from the wildcard. repeated ResolvedSubject excluded_subjects = 7; // after_result_cursor holds a cursor that can be used to resume the LookupSubjects stream after this // result. Cursor after_result_cursor = 8; } // ResolvedSubject is a single subject resolved within LookupSubjects. message ResolvedSubject { // subject_object_id is the Object ID of the subject found. May be a `*` if // a wildcard was found. string subject_object_id = 1; // permissionship indicates whether the response was partially evaluated or not LookupPermissionship permissionship = 2 ; // partial_caveat_info holds information of a partially-evaluated caveated response PartialCaveatInfo partial_caveat_info = 3 ; } // ImportBulkRelationshipsRequest represents one batch of the streaming // ImportBulkRelationships API. The maximum size is only limited by the backing // datastore, and optimal size should be determined by the calling client // experimentally. When ImportBulk is invoked and receives its first request message, // a transaction is opened to import the relationships. All requests sent to the same // invocation are executed under this single transaction. If a relationship already // exists within the datastore, the entire transaction will fail with an error. message ImportBulkRelationshipsRequest { repeated Relationship relationships = 1 ; } // ImportBulkRelationshipsResponse is returned on successful completion of the // bulk load stream, and contains the total number of relationships loaded. message ImportBulkRelationshipsResponse { uint64 num_loaded = 1; } // ExportBulkRelationshipsRequest represents a resumable request for // all relationships from the server. message ExportBulkRelationshipsRequest { Consistency consistency = 1; // optional_limit, if non-zero, specifies the limit on the number of // relationships the server can return in one page. By default, the server // will pick a page size, and the server is free to choose a smaller size // at will. uint32 optional_limit = 2 ; // optional_cursor, if specified, indicates the cursor after which results // should resume being returned. The cursor can be found on the // BulkExportRelationshipsResponse object. Cursor optional_cursor = 3; // optional_relationship_filter, if specified, indicates the // filter to apply to each relationship to be exported. RelationshipFilter optional_relationship_filter = 4; } // ExportBulkRelationshipsResponse is one page in a stream of relationship // groups that meet the criteria specified by the originating request. The // server will continue to stream back relationship groups as quickly as it can // until all relationships have been transmitted back. message ExportBulkRelationshipsResponse { Cursor after_result_cursor = 1; repeated Relationship relationships = 2; }