xref: /aosp_15_r20/external/googleapis/google/cloud/discoveryengine/v1alpha/project_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2022 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.discoveryengine.v1alpha;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/discoveryengine/v1alpha/project.proto";
24import "google/longrunning/operations.proto";
25
26option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
27option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
28option java_multiple_files = true;
29option java_outer_classname = "ProjectServiceProto";
30option java_package = "com.google.cloud.discoveryengine.v1alpha";
31option objc_class_prefix = "DISCOVERYENGINE";
32option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
33option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
34
35// Service for operations on the
36// [Project][google.cloud.discoveryengine.v1alpha.Project].
37service ProjectService {
38  option (google.api.default_host) = "discoveryengine.googleapis.com";
39  option (google.api.oauth_scopes) =
40      "https://www.googleapis.com/auth/cloud-platform";
41
42  // Gets a [Project][google.cloud.discoveryengine.v1alpha.Project].
43  // Returns NOT_FOUND when the project is not yet created.
44  rpc GetProject(GetProjectRequest) returns (Project) {
45    option (google.api.http) = {
46      get: "/v1alpha/{name=projects/*}"
47    };
48    option (google.api.method_signature) = "name";
49  }
50
51  // Provisions the project resource. During the
52  // process, related systems will get prepared and initialized.
53  //
54  // Caller must read the [Terms for data
55  // use](https://cloud.google.com/retail/data-use-terms), and optionally
56  // specify in request to provide consent to that service terms.
57  rpc ProvisionProject(ProvisionProjectRequest)
58      returns (google.longrunning.Operation) {
59    option (google.api.http) = {
60      post: "/v1alpha/{name=projects/*}:provision"
61      body: "*"
62    };
63    option (google.api.method_signature) = "name";
64    option (google.longrunning.operation_info) = {
65      response_type: "google.cloud.discoveryengine.v1alpha.Project"
66      metadata_type: "google.cloud.discoveryengine.v1alpha.ProvisionProjectMetadata"
67    };
68  }
69
70  // Updates service terms for this project.
71  //
72  // This method can be used to retroactively accept the latest terms.
73  //
74  // Terms available for update:
75  // * [Terms for data use](https://cloud.google.com/retail/data-use-terms)
76  rpc ReportConsentChange(ReportConsentChangeRequest) returns (Project) {
77    option (google.api.http) = {
78      post: "/v1alpha/{project=projects/*}:reportConsentChange"
79      body: "*"
80    };
81    option (google.api.method_signature) =
82        "consent_change_action,project,service_term_id,service_term_version";
83  }
84}
85
86// Request message for
87// [ProjectService.GetProject][google.cloud.discoveryengine.v1alpha.ProjectService.GetProject]
88// method.
89message GetProjectRequest {
90  // Required. Full resource name of a
91  // [Project][google.cloud.discoveryengine.v1alpha.Project], such as
92  // `projects/{project_id_or_number}`.
93  string name = 1 [
94    (google.api.field_behavior) = REQUIRED,
95    (google.api.resource_reference) = {
96      type: "discoveryengine.googleapis.com/Project"
97    }
98  ];
99}
100
101// Request for
102// [ProjectService.ProvisionProject][google.cloud.discoveryengine.v1alpha.ProjectService.ProvisionProject]
103// method.
104message ProvisionProjectRequest {
105  // Required. Full resource name of a
106  // [Project][google.cloud.discoveryengine.v1alpha.Project], such as
107  // `projects/{project_id_or_number}`.
108  string name = 1 [
109    (google.api.field_behavior) = REQUIRED,
110    (google.api.resource_reference) = {
111      type: "discoveryengine.googleapis.com/Project"
112    }
113  ];
114
115  // Required. Set to `true` to specify that caller has read and would like to
116  // give consent to the [Terms for data
117  // use](https://cloud.google.com/retail/data-use-terms).
118  bool accept_data_use_terms = 2 [(google.api.field_behavior) = REQUIRED];
119
120  // Required. The version of the [Terms for data
121  // use](https://cloud.google.com/retail/data-use-terms) that caller has read
122  // and would like to give consent to.
123  //
124  // Acceptable version is `2022-11-23`, and this may change over time.
125  string data_use_terms_version = 3 [(google.api.field_behavior) = REQUIRED];
126}
127
128// Metadata associated with a project provision operation.
129message ProvisionProjectMetadata {}
130
131// Request for ReportConsentChange method.
132message ReportConsentChangeRequest {
133  // Type of consent acknowledgement (accept / reject).
134  //
135  // At this moment, only `ACCEPT` action is supported.
136  enum ConsentChangeAction {
137    // Invalid action, user must specify accept/decline
138    CONSENT_CHANGE_ACTION_UNSPECIFIED = 0;
139
140    // User accepts service terms.
141    ACCEPT = 1;
142  }
143
144  // Required. Whether customer decides to accept or decline service term.
145  //
146  // At this moment, only accept action is supported.
147  ConsentChangeAction consent_change_action = 1
148      [(google.api.field_behavior) = REQUIRED];
149
150  // Required. Full resource name of a
151  // [Project][google.cloud.discoveryengine.v1alpha.Project], such as
152  // `projects/{project_id_or_number}`.
153  string project = 2 [
154    (google.api.field_behavior) = REQUIRED,
155    (google.api.resource_reference) = {
156      type: "discoveryengine.googleapis.com/Project"
157    }
158  ];
159
160  // Required. The unique identifier of the terms of service to update.
161  // Available term ids:
162  // * `GA_DATA_USE_TERMS`: [Terms for data
163  // use](https://cloud.google.com/retail/data-use-terms). When using this
164  // service term id, the acceptable
165  // [service_term_version][google.cloud.discoveryengine.v1alpha.ReportConsentChangeRequest.service_term_version]
166  // to provide is `2022-11-23`.
167  string service_term_id = 3 [(google.api.field_behavior) = REQUIRED];
168
169  // Required. The version string of the terms of service to update.
170  string service_term_version = 4 [(google.api.field_behavior) = REQUIRED];
171}
172