xref: /aosp_15_r20/external/googleapis/google/cloud/bigquery/analyticshub/v1/analyticshub.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.bigquery.analyticshub.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/iam/v1/iam_policy.proto";
24import "google/iam/v1/policy.proto";
25import "google/longrunning/operations.proto";
26import "google/protobuf/empty.proto";
27import "google/protobuf/field_mask.proto";
28import "google/protobuf/timestamp.proto";
29import "google/protobuf/wrappers.proto";
30
31option csharp_namespace = "Google.Cloud.BigQuery.AnalyticsHub.V1";
32option go_package = "cloud.google.com/go/bigquery/analyticshub/apiv1/analyticshubpb;analyticshubpb";
33option java_multiple_files = true;
34option java_outer_classname = "AnalyticsHubProto";
35option java_package = "com.google.cloud.bigquery.analyticshub.v1";
36option php_namespace = "Google\\Cloud\\BigQuery\\AnalyticsHub\\V1";
37option ruby_package = "Google::Cloud::Bigquery::AnalyticsHub::V1";
38option (google.api.resource_definition) = {
39  type: "bigquery.googleapis.com/Dataset"
40  pattern: "projects/{project}/datasets/{dataset}"
41};
42option (google.api.resource_definition) = {
43  type: "bigquery.googleapis.com/Table"
44  pattern: "projects/{project}/datasets/{dataset}/tables/{table}"
45};
46
47// The `AnalyticsHubService` API facilitates data sharing within and across
48// organizations. It allows data providers to publish listings that reference
49// shared datasets. With Analytics Hub, users can discover and search for
50// listings that they have access to. Subscribers can view and subscribe to
51// listings. When you subscribe to a listing, Analytics Hub creates a linked
52// dataset in your project.
53service AnalyticsHubService {
54  option (google.api.default_host) = "analyticshub.googleapis.com";
55  option (google.api.oauth_scopes) =
56      "https://www.googleapis.com/auth/bigquery,"
57      "https://www.googleapis.com/auth/cloud-platform";
58
59  // Lists all data exchanges in a given project and location.
60  rpc ListDataExchanges(ListDataExchangesRequest)
61      returns (ListDataExchangesResponse) {
62    option (google.api.http) = {
63      get: "/v1/{parent=projects/*/locations/*}/dataExchanges"
64    };
65    option (google.api.method_signature) = "parent";
66  }
67
68  // Lists all data exchanges from projects in a given organization and
69  // location.
70  rpc ListOrgDataExchanges(ListOrgDataExchangesRequest)
71      returns (ListOrgDataExchangesResponse) {
72    option (google.api.http) = {
73      get: "/v1/{organization=organizations/*/locations/*}/dataExchanges"
74    };
75    option (google.api.method_signature) = "organization";
76  }
77
78  // Gets the details of a data exchange.
79  rpc GetDataExchange(GetDataExchangeRequest) returns (DataExchange) {
80    option (google.api.http) = {
81      get: "/v1/{name=projects/*/locations/*/dataExchanges/*}"
82    };
83    option (google.api.method_signature) = "name";
84  }
85
86  // Creates a new data exchange.
87  rpc CreateDataExchange(CreateDataExchangeRequest) returns (DataExchange) {
88    option (google.api.http) = {
89      post: "/v1/{parent=projects/*/locations/*}/dataExchanges"
90      body: "data_exchange"
91    };
92    option (google.api.method_signature) = "parent,data_exchange";
93  }
94
95  // Updates an existing data exchange.
96  rpc UpdateDataExchange(UpdateDataExchangeRequest) returns (DataExchange) {
97    option (google.api.http) = {
98      patch: "/v1/{data_exchange.name=projects/*/locations/*/dataExchanges/*}"
99      body: "data_exchange"
100    };
101    option (google.api.method_signature) = "data_exchange,update_mask";
102  }
103
104  // Deletes an existing data exchange.
105  rpc DeleteDataExchange(DeleteDataExchangeRequest)
106      returns (google.protobuf.Empty) {
107    option (google.api.http) = {
108      delete: "/v1/{name=projects/*/locations/*/dataExchanges/*}"
109    };
110    option (google.api.method_signature) = "name";
111  }
112
113  // Lists all listings in a given project and location.
114  rpc ListListings(ListListingsRequest) returns (ListListingsResponse) {
115    option (google.api.http) = {
116      get: "/v1/{parent=projects/*/locations/*/dataExchanges/*}/listings"
117    };
118    option (google.api.method_signature) = "parent";
119  }
120
121  // Gets the details of a listing.
122  rpc GetListing(GetListingRequest) returns (Listing) {
123    option (google.api.http) = {
124      get: "/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}"
125    };
126    option (google.api.method_signature) = "name";
127  }
128
129  // Creates a new listing.
130  rpc CreateListing(CreateListingRequest) returns (Listing) {
131    option (google.api.http) = {
132      post: "/v1/{parent=projects/*/locations/*/dataExchanges/*}/listings"
133      body: "listing"
134    };
135    option (google.api.method_signature) = "parent,listing";
136  }
137
138  // Updates an existing listing.
139  rpc UpdateListing(UpdateListingRequest) returns (Listing) {
140    option (google.api.http) = {
141      patch: "/v1/{listing.name=projects/*/locations/*/dataExchanges/*/listings/*}"
142      body: "listing"
143    };
144    option (google.api.method_signature) = "listing,update_mask";
145  }
146
147  // Deletes a listing.
148  rpc DeleteListing(DeleteListingRequest) returns (google.protobuf.Empty) {
149    option (google.api.http) = {
150      delete: "/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}"
151    };
152    option (google.api.method_signature) = "name";
153  }
154
155  // Subscribes to a listing.
156  //
157  // Currently, with Analytics Hub, you can create listings that
158  // reference only BigQuery datasets.
159  // Upon subscription to a listing for a BigQuery dataset, Analytics Hub
160  // creates a linked dataset in the subscriber's project.
161  rpc SubscribeListing(SubscribeListingRequest)
162      returns (SubscribeListingResponse) {
163    option (google.api.http) = {
164      post: "/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe"
165      body: "*"
166    };
167    option (google.api.method_signature) = "name";
168  }
169
170  // Creates a Subscription to a Data Exchange. This is a long-running operation
171  // as it will create one or more linked datasets.
172  rpc SubscribeDataExchange(SubscribeDataExchangeRequest)
173      returns (google.longrunning.Operation) {
174    option (google.api.http) = {
175      post: "/v1/{name=projects/*/locations/*/dataExchanges/*}:subscribe"
176      body: "*"
177    };
178    option (google.api.method_signature) = "name";
179    option (google.longrunning.operation_info) = {
180      response_type: "SubscribeDataExchangeResponse"
181      metadata_type: "OperationMetadata"
182    };
183  }
184
185  // Refreshes a Subscription to a Data Exchange. A Data Exchange can become
186  // stale when a publisher adds or removes data. This is a long-running
187  // operation as it may create many linked datasets.
188  rpc RefreshSubscription(RefreshSubscriptionRequest)
189      returns (google.longrunning.Operation) {
190    option (google.api.http) = {
191      post: "/v1/{name=projects/*/locations/*/subscriptions/*}:refresh"
192      body: "*"
193    };
194    option (google.api.method_signature) = "name";
195    option (google.longrunning.operation_info) = {
196      response_type: "RefreshSubscriptionResponse"
197      metadata_type: "OperationMetadata"
198    };
199  }
200
201  // Gets the details of a Subscription.
202  rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) {
203    option (google.api.http) = {
204      get: "/v1/{name=projects/*/locations/*/subscriptions/*}"
205    };
206    option (google.api.method_signature) = "name";
207  }
208
209  // Lists all subscriptions in a given project and location.
210  rpc ListSubscriptions(ListSubscriptionsRequest)
211      returns (ListSubscriptionsResponse) {
212    option (google.api.http) = {
213      get: "/v1/{parent=projects/*/locations/*}/subscriptions"
214    };
215    option (google.api.method_signature) = "parent";
216  }
217
218  // Lists all subscriptions on a given Data Exchange or Listing.
219  rpc ListSharedResourceSubscriptions(ListSharedResourceSubscriptionsRequest)
220      returns (ListSharedResourceSubscriptionsResponse) {
221    option (google.api.http) = {
222      get: "/v1/{resource=projects/*/locations/*/dataExchanges/*}:listSubscriptions"
223      additional_bindings {
224        get: "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:listSubscriptions"
225      }
226    };
227    option (google.api.method_signature) = "resource";
228  }
229
230  // Revokes a given subscription.
231  rpc RevokeSubscription(RevokeSubscriptionRequest)
232      returns (RevokeSubscriptionResponse) {
233    option (google.api.http) = {
234      post: "/v1/{name=projects/*/locations/*/subscriptions/*}:revoke"
235      body: "*"
236    };
237    option (google.api.method_signature) = "name";
238  }
239
240  // Deletes a subscription.
241  rpc DeleteSubscription(DeleteSubscriptionRequest)
242      returns (google.longrunning.Operation) {
243    option (google.api.http) = {
244      delete: "/v1/{name=projects/*/locations/*/subscriptions/*}"
245    };
246    option (google.api.method_signature) = "name";
247    option (google.longrunning.operation_info) = {
248      response_type: "google.protobuf.Empty"
249      metadata_type: "OperationMetadata"
250    };
251  }
252
253  // Gets the IAM policy.
254  rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
255      returns (google.iam.v1.Policy) {
256    option (google.api.http) = {
257      post: "/v1/{resource=projects/*/locations/*/dataExchanges/*}:getIamPolicy"
258      body: "*"
259      additional_bindings {
260        post: "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:getIamPolicy"
261        body: "*"
262      }
263      additional_bindings {
264        post: "/v1/{resource=projects/*/locations/*/subscriptions/*}:getIamPolicy"
265        body: "*"
266      }
267    };
268  }
269
270  // Sets the IAM policy.
271  rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
272      returns (google.iam.v1.Policy) {
273    option (google.api.http) = {
274      post: "/v1/{resource=projects/*/locations/*/dataExchanges/*}:setIamPolicy"
275      body: "*"
276      additional_bindings {
277        post: "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:setIamPolicy"
278        body: "*"
279      }
280      additional_bindings {
281        post: "/v1/{resource=projects/*/locations/*/subscriptions/*}:setIamPolicy"
282        body: "*"
283      }
284    };
285  }
286
287  // Returns the permissions that a caller has.
288  rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
289      returns (google.iam.v1.TestIamPermissionsResponse) {
290    option (google.api.http) = {
291      post: "/v1/{resource=projects/*/locations/*/dataExchanges/*}:testIamPermissions"
292      body: "*"
293      additional_bindings {
294        post: "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:testIamPermissions"
295        body: "*"
296      }
297    };
298  }
299}
300
301// A data exchange is a container that lets you share data. Along with the
302// descriptive information about the data exchange, it contains listings that
303// reference shared datasets.
304message DataExchange {
305  option (google.api.resource) = {
306    type: "analyticshub.googleapis.com/DataExchange"
307    pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}"
308  };
309
310  // Output only. The resource name of the data exchange.
311  // e.g. `projects/myproject/locations/US/dataExchanges/123`.
312  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
313
314  // Required. Human-readable display name of the data exchange. The display
315  // name must contain only Unicode letters, numbers (0-9), underscores (_),
316  // dashes (-), spaces ( ), ampersands (&) and must not start or end with
317  // spaces. Default value is an empty string. Max length: 63 bytes.
318  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
319
320  // Optional. Description of the data exchange. The description must not
321  // contain Unicode non-characters as well as C0 and C1 control codes except
322  // tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF).
323  // Default value is an empty string.
324  // Max length: 2000 bytes.
325  string description = 3 [(google.api.field_behavior) = OPTIONAL];
326
327  // Optional. Email or URL of the primary point of contact of the data
328  // exchange. Max Length: 1000 bytes.
329  string primary_contact = 4 [(google.api.field_behavior) = OPTIONAL];
330
331  // Optional. Documentation describing the data exchange.
332  string documentation = 5 [(google.api.field_behavior) = OPTIONAL];
333
334  // Output only. Number of listings contained in the data exchange.
335  int32 listing_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
336
337  // Optional. Base64 encoded image representing the data exchange. Max
338  // Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API
339  // only performs validation on size of the encoded data. Note: For byte
340  // fields, the content of the fields are base64-encoded (which increases the
341  // size of the data by 33-36%) when using JSON on the wire.
342  bytes icon = 7 [(google.api.field_behavior) = OPTIONAL];
343
344  // Optional. Configurable data sharing environment option for a data exchange.
345  SharingEnvironmentConfig sharing_environment_config = 8
346      [(google.api.field_behavior) = OPTIONAL];
347}
348
349// Sharing environment is a behavior model for sharing data within a
350// data exchange. This option is configurable for a data exchange.
351message SharingEnvironmentConfig {
352  // Default Analytics Hub data exchange, used for secured data sharing.
353  message DefaultExchangeConfig {}
354
355  // Data Clean Room (DCR), used for privacy-safe and secured data sharing.
356  message DcrExchangeConfig {
357    // Output only. If True, this DCR restricts the contributors to sharing
358    // only a single resource in a Listing. And no two resources should have the
359    // same IDs. So if a contributor adds a view with a conflicting name, the
360    // CreateListing API will reject the request. if False, the data contributor
361    // can publish an entire dataset (as before). This is not configurable, and
362    // by default, all new DCRs will have the restriction set to True.
363    optional bool single_selected_resource_sharing_restriction = 1
364        [(google.api.field_behavior) = OUTPUT_ONLY];
365
366    // Output only. If True, when subscribing to this DCR, it will create only
367    // one linked dataset containing all resources shared within the
368    // cleanroom. If False, when subscribing to this DCR, it will
369    // create 1 linked dataset per listing. This is not configurable, and by
370    // default, all new DCRs will have the restriction set to True.
371    optional bool single_linked_dataset_per_cleanroom = 2
372        [(google.api.field_behavior) = OUTPUT_ONLY];
373  }
374
375  oneof environment {
376    // Default Analytics Hub data exchange, used for secured data sharing.
377    DefaultExchangeConfig default_exchange_config = 1;
378
379    // Data Clean Room (DCR), used for privacy-safe and secured data sharing.
380    DcrExchangeConfig dcr_exchange_config = 2;
381  }
382}
383
384// Contains details of the data provider.
385message DataProvider {
386  // Optional. Name of the data provider.
387  string name = 1 [(google.api.field_behavior) = OPTIONAL];
388
389  // Optional. Email or URL of the data provider.
390  // Max Length: 1000 bytes.
391  string primary_contact = 2 [(google.api.field_behavior) = OPTIONAL];
392}
393
394// Contains details of the listing publisher.
395message Publisher {
396  // Optional. Name of the listing publisher.
397  string name = 1 [(google.api.field_behavior) = OPTIONAL];
398
399  // Optional. Email or URL of the listing publisher.
400  // Max Length: 1000 bytes.
401  string primary_contact = 2 [(google.api.field_behavior) = OPTIONAL];
402}
403
404// Contains the reference that identifies a destination bigquery dataset.
405message DestinationDatasetReference {
406  // Required. A unique ID for this dataset, without the project name. The ID
407  // must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
408  // The maximum length is 1,024 characters.
409  string dataset_id = 1 [(google.api.field_behavior) = REQUIRED];
410
411  // Required. The ID of the project containing this dataset.
412  string project_id = 2 [(google.api.field_behavior) = REQUIRED];
413}
414
415// Defines the destination bigquery dataset.
416message DestinationDataset {
417  // Required. A reference that identifies the destination dataset.
418  DestinationDatasetReference dataset_reference = 1
419      [(google.api.field_behavior) = REQUIRED];
420
421  // Optional. A descriptive name for the dataset.
422  google.protobuf.StringValue friendly_name = 2
423      [(google.api.field_behavior) = OPTIONAL];
424
425  // Optional. A user-friendly description of the dataset.
426  google.protobuf.StringValue description = 3
427      [(google.api.field_behavior) = OPTIONAL];
428
429  // Optional. The labels associated with this dataset. You can use these
430  // to organize and group your datasets.
431  // You can set this property when inserting or updating a dataset.
432  // See https://cloud.google.com/resource-manager/docs/creating-managing-labels
433  // for more information.
434  map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
435
436  // Required. The geographic location where the dataset should reside. See
437  // https://cloud.google.com/bigquery/docs/locations for supported
438  // locations.
439  string location = 5 [(google.api.field_behavior) = REQUIRED];
440}
441
442// A listing is what gets published into a data exchange that a subscriber can
443// subscribe to. It contains a reference to the data source along with
444// descriptive information that will help subscribers find and subscribe the
445// data.
446message Listing {
447  option (google.api.resource) = {
448    type: "analyticshub.googleapis.com/Listing"
449    pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
450  };
451
452  // A reference to a shared dataset. It is an existing BigQuery dataset with a
453  // collection of objects such as tables and views that you want to share
454  // with subscribers.
455  // When subscriber's subscribe to a listing, Analytics Hub creates a linked
456  // dataset in
457  // the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
458  // dataset that serves as a _symbolic link_ to a shared dataset.
459  message BigQueryDatasetSource {
460    // Resource in this dataset that are selectively shared.
461    message SelectedResource {
462      oneof resource {
463        // Optional. Format:
464        // For table:
465        // `projects/{projectId}/datasets/{datasetId}/tables/{tableId}`
466        // Example:"projects/test_project/datasets/test_dataset/tables/test_table"
467        string table = 1 [
468          (google.api.field_behavior) = OPTIONAL,
469          (google.api.resource_reference) = {
470            type: "bigquery.googleapis.com/Table"
471          }
472        ];
473      }
474    }
475
476    // Resource name of the dataset source for this listing.
477    // e.g. `projects/myproject/datasets/123`
478    string dataset = 1 [(google.api.resource_reference) = {
479      type: "bigquery.googleapis.com/Dataset"
480    }];
481
482    // Optional. Resources in this dataset that are selectively shared.
483    // If this field is empty, then the entire dataset (all resources) are
484    // shared. This field is only valid for data clean room exchanges.
485    repeated SelectedResource selected_resources = 2
486        [(google.api.field_behavior) = OPTIONAL];
487  }
488
489  // Restricted export config, used to configure restricted export on linked
490  // dataset.
491  message RestrictedExportConfig {
492    // Optional. If true, enable restricted export.
493    bool enabled = 3 [(google.api.field_behavior) = OPTIONAL];
494
495    // Output only. If true, restrict direct table access(read
496    // api/tabledata.list) on linked table.
497    bool restrict_direct_table_access = 1
498        [(google.api.field_behavior) = OUTPUT_ONLY];
499
500    // Optional. If true, restrict export of query result derived from
501    // restricted linked dataset table.
502    bool restrict_query_result = 2 [(google.api.field_behavior) = OPTIONAL];
503  }
504
505  // State of the listing.
506  enum State {
507    // Default value. This value is unused.
508    STATE_UNSPECIFIED = 0;
509
510    // Subscribable state. Users with dataexchange.listings.subscribe permission
511    // can subscribe to this listing.
512    ACTIVE = 1;
513  }
514
515  // Listing categories.
516  enum Category {
517    CATEGORY_UNSPECIFIED = 0;
518
519    CATEGORY_OTHERS = 1;
520
521    CATEGORY_ADVERTISING_AND_MARKETING = 2;
522
523    CATEGORY_COMMERCE = 3;
524
525    CATEGORY_CLIMATE_AND_ENVIRONMENT = 4;
526
527    CATEGORY_DEMOGRAPHICS = 5;
528
529    CATEGORY_ECONOMICS = 6;
530
531    CATEGORY_EDUCATION = 7;
532
533    CATEGORY_ENERGY = 8;
534
535    CATEGORY_FINANCIAL = 9;
536
537    CATEGORY_GAMING = 10;
538
539    CATEGORY_GEOSPATIAL = 11;
540
541    CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12;
542
543    CATEGORY_MEDIA = 13;
544
545    CATEGORY_PUBLIC_SECTOR = 14;
546
547    CATEGORY_RETAIL = 15;
548
549    CATEGORY_SPORTS = 16;
550
551    CATEGORY_SCIENCE_AND_RESEARCH = 17;
552
553    CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18;
554
555    CATEGORY_TRAVEL_AND_TOURISM = 19;
556  }
557
558  // Listing source.
559  oneof source {
560    // Required. Shared dataset i.e. BigQuery dataset source.
561    BigQueryDatasetSource bigquery_dataset = 6
562        [(google.api.field_behavior) = REQUIRED];
563  }
564
565  // Output only. The resource name of the listing.
566  // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`
567  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
568
569  // Required. Human-readable display name of the listing. The display name must
570  // contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
571  // spaces ( ), ampersands (&) and can't start or end with spaces. Default
572  // value is an empty string. Max length: 63 bytes.
573  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
574
575  // Optional. Short description of the listing. The description must not
576  // contain Unicode non-characters and C0 and C1 control codes except tabs
577  // (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
578  // value is an empty string. Max length: 2000 bytes.
579  string description = 3 [(google.api.field_behavior) = OPTIONAL];
580
581  // Optional. Email or URL of the primary point of contact of the listing.
582  // Max Length: 1000 bytes.
583  string primary_contact = 4 [(google.api.field_behavior) = OPTIONAL];
584
585  // Optional. Documentation describing the listing.
586  string documentation = 5 [(google.api.field_behavior) = OPTIONAL];
587
588  // Output only. Current state of the listing.
589  State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
590
591  // Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
592  // Expected image dimensions are 512x512 pixels, however the API only
593  // performs validation on size of the encoded data.
594  // Note: For byte fields, the contents of the field are base64-encoded (which
595  // increases the size of the data by 33-36%) when using JSON on the wire.
596  bytes icon = 8 [(google.api.field_behavior) = OPTIONAL];
597
598  // Optional. Details of the data provider who owns the source data.
599  DataProvider data_provider = 9 [(google.api.field_behavior) = OPTIONAL];
600
601  // Optional. Categories of the listing. Up to two categories are allowed.
602  repeated Category categories = 10 [(google.api.field_behavior) = OPTIONAL];
603
604  // Optional. Details of the publisher who owns the listing and who can share
605  // the source data.
606  Publisher publisher = 11 [(google.api.field_behavior) = OPTIONAL];
607
608  // Optional. Email or URL of the request access of the listing.
609  // Subscribers can use this reference to request access.
610  // Max Length: 1000 bytes.
611  string request_access = 12 [(google.api.field_behavior) = OPTIONAL];
612
613  // Optional. If set, restricted export configuration will be propagated and
614  // enforced on the linked dataset.
615  RestrictedExportConfig restricted_export_config = 13
616      [(google.api.field_behavior) = OPTIONAL];
617}
618
619// A subscription represents a subscribers' access to a particular set of
620// published data. It contains references to associated listings,
621// data exchanges, and linked datasets.
622message Subscription {
623  option (google.api.resource) = {
624    type: "analyticshub.googleapis.com/Subscription"
625    pattern: "projects/{project}/locations/{location}/subscriptions/{subscription}"
626  };
627
628  // Reference to a linked resource tracked by this Subscription.
629  message LinkedResource {
630    oneof reference {
631      // Output only. Name of the linked dataset, e.g.
632      // projects/subscriberproject/datasets/linked_dataset
633      string linked_dataset = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
634    }
635  }
636
637  // State of the subscription.
638  enum State {
639    // Default value. This value is unused.
640    STATE_UNSPECIFIED = 0;
641
642    // This subscription is active and the data is accessible.
643    STATE_ACTIVE = 1;
644
645    // The data referenced by this subscription is out of date and should be
646    // refreshed. This can happen when a data provider adds or removes datasets.
647    STATE_STALE = 2;
648
649    // This subscription has been cancelled or revoked and the data is no longer
650    // accessible.
651    STATE_INACTIVE = 3;
652  }
653
654  oneof resource_name {
655    // Output only. Resource name of the source Listing.
656    // e.g. projects/123/locations/US/dataExchanges/456/listings/789
657    string listing = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
658
659    // Output only. Resource name of the source Data Exchange.
660    // e.g. projects/123/locations/US/dataExchanges/456
661    string data_exchange = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
662  }
663
664  // Output only. The resource name of the subscription.
665  // e.g. `projects/myproject/locations/US/subscriptions/123`.
666  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
667
668  // Output only. Timestamp when the subscription was created.
669  google.protobuf.Timestamp creation_time = 2
670      [(google.api.field_behavior) = OUTPUT_ONLY];
671
672  // Output only. Timestamp when the subscription was last modified.
673  google.protobuf.Timestamp last_modify_time = 3
674      [(google.api.field_behavior) = OUTPUT_ONLY];
675
676  // Output only. Organization of the project this subscription belongs to.
677  string organization_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
678
679  // Output only. Display name of the project of this subscription.
680  string organization_display_name = 10
681      [(google.api.field_behavior) = OUTPUT_ONLY];
682
683  // Output only. Current state of the subscription.
684  State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
685
686  // Output only. Map of listing resource names to associated linked resource,
687  // e.g. projects/123/locations/US/dataExchanges/456/listings/789
688  // ->
689  // projects/123/datasets/my_dataset
690  //
691  // For listing-level subscriptions, this is a map of size 1.
692  // Only contains values if state == STATE_ACTIVE.
693  map<string, LinkedResource> linked_dataset_map = 8
694      [(google.api.field_behavior) = OUTPUT_ONLY];
695
696  // Output only. Email of the subscriber.
697  string subscriber_contact = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
698}
699
700// Message for requesting the list of data exchanges.
701message ListDataExchangesRequest {
702  // Required. The parent resource path of the data exchanges.
703  // e.g. `projects/myproject/locations/US`.
704  string parent = 1 [
705    (google.api.field_behavior) = REQUIRED,
706    (google.api.resource_reference) = {
707      child_type: "analyticshub.googleapis.com/DataExchange"
708    }
709  ];
710
711  // The maximum number of results to return in a single response page. Leverage
712  // the page tokens to iterate through the entire collection.
713  int32 page_size = 2;
714
715  // Page token, returned by a previous call, to request the next page of
716  // results.
717  string page_token = 3;
718}
719
720// Message for response to the list of data exchanges.
721message ListDataExchangesResponse {
722  // The list of data exchanges.
723  repeated DataExchange data_exchanges = 1;
724
725  // A token to request the next page of results.
726  string next_page_token = 2;
727}
728
729// Message for requesting the list of data exchanges from projects in an
730// organization and location.
731message ListOrgDataExchangesRequest {
732  // Required. The organization resource path of the projects containing
733  // DataExchanges. e.g. `organizations/myorg/locations/US`.
734  string organization = 1 [(google.api.field_behavior) = REQUIRED];
735
736  // The maximum number of results to return in a single response page. Leverage
737  // the page tokens to iterate through the entire collection.
738  int32 page_size = 2;
739
740  // Page token, returned by a previous call, to request the next page of
741  // results.
742  string page_token = 3;
743}
744
745// Message for response to listing data exchanges in an organization and
746// location.
747message ListOrgDataExchangesResponse {
748  // The list of data exchanges.
749  repeated DataExchange data_exchanges = 1;
750
751  // A token to request the next page of results.
752  string next_page_token = 2;
753}
754
755// Message for getting a data exchange.
756message GetDataExchangeRequest {
757  // Required. The resource name of the data exchange.
758  // e.g. `projects/myproject/locations/US/dataExchanges/123`.
759  string name = 1 [
760    (google.api.field_behavior) = REQUIRED,
761    (google.api.resource_reference) = {
762      type: "analyticshub.googleapis.com/DataExchange"
763    }
764  ];
765}
766
767// Message for creating a data exchange.
768message CreateDataExchangeRequest {
769  // Required. The parent resource path of the data exchange.
770  // e.g. `projects/myproject/locations/US`.
771  string parent = 1 [
772    (google.api.field_behavior) = REQUIRED,
773    (google.api.resource_reference) = {
774      child_type: "analyticshub.googleapis.com/DataExchange"
775    }
776  ];
777
778  // Required. The ID of the data exchange.
779  // Must contain only Unicode letters, numbers (0-9), underscores (_).
780  // Should not use characters that require URL-escaping, or characters
781  // outside of ASCII, spaces.
782  // Max length: 100 bytes.
783  string data_exchange_id = 2 [(google.api.field_behavior) = REQUIRED];
784
785  // Required. The data exchange to create.
786  DataExchange data_exchange = 3 [(google.api.field_behavior) = REQUIRED];
787}
788
789// Message for updating a data exchange.
790message UpdateDataExchangeRequest {
791  // Required. Field mask specifies the fields to update in the data exchange
792  // resource. The fields specified in the
793  // `updateMask` are relative to the resource and are not a full request.
794  google.protobuf.FieldMask update_mask = 1
795      [(google.api.field_behavior) = REQUIRED];
796
797  // Required. The data exchange to update.
798  DataExchange data_exchange = 2 [(google.api.field_behavior) = REQUIRED];
799}
800
801// Message for deleting a data exchange.
802message DeleteDataExchangeRequest {
803  // Required. The full name of the data exchange resource that you want to
804  // delete. For example, `projects/myproject/locations/US/dataExchanges/123`.
805  string name = 1 [
806    (google.api.field_behavior) = REQUIRED,
807    (google.api.resource_reference) = {
808      type: "analyticshub.googleapis.com/DataExchange"
809    }
810  ];
811}
812
813// Message for requesting the list of listings.
814message ListListingsRequest {
815  // Required. The parent resource path of the listing.
816  // e.g. `projects/myproject/locations/US/dataExchanges/123`.
817  string parent = 1 [
818    (google.api.field_behavior) = REQUIRED,
819    (google.api.resource_reference) = {
820      type: "analyticshub.googleapis.com/DataExchange"
821    }
822  ];
823
824  // The maximum number of results to return in a single response page. Leverage
825  // the page tokens to iterate through the entire collection.
826  int32 page_size = 2;
827
828  // Page token, returned by a previous call, to request the next page of
829  // results.
830  string page_token = 3;
831}
832
833// Message for response to the list of Listings.
834message ListListingsResponse {
835  // The list of Listing.
836  repeated Listing listings = 1;
837
838  // A token to request the next page of results.
839  string next_page_token = 2;
840}
841
842// Message for getting a listing.
843message GetListingRequest {
844  // Required. The resource name of the listing.
845  // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
846  string name = 1 [
847    (google.api.field_behavior) = REQUIRED,
848    (google.api.resource_reference) = {
849      type: "analyticshub.googleapis.com/Listing"
850    }
851  ];
852}
853
854// Message for creating a listing.
855message CreateListingRequest {
856  // Required. The parent resource path of the listing.
857  // e.g. `projects/myproject/locations/US/dataExchanges/123`.
858  string parent = 1 [
859    (google.api.field_behavior) = REQUIRED,
860    (google.api.resource_reference) = {
861      type: "analyticshub.googleapis.com/DataExchange"
862    }
863  ];
864
865  // Required. The ID of the listing to create.
866  // Must contain only Unicode letters, numbers (0-9), underscores (_).
867  // Should not use characters that require URL-escaping, or characters
868  // outside of ASCII, spaces.
869  // Max length: 100 bytes.
870  string listing_id = 2 [(google.api.field_behavior) = REQUIRED];
871
872  // Required. The listing to create.
873  Listing listing = 3 [(google.api.field_behavior) = REQUIRED];
874}
875
876// Message for updating a Listing.
877message UpdateListingRequest {
878  // Required. Field mask specifies the fields to update in the listing
879  // resource. The fields specified in the `updateMask` are relative to the
880  // resource and are not a full request.
881  google.protobuf.FieldMask update_mask = 1
882      [(google.api.field_behavior) = REQUIRED];
883
884  // Required. The listing to update.
885  Listing listing = 2 [(google.api.field_behavior) = REQUIRED];
886}
887
888// Message for deleting a listing.
889message DeleteListingRequest {
890  // Required. Resource name of the listing to delete.
891  // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
892  string name = 1 [
893    (google.api.field_behavior) = REQUIRED,
894    (google.api.resource_reference) = {
895      type: "analyticshub.googleapis.com/Listing"
896    }
897  ];
898}
899
900// Message for subscribing to a listing.
901message SubscribeListingRequest {
902  // Resulting destination of the listing that you subscribed to.
903  oneof destination {
904    // BigQuery destination dataset to create for the subscriber.
905    DestinationDataset destination_dataset = 3;
906  }
907
908  // Required. Resource name of the listing that you want to subscribe to.
909  // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`.
910  string name = 1 [
911    (google.api.field_behavior) = REQUIRED,
912    (google.api.resource_reference) = {
913      type: "analyticshub.googleapis.com/Listing"
914    }
915  ];
916}
917
918// Message for response when you subscribe to a listing.
919message SubscribeListingResponse {
920  // Subscription object created from this subscribe action.
921  Subscription subscription = 1;
922}
923
924// Message for subscribing to a Data Exchange.
925message SubscribeDataExchangeRequest {
926  // Required. Resource name of the Data Exchange.
927  // e.g. `projects/publisherproject/locations/US/dataExchanges/123`
928  string name = 1 [
929    (google.api.field_behavior) = REQUIRED,
930    (google.api.resource_reference) = {
931      type: "analyticshub.googleapis.com/DataExchange"
932    }
933  ];
934
935  // Required. The parent resource path of the Subscription.
936  // e.g. `projects/subscriberproject/locations/US`
937  string destination = 2 [
938    (google.api.field_behavior) = REQUIRED,
939    (google.api.resource_reference) = {
940      type: "locations.googleapis.com/Location"
941    }
942  ];
943
944  // Required. Name of the subscription to create.
945  // e.g. `subscription1`
946  string subscription = 4 [(google.api.field_behavior) = REQUIRED];
947
948  // Email of the subscriber.
949  string subscriber_contact = 3;
950}
951
952// Message for response when you subscribe to a Data Exchange.
953message SubscribeDataExchangeResponse {
954  // Subscription object created from this subscribe action.
955  Subscription subscription = 1;
956}
957
958// Message for refreshing a subscription.
959message RefreshSubscriptionRequest {
960  // Required. Resource name of the Subscription to refresh.
961  // e.g. `projects/subscriberproject/locations/US/subscriptions/123`
962  string name = 1 [
963    (google.api.field_behavior) = REQUIRED,
964    (google.api.resource_reference) = {
965      type: "analyticshub.googleapis.com/Subscription"
966    }
967  ];
968}
969
970// Message for response when you refresh a subscription.
971message RefreshSubscriptionResponse {
972  // The refreshed subscription resource.
973  Subscription subscription = 1;
974}
975
976// Message for getting a subscription.
977message GetSubscriptionRequest {
978  // Required. Resource name of the subscription.
979  // e.g. projects/123/locations/US/subscriptions/456
980  string name = 1 [
981    (google.api.field_behavior) = REQUIRED,
982    (google.api.resource_reference) = {
983      type: "analyticshub.googleapis.com/Subscription"
984    }
985  ];
986}
987
988// Message for listing subscriptions.
989message ListSubscriptionsRequest {
990  // Required. The parent resource path of the subscription.
991  // e.g. projects/myproject/locations/US
992  string parent = 1 [
993    (google.api.field_behavior) = REQUIRED,
994    (google.api.resource_reference) = {
995      child_type: "analyticshub.googleapis.com/Subscription"
996    }
997  ];
998
999  // The filter expression may be used to filter by Data Exchange or Listing.
1000  string filter = 2;
1001
1002  // The maximum number of results to return in a single response page.
1003  int32 page_size = 3;
1004
1005  // Page token, returned by a previous call.
1006  string page_token = 4;
1007}
1008
1009// Message for response to the listing of subscriptions.
1010message ListSubscriptionsResponse {
1011  // The list of subscriptions.
1012  repeated Subscription subscriptions = 1;
1013
1014  // Next page token.
1015  string next_page_token = 2;
1016}
1017
1018// Message for listing subscriptions of a shared resource.
1019message ListSharedResourceSubscriptionsRequest {
1020  // Required. Resource name of the requested target. This resource may be
1021  // either a Listing or a DataExchange. e.g.
1022  // projects/123/locations/US/dataExchanges/456 OR e.g.
1023  // projects/123/locations/US/dataExchanges/456/listings/789
1024  string resource = 1 [
1025    (google.api.field_behavior) = REQUIRED,
1026    (google.api.resource_reference) = { type: "*" }
1027  ];
1028
1029  // If selected, includes deleted subscriptions in the response
1030  // (up to 63 days after deletion).
1031  bool include_deleted_subscriptions = 2;
1032
1033  // The maximum number of results to return in a single response page.
1034  int32 page_size = 3;
1035
1036  // Page token, returned by a previous call.
1037  string page_token = 4;
1038}
1039
1040// Message for response to the listing of shared resource subscriptions.
1041message ListSharedResourceSubscriptionsResponse {
1042  // The list of subscriptions.
1043  repeated Subscription shared_resource_subscriptions = 1;
1044
1045  // Next page token.
1046  string next_page_token = 2;
1047}
1048
1049// Message for revoking a subscription.
1050message RevokeSubscriptionRequest {
1051  // Required. Resource name of the subscription to revoke.
1052  // e.g. projects/123/locations/US/subscriptions/456
1053  string name = 1 [
1054    (google.api.field_behavior) = REQUIRED,
1055    (google.api.resource_reference) = {
1056      type: "analyticshub.googleapis.com/Subscription"
1057    }
1058  ];
1059}
1060
1061// Message for response when you revoke a subscription.
1062message RevokeSubscriptionResponse {}
1063
1064// Message for deleting a subscription.
1065message DeleteSubscriptionRequest {
1066  // Required. Resource name of the subscription to delete.
1067  // e.g. projects/123/locations/US/subscriptions/456
1068  string name = 1 [
1069    (google.api.field_behavior) = REQUIRED,
1070    (google.api.resource_reference) = {
1071      type: "analyticshub.googleapis.com/Subscription"
1072    }
1073  ];
1074}
1075
1076// Represents the metadata of a long-running operation in Analytics Hub.
1077message OperationMetadata {
1078  // Output only. The time the operation was created.
1079  google.protobuf.Timestamp create_time = 1
1080      [(google.api.field_behavior) = OUTPUT_ONLY];
1081
1082  // Output only. The time the operation finished running.
1083  google.protobuf.Timestamp end_time = 2
1084      [(google.api.field_behavior) = OUTPUT_ONLY];
1085
1086  // Output only. Server-defined resource path for the target of the operation.
1087  string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
1088
1089  // Output only. Name of the verb executed by the operation.
1090  string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
1091
1092  // Output only. Human-readable status of the operation, if any.
1093  string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
1094
1095  // Output only. Identifies whether the user has requested cancellation
1096  // of the operation. Operations that have successfully been cancelled
1097  // have [Operation.error][] value with a
1098  // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1099  // `Code.CANCELLED`.
1100  bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
1101
1102  // Output only. API version used to start the operation.
1103  string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
1104}
1105