1// Copyright 2020 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.recommendationengine.v1beta1; 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/recommendationengine/v1beta1/catalog.proto"; 24import "google/cloud/recommendationengine/v1beta1/import.proto"; 25import "google/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto"; 26import "google/longrunning/operations.proto"; 27import "google/protobuf/empty.proto"; 28import "google/protobuf/field_mask.proto"; 29 30option csharp_namespace = "Google.Cloud.RecommendationEngine.V1Beta1"; 31option go_package = "cloud.google.com/go/recommendationengine/apiv1beta1/recommendationenginepb;recommendationenginepb"; 32option java_multiple_files = true; 33option java_package = "com.google.cloud.recommendationengine.v1beta1"; 34option objc_class_prefix = "RECAI"; 35option php_namespace = "Google\\Cloud\\RecommendationEngine\\V1beta1"; 36option ruby_package = "Google::Cloud::RecommendationEngine::V1beta1"; 37 38// Service for ingesting catalog information of the customer's website. 39service CatalogService { 40 option (google.api.default_host) = "recommendationengine.googleapis.com"; 41 option (google.api.oauth_scopes) = 42 "https://www.googleapis.com/auth/cloud-platform"; 43 44 // Creates a catalog item. 45 rpc CreateCatalogItem(CreateCatalogItemRequest) returns (CatalogItem) { 46 option (google.api.http) = { 47 post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems" 48 body: "catalog_item" 49 }; 50 option (google.api.method_signature) = "parent,catalog_item"; 51 } 52 53 // Gets a specific catalog item. 54 rpc GetCatalogItem(GetCatalogItemRequest) returns (CatalogItem) { 55 option (google.api.http) = { 56 get: "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}" 57 }; 58 option (google.api.method_signature) = "name"; 59 } 60 61 // Gets a list of catalog items. 62 rpc ListCatalogItems(ListCatalogItemsRequest) 63 returns (ListCatalogItemsResponse) { 64 option (google.api.http) = { 65 get: "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems" 66 }; 67 option (google.api.method_signature) = "parent,filter"; 68 } 69 70 // Updates a catalog item. Partial updating is supported. Non-existing 71 // items will be created. 72 rpc UpdateCatalogItem(UpdateCatalogItemRequest) returns (CatalogItem) { 73 option (google.api.http) = { 74 patch: "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}" 75 body: "catalog_item" 76 }; 77 option (google.api.method_signature) = "name,catalog_item,update_mask"; 78 } 79 80 // Deletes a catalog item. 81 rpc DeleteCatalogItem(DeleteCatalogItemRequest) 82 returns (google.protobuf.Empty) { 83 option (google.api.http) = { 84 delete: "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}" 85 }; 86 option (google.api.method_signature) = "name"; 87 } 88 89 // Bulk import of multiple catalog items. Request processing may be 90 // synchronous. No partial updating supported. Non-existing items will be 91 // created. 92 // 93 // Operation.response is of type ImportResponse. Note that it is 94 // possible for a subset of the items to be successfully updated. 95 rpc ImportCatalogItems(ImportCatalogItemsRequest) 96 returns (google.longrunning.Operation) { 97 option (google.api.http) = { 98 post: "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import" 99 body: "*" 100 }; 101 option (google.longrunning.operation_info) = { 102 response_type: "google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse" 103 metadata_type: "google.cloud.recommendationengine.v1beta1.ImportMetadata" 104 }; 105 option (google.api.method_signature) = 106 "parent,request_id,input_config,errors_config"; 107 } 108} 109 110// Request message for CreateCatalogItem method. 111message CreateCatalogItemRequest { 112 // Required. The parent catalog resource name, such as 113 // `projects/*/locations/global/catalogs/default_catalog`. 114 string parent = 1 [ 115 (google.api.field_behavior) = REQUIRED, 116 (google.api.resource_reference) = { 117 type: "recommendationengine.googleapis.com/Catalog" 118 } 119 ]; 120 121 // Required. The catalog item to create. 122 CatalogItem catalog_item = 2 [(google.api.field_behavior) = REQUIRED]; 123} 124 125// Request message for GetCatalogItem method. 126message GetCatalogItemRequest { 127 // Required. Full resource name of catalog item, such as 128 // `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. 129 string name = 1 [ 130 (google.api.field_behavior) = REQUIRED, 131 (google.api.resource_reference) = { 132 type: "recommendationengine.googleapis.com/CatalogItemPath" 133 } 134 ]; 135} 136 137// Request message for ListCatalogItems method. 138message ListCatalogItemsRequest { 139 // Required. The parent catalog resource name, such as 140 // `projects/*/locations/global/catalogs/default_catalog`. 141 string parent = 1 [ 142 (google.api.field_behavior) = REQUIRED, 143 (google.api.resource_reference) = { 144 type: "recommendationengine.googleapis.com/Catalog" 145 } 146 ]; 147 148 // Optional. Maximum number of results to return per page. If zero, the 149 // service will choose a reasonable default. 150 int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; 151 152 // Optional. The previous ListCatalogItemsResponse.next_page_token. 153 string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; 154 155 // Optional. A filter to apply on the list results. 156 string filter = 4 [(google.api.field_behavior) = OPTIONAL]; 157} 158 159// Response message for ListCatalogItems method. 160message ListCatalogItemsResponse { 161 // The catalog items. 162 repeated CatalogItem catalog_items = 1; 163 164 // If empty, the list is complete. If nonempty, the token to pass to the next 165 // request's ListCatalogItemRequest.page_token. 166 string next_page_token = 2; 167} 168 169// Request message for UpdateCatalogItem method. 170message UpdateCatalogItemRequest { 171 // Required. Full resource name of catalog item, such as 172 // `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. 173 string name = 1 [ 174 (google.api.field_behavior) = REQUIRED, 175 (google.api.resource_reference) = { 176 type: "recommendationengine.googleapis.com/CatalogItemPath" 177 } 178 ]; 179 180 // Required. The catalog item to update/create. The 'catalog_item_id' field 181 // has to match that in the 'name'. 182 CatalogItem catalog_item = 2 [(google.api.field_behavior) = REQUIRED]; 183 184 // Optional. Indicates which fields in the provided 'item' to update. If not 185 // set, will by default update all fields. 186 google.protobuf.FieldMask update_mask = 3; 187} 188 189// Request message for DeleteCatalogItem method. 190message DeleteCatalogItemRequest { 191 // Required. Full resource name of catalog item, such as 192 // `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. 193 string name = 1 [ 194 (google.api.field_behavior) = REQUIRED, 195 (google.api.resource_reference) = { 196 type: "recommendationengine.googleapis.com/CatalogItemPath" 197 } 198 ]; 199} 200