From d45392c15f4d9b7c36f935b4e35236c48513e232 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 12 Sep 2022 18:56:33 +0000 Subject: [PATCH 1/2] fix: Fix recommendationengine resource name configuration PiperOrigin-RevId: 473779245 Source-Link: https://github.com/googleapis/googleapis/commit/ee05df98143628e2e7231d367b0f50d03f71c29a Source-Link: https://github.com/googleapis/googleapis-gen/commit/d151c136b7de66b7b524817360c639d011ef003d Copy-Tag: eyJwIjoiUmVjb21tZW5kYXRpb25FbmdpbmUvLk93bEJvdC55YW1sIiwiaCI6ImQxNTFjMTM2YjdkZTY2YjdiNTI0ODE3MzYwYzYzOWQwMTFlZjAwM2QifQ== --- .../Recommendationengine/V1Beta1/Catalog.php | Bin 0 -> 2632 bytes .../V1Beta1/CatalogService.php | 70 ++ .../Recommendationengine/V1Beta1/Common.php | 42 + .../Recommendationengine/V1Beta1/Import.php | Bin 0 -> 3668 bytes .../PredictionApikeyRegistryService.php | 55 ++ .../V1Beta1/PredictionService.php | 70 ++ .../V1Beta1/RecommendationengineResources.php | 33 + .../V1Beta1/UserEvent.php | Bin 0 -> 3433 bytes .../V1Beta1/UserEventService.php | 78 ++ .../V1beta1/CatalogInlineSource.php | 71 ++ .../V1beta1/CatalogItem.php | 473 ++++++++++++ .../V1beta1/CatalogItem/CategoryHierarchy.php | 82 ++ .../V1beta1/CatalogItem_CategoryHierarchy.php | 16 + .../V1beta1/CatalogServiceGrpcClient.php | 131 ++++ .../V1beta1/CollectUserEventRequest.php | 193 +++++ .../V1beta1/CreateCatalogItemRequest.php | 115 +++ ...atePredictionApiKeyRegistrationRequest.php | 115 +++ .../V1beta1/DeleteCatalogItemRequest.php | 71 ++ ...etePredictionApiKeyRegistrationRequest.php | 71 ++ .../V1beta1/EventDetail.php | 359 +++++++++ .../V1beta1/FeatureMap.php | 139 ++++ .../V1beta1/FeatureMap/FloatList.php | 70 ++ .../V1beta1/FeatureMap/StringList.php | 70 ++ .../V1beta1/FeatureMap_FloatList.php | 16 + .../V1beta1/FeatureMap_StringList.php | 16 + .../V1beta1/GcsSource.php | 92 +++ .../V1beta1/GetCatalogItemRequest.php | 71 ++ .../RecommendationEngine/V1beta1/Image.php | 135 ++++ .../V1beta1/ImportCatalogItemsRequest.php | 201 +++++ .../V1beta1/ImportCatalogItemsResponse.php | 113 +++ .../V1beta1/ImportErrorsConfig.php | 84 ++ .../V1beta1/ImportMetadata.php | 266 +++++++ .../V1beta1/ImportUserEventsRequest.php | 213 +++++ .../V1beta1/ImportUserEventsResponse.php | 161 ++++ .../V1beta1/InputConfig.php | 141 ++++ .../V1beta1/ListCatalogItemsRequest.php | 177 +++++ .../V1beta1/ListCatalogItemsResponse.php | 105 +++ ...stPredictionApiKeyRegistrationsRequest.php | 143 ++++ ...tPredictionApiKeyRegistrationsResponse.php | 105 +++ .../V1beta1/ListUserEventsRequest.php | 277 +++++++ .../V1beta1/ListUserEventsResponse.php | 105 +++ .../V1beta1/PredictRequest.php | 551 +++++++++++++ .../V1beta1/PredictResponse.php | 253 ++++++ .../PredictResponse/PredictionResult.php | 124 +++ .../PredictResponse_PredictionResult.php | 16 + .../V1beta1/PredictionApiKeyRegistration.php | 67 ++ .../PredictionApiKeyRegistryGrpcClient.php | 84 ++ .../V1beta1/PredictionServiceGrpcClient.php | 53 ++ .../V1beta1/ProductCatalogItem.php | 340 ++++++++ .../V1beta1/ProductCatalogItem/ExactPrice.php | 108 +++ .../V1beta1/ProductCatalogItem/PriceRange.php | 105 +++ .../V1beta1/ProductCatalogItem/StockState.php | 79 ++ .../V1beta1/ProductCatalogItem_ExactPrice.php | 16 + .../V1beta1/ProductCatalogItem_PriceRange.php | 16 + .../V1beta1/ProductCatalogItem_StockState.php | 16 + .../V1beta1/ProductDetail.php | 371 +++++++++ .../V1beta1/ProductEventDetail.php | 368 +++++++++ .../V1beta1/PurchaseTransaction.php | 251 ++++++ .../V1beta1/PurgeUserEventsMetadata.php | 112 +++ .../V1beta1/PurgeUserEventsRequest.php | 219 ++++++ .../V1beta1/PurgeUserEventsResponse.php | 107 +++ .../V1beta1/UpdateCatalogItemRequest.php | 167 ++++ .../V1beta1/UserEvent.php | 422 ++++++++++ .../V1beta1/UserEvent/EventSource.php | 73 ++ .../V1beta1/UserEventImportSummary.php | 106 +++ .../V1beta1/UserEventInlineSource.php | 67 ++ .../V1beta1/UserEventServiceGrpcClient.php | 123 +++ .../V1beta1/UserEvent_EventSource.php | 16 + .../RecommendationEngine/V1beta1/UserInfo.php | 271 +++++++ .../V1beta1/WriteUserEventRequest.php | 115 +++ .../src/V1beta1/CatalogServiceClient.php | 36 + .../Gapic/CatalogServiceGapicClient.php | 698 +++++++++++++++++ .../PredictionApiKeyRegistryGapicClient.php | 469 +++++++++++ .../Gapic/PredictionServiceGapicClient.php | 454 +++++++++++ .../Gapic/UserEventServiceGapicClient.php | 728 ++++++++++++++++++ .../PredictionApiKeyRegistryClient.php | 36 + .../src/V1beta1/PredictionServiceClient.php | 36 + .../src/V1beta1/UserEventServiceClient.php | 36 + .../v1beta1/src/V1beta1/gapic_metadata.json | 120 +++ .../catalog_service_client_config.json | 65 ++ .../catalog_service_descriptor_config.php | 28 + .../catalog_service_rest_client_config.php | 113 +++ ...iction_api_key_registry_client_config.json | 50 ++ ...ion_api_key_registry_descriptor_config.php | 18 + ...on_api_key_registry_rest_client_config.php | 78 ++ .../prediction_service_client_config.json | 40 + .../prediction_service_descriptor_config.php | 18 + .../prediction_service_rest_client_config.php | 56 ++ .../user_event_service_client_config.json | 60 ++ .../user_event_service_descriptor_config.php | 38 + .../user_event_service_rest_client_config.php | 102 +++ .../Unit/V1beta1/CatalogServiceClientTest.php | 584 ++++++++++++++ .../PredictionApiKeyRegistryClientTest.php | 272 +++++++ .../V1beta1/PredictionServiceClientTest.php | 163 ++++ .../V1beta1/UserEventServiceClientTest.php | 554 +++++++++++++ 95 files changed, 14213 insertions(+) create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Catalog.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/CatalogService.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Common.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Import.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionApikeyRegistryService.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionService.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/RecommendationengineResources.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/UserEvent.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/UserEventService.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogInlineSource.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem/CategoryHierarchy.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem_CategoryHierarchy.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogServiceGrpcClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/EventDetail.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/FloatList.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/StringList.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_FloatList.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_StringList.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GcsSource.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/Image.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsResponse.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportErrorsConfig.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportMetadata.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsResponse.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/InputConfig.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsResponse.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsResponse.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsResponse.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse/PredictionResult.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse_PredictionResult.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistration.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistryGrpcClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionServiceGrpcClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/ExactPrice.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/PriceRange.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/StockState.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_ExactPrice.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_PriceRange.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_StockState.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductDetail.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductEventDetail.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurchaseTransaction.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsMetadata.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsResponse.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent/EventSource.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventImportSummary.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventInlineSource.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventServiceGrpcClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent_EventSource.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserInfo.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/CatalogServiceGapicClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionApiKeyRegistryClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionServiceClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/UserEventServiceClient.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_client_config.json create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_descriptor_config.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_client_config.json create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_client_config.json create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_client_config.json create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php create mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Catalog.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Catalog.php new file mode 100644 index 0000000000000000000000000000000000000000..fc32aeacdbbb5cc28320e4b203093278a4efc936 GIT binary patch literal 2632 zcmbtWU2hvj6s^~F+FZA(yQQj?J}`tzb)-!4nTW^Ng5}P3#aOV(^RYojd2AIrq%n`|0P&IDz-kA&CgXocL%o zMSM(9!eSnKafn9Q$q8Y|izf*U39}H|@1o=G5ViL^!}rA2G|reuY!t+C5R$qV#+hGd zL~NLl$j6+<5s3mCk^0&8h;Y1J_b|s{99Sv`K!hhGO|VDMVXygGM2Jn;IaF{?OTsz* z1#r$6+f50#3*dz~O;Jn3!ViGNC&@-3^-#(M0}nl;sY@fuDGurP;*@*n1cxaRd#}fy zWRWLXBe|g)d8D?9G^UJwmc&ApJ#;~^CxsFsIh}|T7U9s@C#lD1!eiDGp|%|mekref zQrpbaN;rCgYMP^MUn9APILpXA;608mg7QQ2|aUv-c%yqaQ;wZ>)KwK~ONp)qG@FCphI7q8^#o3iS zDqL|0SezxUkZyGr{xwuYC-5_myOaF(S3wcnTY{jthZ15=Jw^2B*7_Dayr!f1M05=; zuB=kwf~nDb43Dll$mP?7Z2YzY=Jgb&4`uQe3+4%<9#Mu^uG-fzt+oX0Nxb|7GK<1@ znUI_aPs!>n@9j zK{*w#n^RY|LZa-s_J0pJkbnb;ryct)nD`9S5RXFQew*P)T%oD5ZBYkoz+(?baYQ{F zih62CW{g(v%)Hu$6*>`~*XAzoyj;Se9l24ZT5ki)sx0r4PtzpC(>WU%n$%NRiy0NK zPsK@kOjchnuD=ABmC>v~aY7^ILA7qEC;07bhav6)%<5v6p?FHBx{aClp>&4BEKgt? zpAn@;|5GEtFwemIA7fWH9JQAy(f literal 0 HcmV?d00001 diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/CatalogService.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/CatalogService.php new file mode 100644 index 000000000000..5a5a3f68939d --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/CatalogService.php @@ -0,0 +1,70 @@ +internalAddGeneratedFile( + ' + +?google/cloud/recommendationengine/v1beta1/catalog_service.proto)google.cloud.recommendationengine.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto7google/cloud/recommendationengine/v1beta1/catalog.proto6google/cloud/recommendationengine/v1beta1/import.protoNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto" +CreateCatalogItemRequestC +parent ( B3AA- ++recommendationengine.googleapis.com/CatalogQ + catalog_item ( 26.google.cloud.recommendationengine.v1beta1.CatalogItemBA"b +GetCatalogItemRequestI +name ( B;AA5 +3recommendationengine.googleapis.com/CatalogItemPath" +ListCatalogItemsRequestC +parent ( B3AA- ++recommendationengine.googleapis.com/Catalog + page_size (BA + +page_token ( BA +filter ( BA" +ListCatalogItemsResponseM + catalog_items ( 26.google.cloud.recommendationengine.v1beta1.CatalogItem +next_page_token ( " +UpdateCatalogItemRequestI +name ( B;AA5 +3recommendationengine.googleapis.com/CatalogItemPathQ + catalog_item ( 26.google.cloud.recommendationengine.v1beta1.CatalogItemBA/ + update_mask ( 2.google.protobuf.FieldMask"e +DeleteCatalogItemRequestI +name ( B;AA5 +3recommendationengine.googleapis.com/CatalogItemPath2 +CatalogService +CreateCatalogItemC.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"lP"@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems: catalog_itemAparent,catalog_item +GetCatalogItem@.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"PCA/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}Aname +ListCatalogItemsB.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequestC.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse"XB@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItemsA parent,filter +UpdateCatalogItemC.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"wQ2A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}: catalog_itemAname,catalog_item,update_mask +DeleteCatalogItemC.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.google.protobuf.Empty"PC*A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}Aname +ImportCatalogItemsD.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.google.longrunning.Operation"L"G/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import:*A +Dgoogle.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse8google.cloud.recommendationengine.v1beta1.ImportMetadataA,parent,request_id,input_config,errors_configWA#recommendationengine.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +-com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Common.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Common.php new file mode 100644 index 000000000000..9f36cbaebada --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Common.php @@ -0,0 +1,42 @@ +internalAddGeneratedFile( + ' + +6google/cloud/recommendationengine/v1beta1/common.proto)google.cloud.recommendationengine.v1beta1" + +FeatureMapl +categorical_features ( 2N.google.cloud.recommendationengine.v1beta1.FeatureMap.CategoricalFeaturesEntryh +numerical_features ( 2L.google.cloud.recommendationengine.v1beta1.FeatureMap.NumericalFeaturesEntry + +StringList +value (  + FloatList +value (| +CategoricalFeaturesEntry +key ( O +value ( 2@.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList:8y +NumericalFeaturesEntry +key ( N +value ( 2?.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList:8B +-com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Import.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Import.php new file mode 100644 index 0000000000000000000000000000000000000000..7c0befb90aadb59abcc28ea41c8758c2339ecbdc GIT binary patch literal 3668 zcmds4-EQMV6yBt4MNeoiyxVQI2r-08n`*ZX?V=)Fx{&m5gG5`>fCMtKTxa4Aa%?kW zS1hP+0z%>jw2y*#2(EbmF1TX;?4+%ib$|=By{h6l-#K&6_nkTCz4zm@7~Vt&IK5!Y#~32`~bJS zAW8=>Yt-_X^PLPuDvFZ41B)T*gpWqQbX;_+Ol!2E;=w;r>0eLYPBBk`Ol_-|#zbqoErx z%uTPK9j2itVn)K?DD-f16)8+{b|sE@PPS1N-?2y&Pm$dX6HG%luy--@D2bDZ9`mD? z<>MqzuK1<7s@)1WGDJ-kqh(zSavLQy#gpC?Q^v@b9M->+=K6K!{$Gesj;f;Oet@( zNZzKF_wrrs!i@><1ByaQ?91z%4D3 zZW!>ssn7RdUgyLi2_7kv+Qz1-yp^bonZa^%;i}T`VKLXvC1;0F8|N`|_4X95a#-c) zT`*LC-lH_4Y$pnb#5ZmO_#Sg&iihNDo`Onq?(vPzJk$nUC?u3`N8_g|+*P&{;jca9hi+>%8RYcI}dpV|7@?p{i0Ip_&G6|$=|1z1{9^B3eO>fdR4?B!!|yKS5%EW z8E}1uf0{1kT~T6nU0Ge@GnmIR2ad*kNn&nKk=yH;R7w813QOu+p8Y&e`&aU`Df9Fe z6iZoAD$kSbttb3R!!Jszo>rkYQ5wU6#avucbdKs!N1=b=l2lw$p}$l{EEPh&naYWP{1+P{Hsd|!d(qK3laC}h}J)dF=Gf2sqVH9sQ@ zn0Iwky~#%Zs+Lt<|DBc_e^j7;UB>^D=y?BHAac@nSUMWH^oeeY?JPgfpAgJ3PLYa`esD^ zmXAY8)z-K-me_T+ik_h#t2cXlJMHe%>gs`9b4)qon!QVF&YoPFOugp(lAX2nPIP4{ zQm1Xc70Dgz_v!-$ZCMiAvWmbhOCLX-m3Mo1FCQ2msO4i~R}qs8@e1}7c~Wf?7jOaa E7trM5umAu6 literal 0 HcmV?d00001 diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionApikeyRegistryService.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionApikeyRegistryService.php new file mode 100644 index 000000000000..68c28d18d427 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionApikeyRegistryService.php @@ -0,0 +1,55 @@ +internalAddGeneratedFile( + ' + +Rgoogle/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto)google.cloud.recommendationengine.v1beta1google/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/empty.protogoogle/api/client.protoNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto"/ +PredictionApiKeyRegistration +api_key ( " +)CreatePredictionApiKeyRegistrationRequestF +parent ( B6AA0 +.recommendationengine.googleapis.com/EventStoreu +prediction_api_key_registration ( 2G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationBA" +(ListPredictionApiKeyRegistrationsRequestF +parent ( B6AA0 +.recommendationengine.googleapis.com/EventStore + page_size (BA + +page_token ( BA" +)ListPredictionApiKeyRegistrationsResponseq + prediction_api_key_registrations ( 2G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration +next_page_token ( " +)DeletePredictionApiKeyRegistrationRequestV +name ( BHAAB +@recommendationengine.googleapis.com/PredictionApiKeyRegistration2 +PredictionApiKeyRegistry +"CreatePredictionApiKeyRegistrationT.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequestG.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration"d"_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations:*A&parent,prediction_api_key_registration +!ListPredictionApiKeyRegistrationsS.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequestT.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse"pa_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrationsAparent +"DeletePredictionApiKeyRegistrationT.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest.google.protobuf.Empty"na*_/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}AnameWA#recommendationengine.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +-com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionService.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionService.php new file mode 100644 index 000000000000..f33b7e334437 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionService.php @@ -0,0 +1,70 @@ +internalAddGeneratedFile( + ' + +Bgoogle/cloud/recommendationengine/v1beta1/prediction_service.proto)google.cloud.recommendationengine.v1beta1google/api/field_behavior.protogoogle/api/resource.proto:google/cloud/recommendationengine/v1beta1/user_event.protogoogle/protobuf/struct.protogoogle/api/client.proto" +PredictRequestC +name ( B5AA/ +-recommendationengine.googleapis.com/PlacementM + +user_event ( 24.google.cloud.recommendationengine.v1beta1.UserEventBA + page_size (BA + +page_token ( BA +filter ( BA +dry_run (BAZ +params ( 2E.google.cloud.recommendationengine.v1beta1.PredictRequest.ParamsEntryBAZ +labels ( 2E.google.cloud.recommendationengine.v1beta1.PredictRequest.LabelsEntryBAE + ParamsEntry +key ( % +value ( 2.google.protobuf.Value:8- + LabelsEntry +key (  +value ( :8" +PredictResponse\\ +results ( 2K.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult +recommendation_token (  +items_missing_in_catalog (  +dry_run (Z +metadata ( 2H.google.cloud.recommendationengine.v1beta1.PredictResponse.MetadataEntry +next_page_token (  +PredictionResult + +id ( t + item_metadata ( 2].google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.ItemMetadataEntryK +ItemMetadataEntry +key ( % +value ( 2.google.protobuf.Value:8G + MetadataEntry +key ( % +value ( 2.google.protobuf.Value:82 +PredictionService +Predict9.google.cloud.recommendationengine.v1beta1.PredictRequest:.google.cloud.recommendationengine.v1beta1.PredictResponse"qY"T/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict:*Aname,user_eventWA#recommendationengine.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +-com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/RecommendationengineResources.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/RecommendationengineResources.php new file mode 100644 index 000000000000..e09b270728dd --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/RecommendationengineResources.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' + +Ngoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto)google.cloud.recommendationengine.v1beta1B +-com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1Ai ++recommendationengine.googleapis.com/Catalog:projects/{project}/locations/{location}/catalogs/{catalog}A +3recommendationengine.googleapis.com/CatalogItemPath[projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}A +.recommendationengine.googleapis.com/EventStoreTprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}A +@recommendationengine.googleapis.com/PredictionApiKeyRegistrationprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}A +-recommendationengine.googleapis.com/Placementkprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/UserEvent.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/UserEvent.php new file mode 100644 index 0000000000000000000000000000000000000000..4c57575464d3ce7000998b3c07dbe2b31469ac5d GIT binary patch literal 3433 zcmb_f-EJF26vmsTNybSNZG$iYsnbxYiPWxDSCnc?3Xbih7ESCXPKChLGTxmyqi%M$ zv$LiK^@0cBh8IBMl1JewxZjgBBx+*OrwAZ7DqJdvWOOYcREy%JH;%e+@n1j2}d1+P(+Stnh>Aj?dIkVD1jYm zZ!5%hMIyHM&OmHGy|XD1A0Xt1Bu()FAlD=?`VnFHOR`SLe4Gk!!^byR>amCkMnd)j zgt~zbNtjZwKCOG0MZR<$OM^z_)3tT1F{SQ}BnE0W@W92UWDA&T*CRoBM8bBJraoth zh}WHDJM6u;29l19b-;K#-j(yZwc^f_^W*ef#rm? zw-^nBO?pInEat8|ifROMmg)K2w=0mUFz&uvOemf>x;W&J{}zKn6682J+g9c6_Csc} zR1Sh+QnsMF*M>AoQg5Q4mXZ7a%i3PowvK8E=d6}+OiQeMcJX6;&9`oym3tEyDpHNz zHDjk55GuDQ2Fz)N)n6{5xnVomA0VU}))W1N7IHYZHn%zTXW6p9LUXE}S#%f|Ecl); z-E}S;wkJE1yY=lLQawEjm%;2x>C1uH`4yv>Q@%Lr|Gt{S z3Viizlpp(Me~b#Xr?uUdx8FF}tJJ)M-Th{*Qs1iAs!Q+L2wg58v>H2)mvZ(3nyXbB zJ3BQ{Te9pWG{0GHRUUZ<&Bu*$b!lq#=Ny_Hq)gUCkEIMooX3Lknpj3Nx+Vfu5vo#h zQk^9p2?9>jRHb$#Q0k-$gS#LTV+0so4H&eI@RXd>7a26SqIgzE`ghKRs#6XgPi35q ze974#qIpi?0^@MyNRcGkz=J4(Grb<8-^&PO^%~Jf=n8$AP!1W51jwYnQv>03w0yFc zJrO^r(YWU=v_$1KtuqarZPUAAjMmhz?i2yB+=2nwvc_g3hiYypHjm8BMsNn!p1y+v|cJJMdcq^&c_V6yUVJ{RECMy`{TK)08jW zpWp}+kV)Vonh9AdDc5vDa5FyP>Vs@8lOFER^D8<^Gz zMU(xHg|0SF3++W@jaPe4ddOw6GpZ`clIE8E3{4C25=fVYlP}fZ&LyWMv1*avedV2m z_v2Kgz|y;buSl#h_!YF^XV5c|-}n4Dprf|2R&F6Q^2W}ispoW1a|>v?N5TOSu5~{r zwMXFRX|Miep@laK;so86eaf|yZ3~qSyCw;}gfpM2F{3h)lZF9HlaTa{Oimgj>!5rJ z>+W+;Zee%`)Kw>Mk2vPU(q?OKVL&O>A_`3Iw6GyHVQM~ zn^D+Diwyd2e3ZJ)!e(|bo=DvAmuJvvllBny%yjz5c4HH1bMJ*x; zOE2&McyMxj>es<<*7RPjQm+4Qt#7Nn-%-1#vv*?euc?=WWA^?(2D)wYNOinternalAddGeneratedFile( + ' + +Bgoogle/cloud/recommendationengine/v1beta1/user_event_service.proto)google.cloud.recommendationengine.v1beta1google/api/field_behavior.protogoogle/api/httpbody.protogoogle/api/resource.proto6google/cloud/recommendationengine/v1beta1/import.proto:google/cloud/recommendationengine/v1beta1/user_event.proto#google/longrunning/operations.protogoogle/protobuf/timestamp.protogoogle/api/client.proto" +PurgeUserEventsRequestF +parent ( B6AA0 +.recommendationengine.googleapis.com/EventStore +filter ( BA +force (BA"b +PurgeUserEventsMetadata +operation_name ( / + create_time ( 2.google.protobuf.Timestamp" +PurgeUserEventsResponse +purged_events_count (P +user_events_sample ( 24.google.cloud.recommendationengine.v1beta1.UserEvent" +WriteUserEventRequestF +parent ( B6AA0 +.recommendationengine.googleapis.com/EventStoreM + +user_event ( 24.google.cloud.recommendationengine.v1beta1.UserEventBA" +CollectUserEventRequestF +parent ( B6AA0 +.recommendationengine.googleapis.com/EventStore + +user_event ( BA +uri ( BA +ets (BA" +ListUserEventsRequestF +parent ( B6AA0 +.recommendationengine.googleapis.com/EventStore + page_size (BA + +page_token ( BA +filter ( BA"| +ListUserEventsResponseI + user_events ( 24.google.cloud.recommendationengine.v1beta1.UserEvent +next_page_token ( 2 +UserEventService +WriteUserEvent@.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest4.google.cloud.recommendationengine.v1beta1.UserEvent"z`"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write: +user_eventAparent,user_event +CollectUserEventB.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.google.api.HttpBody"xVT/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collectAparent,user_event,uri,ets +ListUserEvents@.google.cloud.recommendationengine.v1beta1.ListUserEventsRequestA.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse"dNL/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEventsA parent,filter +PurgeUserEventsA.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.google.longrunning.Operation"W"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:purge:*A +Agoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsResponseAgoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadataAparent,filter,force +ImportUserEventsB.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.google.longrunning.Operation"X"S/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:import:*A~ +Bgoogle.cloud.recommendationengine.v1beta1.ImportUserEventsResponse8google.cloud.recommendationengine.v1beta1.ImportMetadataA,parent,request_id,input_config,errors_configWA#recommendationengine.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +-com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogInlineSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogInlineSource.php new file mode 100644 index 000000000000..f2ad496f059b --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogInlineSource.php @@ -0,0 +1,71 @@ +google.cloud.recommendationengine.v1beta1.CatalogInlineSource + */ +class CatalogInlineSource extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of catalog items to update/create. Recommended max of 10k + * items. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $catalog_items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem>|\Google\Protobuf\Internal\RepeatedField $catalog_items + * Optional. A list of catalog items to update/create. Recommended max of 10k + * items. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of catalog items to update/create. Recommended max of 10k + * items. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCatalogItems() + { + return $this->catalog_items; + } + + /** + * Optional. A list of catalog items to update/create. Recommended max of 10k + * items. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCatalogItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem::class); + $this->catalog_items = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem.php new file mode 100644 index 000000000000..6e86c77983ac --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem.php @@ -0,0 +1,473 @@ +google.cloud.recommendationengine.v1beta1.CatalogItem + */ +class CatalogItem extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Catalog item identifier. UTF-8 encoded string with a length limit + * of 128 bytes. + * This id must be unique among all catalog items within the same catalog. It + * should also be used when logging user events in order for the user events + * to be joined with the Catalog. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $id = ''; + /** + * Required. Catalog item categories. This field is repeated for supporting + * one catalog item belonging to several parallel category hierarchies. + * For example, if a shoes product belongs to both + * ["Shoes & Accessories" -> "Shoes"] and + * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + * represented as: + * "categoryHierarchies": [ + * { "categories": ["Shoes & Accessories", "Shoes"]}, + * { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } + * ] + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $category_hierarchies; + /** + * Required. Catalog item title. UTF-8 encoded string with a length limit of 1 + * KiB. + * + * Generated from protobuf field string title = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $title = ''; + /** + * Optional. Catalog item description. UTF-8 encoded string with a length + * limit of 5 KiB. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Highly encouraged. Extra catalog item attributes to be + * included in the recommendation model. For example, for retail products, + * this could include the store name, vendor, style, color, etc. These are + * very strong signals for recommendation model, thus we highly recommend + * providing the item attributes here. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $item_attributes = null; + /** + * Optional. Language of the title/description/item_attributes. Use language + * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our + * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', + * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact + * your Google account manager. + * + * Generated from protobuf field string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $language_code = ''; + /** + * Optional. Filtering tags associated with the catalog item. Each tag should + * be a UTF-8 encoded string with a length limit of 1 KiB. + * This tag can be used for filtering recommendation results by passing the + * tag as part of the predict request filter. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + /** + * Optional. Variant group identifier for prediction results. UTF-8 encoded + * string with a length limit of 128 bytes. + * This field must be enabled before it can be used. [Learn + * more](/recommendations-ai/docs/catalog#item-group-id). + * + * Generated from protobuf field string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $item_group_id = ''; + protected $recommendation_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Required. Catalog item identifier. UTF-8 encoded string with a length limit + * of 128 bytes. + * This id must be unique among all catalog items within the same catalog. It + * should also be used when logging user events in order for the user events + * to be joined with the Catalog. + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy>|\Google\Protobuf\Internal\RepeatedField $category_hierarchies + * Required. Catalog item categories. This field is repeated for supporting + * one catalog item belonging to several parallel category hierarchies. + * For example, if a shoes product belongs to both + * ["Shoes & Accessories" -> "Shoes"] and + * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + * represented as: + * "categoryHierarchies": [ + * { "categories": ["Shoes & Accessories", "Shoes"]}, + * { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } + * ] + * @type string $title + * Required. Catalog item title. UTF-8 encoded string with a length limit of 1 + * KiB. + * @type string $description + * Optional. Catalog item description. UTF-8 encoded string with a length + * limit of 5 KiB. + * @type \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $item_attributes + * Optional. Highly encouraged. Extra catalog item attributes to be + * included in the recommendation model. For example, for retail products, + * this could include the store name, vendor, style, color, etc. These are + * very strong signals for recommendation model, thus we highly recommend + * providing the item attributes here. + * @type string $language_code + * Optional. Language of the title/description/item_attributes. Use language + * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our + * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', + * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact + * your Google account manager. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Optional. Filtering tags associated with the catalog item. Each tag should + * be a UTF-8 encoded string with a length limit of 1 KiB. + * This tag can be used for filtering recommendation results by passing the + * tag as part of the predict request filter. + * @type string $item_group_id + * Optional. Variant group identifier for prediction results. UTF-8 encoded + * string with a length limit of 128 bytes. + * This field must be enabled before it can be used. [Learn + * more](/recommendations-ai/docs/catalog#item-group-id). + * @type \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem $product_metadata + * Optional. Metadata specific to retail products. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. Catalog item identifier. UTF-8 encoded string with a length limit + * of 128 bytes. + * This id must be unique among all catalog items within the same catalog. It + * should also be used when logging user events in order for the user events + * to be joined with the Catalog. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. Catalog item identifier. UTF-8 encoded string with a length limit + * of 128 bytes. + * This id must be unique among all catalog items within the same catalog. It + * should also be used when logging user events in order for the user events + * to be joined with the Catalog. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Required. Catalog item categories. This field is repeated for supporting + * one catalog item belonging to several parallel category hierarchies. + * For example, if a shoes product belongs to both + * ["Shoes & Accessories" -> "Shoes"] and + * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + * represented as: + * "categoryHierarchies": [ + * { "categories": ["Shoes & Accessories", "Shoes"]}, + * { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } + * ] + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCategoryHierarchies() + { + return $this->category_hierarchies; + } + + /** + * Required. Catalog item categories. This field is repeated for supporting + * one catalog item belonging to several parallel category hierarchies. + * For example, if a shoes product belongs to both + * ["Shoes & Accessories" -> "Shoes"] and + * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be + * represented as: + * "categoryHierarchies": [ + * { "categories": ["Shoes & Accessories", "Shoes"]}, + * { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } + * ] + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCategoryHierarchies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy::class); + $this->category_hierarchies = $arr; + + return $this; + } + + /** + * Required. Catalog item title. UTF-8 encoded string with a length limit of 1 + * KiB. + * + * Generated from protobuf field string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Required. Catalog item title. UTF-8 encoded string with a length limit of 1 + * KiB. + * + * Generated from protobuf field string title = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + + /** + * Optional. Catalog item description. UTF-8 encoded string with a length + * limit of 5 KiB. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Catalog item description. UTF-8 encoded string with a length + * limit of 5 KiB. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Highly encouraged. Extra catalog item attributes to be + * included in the recommendation model. For example, for retail products, + * this could include the store name, vendor, style, color, etc. These are + * very strong signals for recommendation model, thus we highly recommend + * providing the item attributes here. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap|null + */ + public function getItemAttributes() + { + return $this->item_attributes; + } + + public function hasItemAttributes() + { + return isset($this->item_attributes); + } + + public function clearItemAttributes() + { + unset($this->item_attributes); + } + + /** + * Optional. Highly encouraged. Extra catalog item attributes to be + * included in the recommendation model. For example, for retail products, + * this could include the store name, vendor, style, color, etc. These are + * very strong signals for recommendation model, thus we highly recommend + * providing the item attributes here. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $var + * @return $this + */ + public function setItemAttributes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap::class); + $this->item_attributes = $var; + + return $this; + } + + /** + * Optional. Language of the title/description/item_attributes. Use language + * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our + * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', + * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact + * your Google account manager. + * + * Generated from protobuf field string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Optional. Language of the title/description/item_attributes. Use language + * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our + * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', + * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact + * your Google account manager. + * + * Generated from protobuf field string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. Filtering tags associated with the catalog item. Each tag should + * be a UTF-8 encoded string with a length limit of 1 KiB. + * This tag can be used for filtering recommendation results by passing the + * tag as part of the predict request filter. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Filtering tags associated with the catalog item. Each tag should + * be a UTF-8 encoded string with a length limit of 1 KiB. + * This tag can be used for filtering recommendation results by passing the + * tag as part of the predict request filter. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * Optional. Variant group identifier for prediction results. UTF-8 encoded + * string with a length limit of 128 bytes. + * This field must be enabled before it can be used. [Learn + * more](/recommendations-ai/docs/catalog#item-group-id). + * + * Generated from protobuf field string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getItemGroupId() + { + return $this->item_group_id; + } + + /** + * Optional. Variant group identifier for prediction results. UTF-8 encoded + * string with a length limit of 128 bytes. + * This field must be enabled before it can be used. [Learn + * more](/recommendations-ai/docs/catalog#item-group-id). + * + * Generated from protobuf field string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setItemGroupId($var) + { + GPBUtil::checkString($var, True); + $this->item_group_id = $var; + + return $this; + } + + /** + * Optional. Metadata specific to retail products. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem|null + */ + public function getProductMetadata() + { + return $this->readOneof(10); + } + + public function hasProductMetadata() + { + return $this->hasOneof(10); + } + + /** + * Optional. Metadata specific to retail products. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem $var + * @return $this + */ + public function setProductMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * @return string + */ + public function getRecommendationType() + { + return $this->whichOneof("recommendation_type"); + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem/CategoryHierarchy.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem/CategoryHierarchy.php new file mode 100644 index 000000000000..560a234a76f5 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem/CategoryHierarchy.php @@ -0,0 +1,82 @@ +google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy + */ +class CategoryHierarchy extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Catalog item categories. Each category should be a UTF-8 + * encoded string with a length limit of 2 KiB. + * Note that the order in the list denotes the specificity (from least to + * most specific). + * + * Generated from protobuf field repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $categories; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $categories + * Required. Catalog item categories. Each category should be a UTF-8 + * encoded string with a length limit of 2 KiB. + * Note that the order in the list denotes the specificity (from least to + * most specific). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. Catalog item categories. Each category should be a UTF-8 + * encoded string with a length limit of 2 KiB. + * Note that the order in the list denotes the specificity (from least to + * most specific). + * + * Generated from protobuf field repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCategories() + { + return $this->categories; + } + + /** + * Required. Catalog item categories. Each category should be a UTF-8 + * encoded string with a length limit of 2 KiB. + * Note that the order in the list denotes the specificity (from least to + * most specific). + * + * Generated from protobuf field repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->categories = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CategoryHierarchy::class, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem_CategoryHierarchy::class); + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem_CategoryHierarchy.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem_CategoryHierarchy.php new file mode 100644 index 000000000000..e079386dd9eb --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem_CategoryHierarchy.php @@ -0,0 +1,16 @@ +_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/CreateCatalogItem', + $argument, + ['\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', 'decode'], + $metadata, $options); + } + + /** + * Gets a specific catalog item. + * @param \Google\Cloud\RecommendationEngine\V1beta1\GetCatalogItemRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetCatalogItem(\Google\Cloud\RecommendationEngine\V1beta1\GetCatalogItemRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/GetCatalogItem', + $argument, + ['\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', 'decode'], + $metadata, $options); + } + + /** + * Gets a list of catalog items. + * @param \Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListCatalogItems(\Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/ListCatalogItems', + $argument, + ['\Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsResponse', 'decode'], + $metadata, $options); + } + + /** + * Updates a catalog item. Partial updating is supported. Non-existing + * items will be created. + * @param \Google\Cloud\RecommendationEngine\V1beta1\UpdateCatalogItemRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateCatalogItem(\Google\Cloud\RecommendationEngine\V1beta1\UpdateCatalogItemRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/UpdateCatalogItem', + $argument, + ['\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', 'decode'], + $metadata, $options); + } + + /** + * Deletes a catalog item. + * @param \Google\Cloud\RecommendationEngine\V1beta1\DeleteCatalogItemRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteCatalogItem(\Google\Cloud\RecommendationEngine\V1beta1\DeleteCatalogItemRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/DeleteCatalogItem', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Bulk import of multiple catalog items. Request processing may be + * synchronous. No partial updating supported. Non-existing items will be + * created. + * + * Operation.response is of type ImportResponse. Note that it is + * possible for a subset of the items to be successfully updated. + * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportCatalogItemsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ImportCatalogItems(\Google\Cloud\RecommendationEngine\V1beta1\ImportCatalogItemsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/ImportCatalogItems', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php new file mode 100644 index 000000000000..81d1b23439fd --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php @@ -0,0 +1,193 @@ +google.cloud.recommendationengine.v1beta1.CollectUserEventRequest + */ +class CollectUserEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent eventStore name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. URL encoded UserEvent proto. + * + * Generated from protobuf field string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_event = ''; + /** + * Optional. The url including cgi-parameters but excluding the hash fragment. + * The URL must be truncated to 1.5K bytes to conservatively be under the 2K + * bytes. This is often more useful than the referer url, because many + * browsers only send the domain for 3rd party requests. + * + * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $uri = ''; + /** + * Optional. The event timestamp in milliseconds. This prevents browser + * caching of otherwise identical get requests. The name is abbreviated to + * reduce the payload bytes. + * + * Generated from protobuf field int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ets = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent eventStore name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * @type string $user_event + * Required. URL encoded UserEvent proto. + * @type string $uri + * Optional. The url including cgi-parameters but excluding the hash fragment. + * The URL must be truncated to 1.5K bytes to conservatively be under the 2K + * bytes. This is often more useful than the referer url, because many + * browsers only send the domain for 3rd party requests. + * @type int|string $ets + * Optional. The event timestamp in milliseconds. This prevents browser + * caching of otherwise identical get requests. The name is abbreviated to + * reduce the payload bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent eventStore name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent eventStore name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. URL encoded UserEvent proto. + * + * Generated from protobuf field string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUserEvent() + { + return $this->user_event; + } + + /** + * Required. URL encoded UserEvent proto. + * + * Generated from protobuf field string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUserEvent($var) + { + GPBUtil::checkString($var, True); + $this->user_event = $var; + + return $this; + } + + /** + * Optional. The url including cgi-parameters but excluding the hash fragment. + * The URL must be truncated to 1.5K bytes to conservatively be under the 2K + * bytes. This is often more useful than the referer url, because many + * browsers only send the domain for 3rd party requests. + * + * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Optional. The url including cgi-parameters but excluding the hash fragment. + * The URL must be truncated to 1.5K bytes to conservatively be under the 2K + * bytes. This is often more useful than the referer url, because many + * browsers only send the domain for 3rd party requests. + * + * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Optional. The event timestamp in milliseconds. This prevents browser + * caching of otherwise identical get requests. The name is abbreviated to + * reduce the payload bytes. + * + * Generated from protobuf field int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getEts() + { + return $this->ets; + } + + /** + * Optional. The event timestamp in milliseconds. This prevents browser + * caching of otherwise identical get requests. The name is abbreviated to + * reduce the payload bytes. + * + * Generated from protobuf field int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setEts($var) + { + GPBUtil::checkInt64($var); + $this->ets = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php new file mode 100644 index 000000000000..3090166caf60 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php @@ -0,0 +1,115 @@ +google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest + */ +class CreateCatalogItemRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The catalog item to create. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog_item = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @type \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalog_item + * Required. The catalog item to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The catalog item to create. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem|null + */ + public function getCatalogItem() + { + return $this->catalog_item; + } + + public function hasCatalogItem() + { + return isset($this->catalog_item); + } + + public function clearCatalogItem() + { + unset($this->catalog_item); + } + + /** + * Required. The catalog item to create. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $var + * @return $this + */ + public function setCatalogItem($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem::class); + $this->catalog_item = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php new file mode 100644 index 000000000000..bab271dd773d --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php @@ -0,0 +1,115 @@ +google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest + */ +class CreatePredictionApiKeyRegistrationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The prediction API key registration. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $prediction_api_key_registration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * @type \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration $prediction_api_key_registration + * Required. The prediction API key registration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The prediction API key registration. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration|null + */ + public function getPredictionApiKeyRegistration() + { + return $this->prediction_api_key_registration; + } + + public function hasPredictionApiKeyRegistration() + { + return isset($this->prediction_api_key_registration); + } + + public function clearPredictionApiKeyRegistration() + { + unset($this->prediction_api_key_registration); + } + + /** + * Required. The prediction API key registration. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration $var + * @return $this + */ + public function setPredictionApiKeyRegistration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration::class); + $this->prediction_api_key_registration = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php new file mode 100644 index 000000000000..0cad6e0d9b42 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php @@ -0,0 +1,71 @@ +google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest + */ +class DeleteCatalogItemRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php new file mode 100644 index 000000000000..79e2b3e61c1c --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php @@ -0,0 +1,71 @@ +google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest + */ +class DeletePredictionApiKeyRegistrationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The API key to unregister including full resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The API key to unregister including full resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The API key to unregister including full resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The API key to unregister including full resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/EventDetail.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/EventDetail.php new file mode 100644 index 000000000000..25740f69bf0a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/EventDetail.php @@ -0,0 +1,359 @@ +google.cloud.recommendationengine.v1beta1.EventDetail + */ +class EventDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Complete url (window.location.href) of the user's current page. + * When using the JavaScript pixel, this value is filled in automatically. + * Maximum length 5KB. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $uri = ''; + /** + * Optional. The referrer url of the current page. When using + * the JavaScript pixel, this value is filled in automatically. + * + * Generated from protobuf field string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $referrer_uri = ''; + /** + * Optional. A unique id of a web page view. + * This should be kept the same for all user events triggered from the same + * pageview. For example, an item detail page view could trigger multiple + * events as the user is browsing the page. + * The `pageViewId` property should be kept the same for all these events so + * that they can be grouped together properly. This `pageViewId` will be + * automatically generated if using the JavaScript pixel. + * + * Generated from protobuf field string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_view_id = ''; + /** + * Optional. A list of identifiers for the independent experiment groups + * this user event belongs to. This is used to distinguish between user events + * associated with different experiment setups (e.g. using Recommendation + * Engine system, using different recommendation models). + * + * Generated from protobuf field repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $experiment_ids; + /** + * Optional. Recommendation token included in the recommendation prediction + * response. + * This field enables accurate attribution of recommendation model + * performance. + * This token enables us to accurately attribute page view or purchase back to + * the event and the particular predict response containing this + * clicked/purchased item. If user clicks on product K in the recommendation + * results, pass the `PredictResponse.recommendationToken` property as a url + * parameter to product K's page. When recording events on product K's page, + * log the PredictResponse.recommendation_token to this field. + * Optional, but highly encouraged for user events that are the result of a + * recommendation prediction query. + * + * Generated from protobuf field string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $recommendation_token = ''; + /** + * Optional. Extra user event features to include in the recommendation + * model. + * For product recommendation, an example of extra user information is + * traffic_channel, i.e. how user arrives at the site. Users can arrive + * at the site by coming to the site directly, or coming through Google + * search, and etc. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $event_attributes = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Optional. Complete url (window.location.href) of the user's current page. + * When using the JavaScript pixel, this value is filled in automatically. + * Maximum length 5KB. + * @type string $referrer_uri + * Optional. The referrer url of the current page. When using + * the JavaScript pixel, this value is filled in automatically. + * @type string $page_view_id + * Optional. A unique id of a web page view. + * This should be kept the same for all user events triggered from the same + * pageview. For example, an item detail page view could trigger multiple + * events as the user is browsing the page. + * The `pageViewId` property should be kept the same for all these events so + * that they can be grouped together properly. This `pageViewId` will be + * automatically generated if using the JavaScript pixel. + * @type array|\Google\Protobuf\Internal\RepeatedField $experiment_ids + * Optional. A list of identifiers for the independent experiment groups + * this user event belongs to. This is used to distinguish between user events + * associated with different experiment setups (e.g. using Recommendation + * Engine system, using different recommendation models). + * @type string $recommendation_token + * Optional. Recommendation token included in the recommendation prediction + * response. + * This field enables accurate attribution of recommendation model + * performance. + * This token enables us to accurately attribute page view or purchase back to + * the event and the particular predict response containing this + * clicked/purchased item. If user clicks on product K in the recommendation + * results, pass the `PredictResponse.recommendationToken` property as a url + * parameter to product K's page. When recording events on product K's page, + * log the PredictResponse.recommendation_token to this field. + * Optional, but highly encouraged for user events that are the result of a + * recommendation prediction query. + * @type \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $event_attributes + * Optional. Extra user event features to include in the recommendation + * model. + * For product recommendation, an example of extra user information is + * traffic_channel, i.e. how user arrives at the site. Users can arrive + * at the site by coming to the site directly, or coming through Google + * search, and etc. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Complete url (window.location.href) of the user's current page. + * When using the JavaScript pixel, this value is filled in automatically. + * Maximum length 5KB. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Optional. Complete url (window.location.href) of the user's current page. + * When using the JavaScript pixel, this value is filled in automatically. + * Maximum length 5KB. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Optional. The referrer url of the current page. When using + * the JavaScript pixel, this value is filled in automatically. + * + * Generated from protobuf field string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReferrerUri() + { + return $this->referrer_uri; + } + + /** + * Optional. The referrer url of the current page. When using + * the JavaScript pixel, this value is filled in automatically. + * + * Generated from protobuf field string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReferrerUri($var) + { + GPBUtil::checkString($var, True); + $this->referrer_uri = $var; + + return $this; + } + + /** + * Optional. A unique id of a web page view. + * This should be kept the same for all user events triggered from the same + * pageview. For example, an item detail page view could trigger multiple + * events as the user is browsing the page. + * The `pageViewId` property should be kept the same for all these events so + * that they can be grouped together properly. This `pageViewId` will be + * automatically generated if using the JavaScript pixel. + * + * Generated from protobuf field string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageViewId() + { + return $this->page_view_id; + } + + /** + * Optional. A unique id of a web page view. + * This should be kept the same for all user events triggered from the same + * pageview. For example, an item detail page view could trigger multiple + * events as the user is browsing the page. + * The `pageViewId` property should be kept the same for all these events so + * that they can be grouped together properly. This `pageViewId` will be + * automatically generated if using the JavaScript pixel. + * + * Generated from protobuf field string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageViewId($var) + { + GPBUtil::checkString($var, True); + $this->page_view_id = $var; + + return $this; + } + + /** + * Optional. A list of identifiers for the independent experiment groups + * this user event belongs to. This is used to distinguish between user events + * associated with different experiment setups (e.g. using Recommendation + * Engine system, using different recommendation models). + * + * Generated from protobuf field repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExperimentIds() + { + return $this->experiment_ids; + } + + /** + * Optional. A list of identifiers for the independent experiment groups + * this user event belongs to. This is used to distinguish between user events + * associated with different experiment setups (e.g. using Recommendation + * Engine system, using different recommendation models). + * + * Generated from protobuf field repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExperimentIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->experiment_ids = $arr; + + return $this; + } + + /** + * Optional. Recommendation token included in the recommendation prediction + * response. + * This field enables accurate attribution of recommendation model + * performance. + * This token enables us to accurately attribute page view or purchase back to + * the event and the particular predict response containing this + * clicked/purchased item. If user clicks on product K in the recommendation + * results, pass the `PredictResponse.recommendationToken` property as a url + * parameter to product K's page. When recording events on product K's page, + * log the PredictResponse.recommendation_token to this field. + * Optional, but highly encouraged for user events that are the result of a + * recommendation prediction query. + * + * Generated from protobuf field string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRecommendationToken() + { + return $this->recommendation_token; + } + + /** + * Optional. Recommendation token included in the recommendation prediction + * response. + * This field enables accurate attribution of recommendation model + * performance. + * This token enables us to accurately attribute page view or purchase back to + * the event and the particular predict response containing this + * clicked/purchased item. If user clicks on product K in the recommendation + * results, pass the `PredictResponse.recommendationToken` property as a url + * parameter to product K's page. When recording events on product K's page, + * log the PredictResponse.recommendation_token to this field. + * Optional, but highly encouraged for user events that are the result of a + * recommendation prediction query. + * + * Generated from protobuf field string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRecommendationToken($var) + { + GPBUtil::checkString($var, True); + $this->recommendation_token = $var; + + return $this; + } + + /** + * Optional. Extra user event features to include in the recommendation + * model. + * For product recommendation, an example of extra user information is + * traffic_channel, i.e. how user arrives at the site. Users can arrive + * at the site by coming to the site directly, or coming through Google + * search, and etc. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap|null + */ + public function getEventAttributes() + { + return $this->event_attributes; + } + + public function hasEventAttributes() + { + return isset($this->event_attributes); + } + + public function clearEventAttributes() + { + unset($this->event_attributes); + } + + /** + * Optional. Extra user event features to include in the recommendation + * model. + * For product recommendation, an example of extra user information is + * traffic_channel, i.e. how user arrives at the site. Users can arrive + * at the site by coming to the site directly, or coming through Google + * search, and etc. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $var + * @return $this + */ + public function setEventAttributes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap::class); + $this->event_attributes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap.php new file mode 100644 index 000000000000..0578372686e8 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap.php @@ -0,0 +1,139 @@ +google.cloud.recommendationengine.v1beta1.FeatureMap + */ +class FeatureMap extends \Google\Protobuf\Internal\Message +{ + /** + * Categorical features that can take on one of a limited number of possible + * values. Some examples would be the brand/maker of a product, or country of + * a customer. + * Feature names and values must be UTF-8 encoded strings. + * For example: `{ "colors": {"value": ["yellow", "green"]}, + * "sizes": {"value":["S", "M"]}` + * + * Generated from protobuf field map categorical_features = 1; + */ + private $categorical_features; + /** + * Numerical features. Some examples would be the height/weight of a product, + * or age of a customer. + * Feature names must be UTF-8 encoded strings. + * For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, + * "heights_cm": {"value":[8.1, 6.4]} }` + * + * Generated from protobuf field map numerical_features = 2; + */ + private $numerical_features; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $categorical_features + * Categorical features that can take on one of a limited number of possible + * values. Some examples would be the brand/maker of a product, or country of + * a customer. + * Feature names and values must be UTF-8 encoded strings. + * For example: `{ "colors": {"value": ["yellow", "green"]}, + * "sizes": {"value":["S", "M"]}` + * @type array|\Google\Protobuf\Internal\MapField $numerical_features + * Numerical features. Some examples would be the height/weight of a product, + * or age of a customer. + * Feature names must be UTF-8 encoded strings. + * For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, + * "heights_cm": {"value":[8.1, 6.4]} }` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Categorical features that can take on one of a limited number of possible + * values. Some examples would be the brand/maker of a product, or country of + * a customer. + * Feature names and values must be UTF-8 encoded strings. + * For example: `{ "colors": {"value": ["yellow", "green"]}, + * "sizes": {"value":["S", "M"]}` + * + * Generated from protobuf field map categorical_features = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getCategoricalFeatures() + { + return $this->categorical_features; + } + + /** + * Categorical features that can take on one of a limited number of possible + * values. Some examples would be the brand/maker of a product, or country of + * a customer. + * Feature names and values must be UTF-8 encoded strings. + * For example: `{ "colors": {"value": ["yellow", "green"]}, + * "sizes": {"value":["S", "M"]}` + * + * Generated from protobuf field map categorical_features = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setCategoricalFeatures($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap\StringList::class); + $this->categorical_features = $arr; + + return $this; + } + + /** + * Numerical features. Some examples would be the height/weight of a product, + * or age of a customer. + * Feature names must be UTF-8 encoded strings. + * For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, + * "heights_cm": {"value":[8.1, 6.4]} }` + * + * Generated from protobuf field map numerical_features = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getNumericalFeatures() + { + return $this->numerical_features; + } + + /** + * Numerical features. Some examples would be the height/weight of a product, + * or age of a customer. + * Feature names must be UTF-8 encoded strings. + * For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, + * "heights_cm": {"value":[8.1, 6.4]} }` + * + * Generated from protobuf field map numerical_features = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setNumericalFeatures($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap\FloatList::class); + $this->numerical_features = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/FloatList.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/FloatList.php new file mode 100644 index 000000000000..a0245cbe9b4a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/FloatList.php @@ -0,0 +1,70 @@ +google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList + */ +class FloatList extends \Google\Protobuf\Internal\Message +{ + /** + * Float feature value. + * + * Generated from protobuf field repeated float value = 1; + */ + private $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $value + * Float feature value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Float feature value. + * + * Generated from protobuf field repeated float value = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValue() + { + return $this->value; + } + + /** + * Float feature value. + * + * Generated from protobuf field repeated float value = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FLOAT); + $this->value = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FloatList::class, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap_FloatList::class); + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/StringList.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/StringList.php new file mode 100644 index 000000000000..20808ae96283 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/StringList.php @@ -0,0 +1,70 @@ +google.cloud.recommendationengine.v1beta1.FeatureMap.StringList + */ +class StringList extends \Google\Protobuf\Internal\Message +{ + /** + * String feature value with a length limit of 128 bytes. + * + * Generated from protobuf field repeated string value = 1; + */ + private $value; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $value + * String feature value with a length limit of 128 bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Common::initOnce(); + parent::__construct($data); + } + + /** + * String feature value with a length limit of 128 bytes. + * + * Generated from protobuf field repeated string value = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValue() + { + return $this->value; + } + + /** + * String feature value with a length limit of 128 bytes. + * + * Generated from protobuf field repeated string value = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->value = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StringList::class, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap_StringList::class); + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_FloatList.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_FloatList.php new file mode 100644 index 000000000000..9e54e7f448b9 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_FloatList.php @@ -0,0 +1,16 @@ +google.cloud.recommendationengine.v1beta1.GcsSource + */ +class GcsSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage URIs to input files. URI can be up to + * 2000 characters long. URIs can match the full object path (for example, + * `gs://bucket/directory/object.json`) or a pattern matching one or more + * files, such as `gs://bucket/directory/*.json`. A request can + * contain at most 100 files, and each file can be up to 2 GB. See + * [Importing catalog information](/recommendations-ai/docs/upload-catalog) + * for the expected file format and setup instructions. + * + * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $input_uris; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $input_uris + * Required. Google Cloud Storage URIs to input files. URI can be up to + * 2000 characters long. URIs can match the full object path (for example, + * `gs://bucket/directory/object.json`) or a pattern matching one or more + * files, such as `gs://bucket/directory/*.json`. A request can + * contain at most 100 files, and each file can be up to 2 GB. See + * [Importing catalog information](/recommendations-ai/docs/upload-catalog) + * for the expected file format and setup instructions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage URIs to input files. URI can be up to + * 2000 characters long. URIs can match the full object path (for example, + * `gs://bucket/directory/object.json`) or a pattern matching one or more + * files, such as `gs://bucket/directory/*.json`. A request can + * contain at most 100 files, and each file can be up to 2 GB. See + * [Importing catalog information](/recommendations-ai/docs/upload-catalog) + * for the expected file format and setup instructions. + * + * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInputUris() + { + return $this->input_uris; + } + + /** + * Required. Google Cloud Storage URIs to input files. URI can be up to + * 2000 characters long. URIs can match the full object path (for example, + * `gs://bucket/directory/object.json`) or a pattern matching one or more + * files, such as `gs://bucket/directory/*.json`. A request can + * contain at most 100 files, and each file can be up to 2 GB. See + * [Importing catalog information](/recommendations-ai/docs/upload-catalog) + * for the expected file format and setup instructions. + * + * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInputUris($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->input_uris = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php new file mode 100644 index 000000000000..d992f00e0769 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php @@ -0,0 +1,71 @@ +google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest + */ +class GetCatalogItemRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/Image.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/Image.php new file mode 100644 index 000000000000..5790795608f8 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/Image.php @@ -0,0 +1,135 @@ +google.cloud.recommendationengine.v1beta1.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * Required. URL of the image with a length limit of 5 KiB. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + /** + * Optional. Height of the image in number of pixels. + * + * Generated from protobuf field int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $height = 0; + /** + * Optional. Width of the image in number of pixels. + * + * Generated from protobuf field int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $width = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. URL of the image with a length limit of 5 KiB. + * @type int $height + * Optional. Height of the image in number of pixels. + * @type int $width + * Optional. Width of the image in number of pixels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. URL of the image with a length limit of 5 KiB. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. URL of the image with a length limit of 5 KiB. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Optional. Height of the image in number of pixels. + * + * Generated from protobuf field int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getHeight() + { + return $this->height; + } + + /** + * Optional. Height of the image in number of pixels. + * + * Generated from protobuf field int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setHeight($var) + { + GPBUtil::checkInt32($var); + $this->height = $var; + + return $this; + } + + /** + * Optional. Width of the image in number of pixels. + * + * Generated from protobuf field int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getWidth() + { + return $this->width; + } + + /** + * Optional. Width of the image in number of pixels. + * + * Generated from protobuf field int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setWidth($var) + { + GPBUtil::checkInt32($var); + $this->width = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php new file mode 100644 index 000000000000..941ab5b83ca0 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php @@ -0,0 +1,201 @@ +google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest + */ +class ImportCatalogItemsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. `projects/1234/locations/global/catalogs/default_catalog` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency and used for request deduplication. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + /** + * Optional. The desired location of errors incurred during the Import. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $errors_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. `projects/1234/locations/global/catalogs/default_catalog` + * @type string $request_id + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency and used for request deduplication. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. + * @type \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $input_config + * Required. The desired input location of the data. + * @type \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errors_config + * Optional. The desired location of errors incurred during the Import. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * Required. `projects/1234/locations/global/catalogs/default_catalog` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. `projects/1234/locations/global/catalogs/default_catalog` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency and used for request deduplication. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency and used for request deduplication. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\InputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Optional. The desired location of errors incurred during the Import. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig|null + */ + public function getErrorsConfig() + { + return $this->errors_config; + } + + public function hasErrorsConfig() + { + return isset($this->errors_config); + } + + public function clearErrorsConfig() + { + unset($this->errors_config); + } + + /** + * Optional. The desired location of errors incurred during the Import. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $var + * @return $this + */ + public function setErrorsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig::class); + $this->errors_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsResponse.php new file mode 100644 index 000000000000..f1d250f54aed --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsResponse.php @@ -0,0 +1,113 @@ +google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse + */ +class ImportCatalogItemsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A sample of errors encountered while processing the request. + * + * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; + */ + private $error_samples; + /** + * Echoes the destination for the complete errors in the request if set. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + protected $errors_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $error_samples + * A sample of errors encountered while processing the request. + * @type \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errors_config + * Echoes the destination for the complete errors in the request if set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * A sample of errors encountered while processing the request. + * + * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrorSamples() + { + return $this->error_samples; + } + + /** + * A sample of errors encountered while processing the request. + * + * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrorSamples($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->error_samples = $arr; + + return $this; + } + + /** + * Echoes the destination for the complete errors in the request if set. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig|null + */ + public function getErrorsConfig() + { + return $this->errors_config; + } + + public function hasErrorsConfig() + { + return isset($this->errors_config); + } + + public function clearErrorsConfig() + { + unset($this->errors_config); + } + + /** + * Echoes the destination for the complete errors in the request if set. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $var + * @return $this + */ + public function setErrorsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig::class); + $this->errors_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportErrorsConfig.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportErrorsConfig.php new file mode 100644 index 000000000000..0a56f1f1b5a6 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportErrorsConfig.php @@ -0,0 +1,84 @@ +google.cloud.recommendationengine.v1beta1.ImportErrorsConfig + */ +class ImportErrorsConfig extends \Google\Protobuf\Internal\Message +{ + protected $destination; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $gcs_prefix + * Google Cloud Storage path for import errors. This must be an empty, + * existing Cloud Storage bucket. Import errors will be written to a file in + * this bucket, one per line, as a JSON-encoded + * `google.rpc.Status` message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * Google Cloud Storage path for import errors. This must be an empty, + * existing Cloud Storage bucket. Import errors will be written to a file in + * this bucket, one per line, as a JSON-encoded + * `google.rpc.Status` message. + * + * Generated from protobuf field string gcs_prefix = 1; + * @return string + */ + public function getGcsPrefix() + { + return $this->readOneof(1); + } + + public function hasGcsPrefix() + { + return $this->hasOneof(1); + } + + /** + * Google Cloud Storage path for import errors. This must be an empty, + * existing Cloud Storage bucket. Import errors will be written to a file in + * this bucket, one per line, as a JSON-encoded + * `google.rpc.Status` message. + * + * Generated from protobuf field string gcs_prefix = 1; + * @param string $var + * @return $this + */ + public function setGcsPrefix($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getDestination() + { + return $this->whichOneof("destination"); + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportMetadata.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportMetadata.php new file mode 100644 index 000000000000..df36e57fb55e --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportMetadata.php @@ -0,0 +1,266 @@ +google.cloud.recommendationengine.v1beta1.ImportMetadata + */ +class ImportMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the operation. + * + * Generated from protobuf field string operation_name = 5; + */ + protected $operation_name = ''; + /** + * Id of the request / operation. This is parroting back the requestId that + * was passed in the request. + * + * Generated from protobuf field string request_id = 3; + */ + protected $request_id = ''; + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + */ + protected $create_time = null; + /** + * Count of entries that were processed successfully. + * + * Generated from protobuf field int64 success_count = 1; + */ + protected $success_count = 0; + /** + * Count of entries that encountered errors while processing. + * + * Generated from protobuf field int64 failure_count = 2; + */ + protected $failure_count = 0; + /** + * Operation last update time. If the operation is done, this is also the + * finish time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation_name + * Name of the operation. + * @type string $request_id + * Id of the request / operation. This is parroting back the requestId that + * was passed in the request. + * @type \Google\Protobuf\Timestamp $create_time + * Operation create time. + * @type int|string $success_count + * Count of entries that were processed successfully. + * @type int|string $failure_count + * Count of entries that encountered errors while processing. + * @type \Google\Protobuf\Timestamp $update_time + * Operation last update time. If the operation is done, this is also the + * finish time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * Name of the operation. + * + * Generated from protobuf field string operation_name = 5; + * @return string + */ + public function getOperationName() + { + return $this->operation_name; + } + + /** + * Name of the operation. + * + * Generated from protobuf field string operation_name = 5; + * @param string $var + * @return $this + */ + public function setOperationName($var) + { + GPBUtil::checkString($var, True); + $this->operation_name = $var; + + return $this; + } + + /** + * Id of the request / operation. This is parroting back the requestId that + * was passed in the request. + * + * Generated from protobuf field string request_id = 3; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Id of the request / operation. This is parroting back the requestId that + * was passed in the request. + * + * Generated from protobuf field string request_id = 3; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Count of entries that were processed successfully. + * + * Generated from protobuf field int64 success_count = 1; + * @return int|string + */ + public function getSuccessCount() + { + return $this->success_count; + } + + /** + * Count of entries that were processed successfully. + * + * Generated from protobuf field int64 success_count = 1; + * @param int|string $var + * @return $this + */ + public function setSuccessCount($var) + { + GPBUtil::checkInt64($var); + $this->success_count = $var; + + return $this; + } + + /** + * Count of entries that encountered errors while processing. + * + * Generated from protobuf field int64 failure_count = 2; + * @return int|string + */ + public function getFailureCount() + { + return $this->failure_count; + } + + /** + * Count of entries that encountered errors while processing. + * + * Generated from protobuf field int64 failure_count = 2; + * @param int|string $var + * @return $this + */ + public function setFailureCount($var) + { + GPBUtil::checkInt64($var); + $this->failure_count = $var; + + return $this; + } + + /** + * Operation last update time. If the operation is done, this is also the + * finish time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Operation last update time. If the operation is done, this is also the + * finish time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php new file mode 100644 index 000000000000..0c555beff807 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php @@ -0,0 +1,213 @@ +google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest + */ +class ImportUserEventsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency for expensive long running operations. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. Note that + * this field must not be set if the desired input config is + * catalog_inline_source. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_config = null; + /** + * Optional. The desired location of errors incurred during the Import. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $errors_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * @type string $request_id + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency for expensive long running operations. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. Note that + * this field must not be set if the desired input config is + * catalog_inline_source. + * @type \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $input_config + * Required. The desired input location of the data. + * @type \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errors_config + * Optional. The desired location of errors incurred during the Import. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * Required. + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency for expensive long running operations. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. Note that + * this field must not be set if the desired input config is + * catalog_inline_source. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency for expensive long running operations. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. Note that + * this field must not be set if the desired input config is + * catalog_inline_source. + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\InputConfig|null + */ + public function getInputConfig() + { + return $this->input_config; + } + + public function hasInputConfig() + { + return isset($this->input_config); + } + + public function clearInputConfig() + { + unset($this->input_config); + } + + /** + * Required. The desired input location of the data. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $var + * @return $this + */ + public function setInputConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\InputConfig::class); + $this->input_config = $var; + + return $this; + } + + /** + * Optional. The desired location of errors incurred during the Import. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig|null + */ + public function getErrorsConfig() + { + return $this->errors_config; + } + + public function hasErrorsConfig() + { + return isset($this->errors_config); + } + + public function clearErrorsConfig() + { + unset($this->errors_config); + } + + /** + * Optional. The desired location of errors incurred during the Import. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $var + * @return $this + */ + public function setErrorsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig::class); + $this->errors_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsResponse.php new file mode 100644 index 000000000000..a2c46b8b0d7d --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsResponse.php @@ -0,0 +1,161 @@ +google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse + */ +class ImportUserEventsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A sample of errors encountered while processing the request. + * + * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; + */ + private $error_samples; + /** + * Echoes the destination for the complete errors if this field was set in + * the request. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + */ + protected $errors_config = null; + /** + * Aggregated statistics of user event import status. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + */ + protected $import_summary = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $error_samples + * A sample of errors encountered while processing the request. + * @type \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errors_config + * Echoes the destination for the complete errors if this field was set in + * the request. + * @type \Google\Cloud\RecommendationEngine\V1beta1\UserEventImportSummary $import_summary + * Aggregated statistics of user event import status. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * A sample of errors encountered while processing the request. + * + * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrorSamples() + { + return $this->error_samples; + } + + /** + * A sample of errors encountered while processing the request. + * + * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrorSamples($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->error_samples = $arr; + + return $this; + } + + /** + * Echoes the destination for the complete errors if this field was set in + * the request. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig|null + */ + public function getErrorsConfig() + { + return $this->errors_config; + } + + public function hasErrorsConfig() + { + return isset($this->errors_config); + } + + public function clearErrorsConfig() + { + unset($this->errors_config); + } + + /** + * Echoes the destination for the complete errors if this field was set in + * the request. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; + * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $var + * @return $this + */ + public function setErrorsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig::class); + $this->errors_config = $var; + + return $this; + } + + /** + * Aggregated statistics of user event import status. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEventImportSummary|null + */ + public function getImportSummary() + { + return $this->import_summary; + } + + public function hasImportSummary() + { + return isset($this->import_summary); + } + + public function clearImportSummary() + { + unset($this->import_summary); + } + + /** + * Aggregated statistics of user event import status. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; + * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEventImportSummary $var + * @return $this + */ + public function setImportSummary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEventImportSummary::class); + $this->import_summary = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/InputConfig.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/InputConfig.php new file mode 100644 index 000000000000..bb1e3c8486ee --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/InputConfig.php @@ -0,0 +1,141 @@ +google.cloud.recommendationengine.v1beta1.InputConfig + */ +class InputConfig extends \Google\Protobuf\Internal\Message +{ + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\RecommendationEngine\V1beta1\CatalogInlineSource $catalog_inline_source + * The Inline source for the input content for Catalog items. + * @type \Google\Cloud\RecommendationEngine\V1beta1\GcsSource $gcs_source + * Google Cloud Storage location for the input content. + * @type \Google\Cloud\RecommendationEngine\V1beta1\UserEventInlineSource $user_event_inline_source + * The Inline source for the input content for UserEvents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * The Inline source for the input content for Catalog items. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogInlineSource|null + */ + public function getCatalogInlineSource() + { + return $this->readOneof(1); + } + + public function hasCatalogInlineSource() + { + return $this->hasOneof(1); + } + + /** + * The Inline source for the input content for Catalog items. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; + * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogInlineSource $var + * @return $this + */ + public function setCatalogInlineSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\CatalogInlineSource::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Google Cloud Storage location for the input content. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + * @return \Google\Cloud\RecommendationEngine\V1beta1\GcsSource|null + */ + public function getGcsSource() + { + return $this->readOneof(2); + } + + public function hasGcsSource() + { + return $this->hasOneof(2); + } + + /** + * Google Cloud Storage location for the input content. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; + * @param \Google\Cloud\RecommendationEngine\V1beta1\GcsSource $var + * @return $this + */ + public function setGcsSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\GcsSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The Inline source for the input content for UserEvents. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEventInlineSource|null + */ + public function getUserEventInlineSource() + { + return $this->readOneof(3); + } + + public function hasUserEventInlineSource() + { + return $this->hasOneof(3); + } + + /** + * The Inline source for the input content for UserEvents. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; + * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEventInlineSource $var + * @return $this + */ + public function setUserEventInlineSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEventInlineSource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php new file mode 100644 index 000000000000..bef80b265889 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php @@ -0,0 +1,177 @@ +google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest + */ +class ListCatalogItemsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of results to return per page. If zero, the + * service will choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The previous ListCatalogItemsResponse.next_page_token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. A filter to apply on the list results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @type int $page_size + * Optional. Maximum number of results to return per page. If zero, the + * service will choose a reasonable default. + * @type string $page_token + * Optional. The previous ListCatalogItemsResponse.next_page_token. + * @type string $filter + * Optional. A filter to apply on the list results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of results to return per page. If zero, the + * service will choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of results to return per page. If zero, the + * service will choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The previous ListCatalogItemsResponse.next_page_token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The previous ListCatalogItemsResponse.next_page_token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. A filter to apply on the list results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. A filter to apply on the list results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsResponse.php new file mode 100644 index 000000000000..5e6fc92950bf --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsResponse.php @@ -0,0 +1,105 @@ +google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse + */ +class ListCatalogItemsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The catalog items. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + */ + private $catalog_items; + /** + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's ListCatalogItemRequest.page_token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem>|\Google\Protobuf\Internal\RepeatedField $catalog_items + * The catalog items. + * @type string $next_page_token + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's ListCatalogItemRequest.page_token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * The catalog items. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCatalogItems() + { + return $this->catalog_items; + } + + /** + * The catalog items. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCatalogItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem::class); + $this->catalog_items = $arr; + + return $this; + } + + /** + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's ListCatalogItemRequest.page_token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's ListCatalogItemRequest.page_token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php new file mode 100644 index 000000000000..82bc79d0546a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php @@ -0,0 +1,143 @@ +google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest + */ +class ListPredictionApiKeyRegistrationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent placement resource name such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of results to return per page. If unset, the + * service will choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent placement resource name such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * @type int $page_size + * Optional. Maximum number of results to return per page. If unset, the + * service will choose a reasonable default. + * @type string $page_token + * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent placement resource name such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent placement resource name such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of results to return per page. If unset, the + * service will choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of results to return per page. If unset, the + * service will choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsResponse.php new file mode 100644 index 000000000000..10f6cde3a76e --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsResponse.php @@ -0,0 +1,105 @@ +google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse + */ +class ListPredictionApiKeyRegistrationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of registered API keys. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + */ + private $prediction_api_key_registrations; + /** + * If empty, the list is complete. If nonempty, pass the token to the next + * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration>|\Google\Protobuf\Internal\RepeatedField $prediction_api_key_registrations + * The list of registered API keys. + * @type string $next_page_token + * If empty, the list is complete. If nonempty, pass the token to the next + * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); + parent::__construct($data); + } + + /** + * The list of registered API keys. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPredictionApiKeyRegistrations() + { + return $this->prediction_api_key_registrations; + } + + /** + * The list of registered API keys. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPredictionApiKeyRegistrations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration::class); + $this->prediction_api_key_registrations = $arr; + + return $this; + } + + /** + * If empty, the list is complete. If nonempty, pass the token to the next + * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If empty, the list is complete. If nonempty, pass the token to the next + * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php new file mode 100644 index 000000000000..93f04a497213 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php @@ -0,0 +1,277 @@ +google.cloud.recommendationengine.v1beta1.ListUserEventsRequest + */ +class ListUserEventsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent eventStore resource name, such as + * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Maximum number of results to return per page. If zero, the + * service will choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The previous ListUserEventsResponse.next_page_token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering expression to specify restrictions over + * returned events. This is a sequence of terms, where each term applies some + * kind of a restriction to the returned user events. Use this expression to + * restrict results to a specific time range, or filter events by eventType. + * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + * eventTime<"2012-04-23T18:25:43.511Z" eventType=search + * We expect only 3 types of fields: + * * eventTime: this can be specified a maximum of 2 times, once with a + * less than operator and once with a greater than operator. The + * eventTime restrict should result in one contiguous valid eventTime + * range. + * * eventType: only 1 eventType restriction can be specified. + * * eventsMissingCatalogItems: specififying this will restrict results + * to events for which catalog items were not found in the catalog. The + * default behavior is to return only those events for which catalog + * items were found. + * Some examples of valid filters expressions: + * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z" + * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + * eventType = detail-page-view + * * Example 3: eventsMissingCatalogItems + * eventType = search eventTime < "2018-04-23T18:30:43.511Z" + * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" + * * Example 5: eventType = search + * * Example 6: eventsMissingCatalogItems + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent eventStore resource name, such as + * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. + * @type int $page_size + * Optional. Maximum number of results to return per page. If zero, the + * service will choose a reasonable default. + * @type string $page_token + * Optional. The previous ListUserEventsResponse.next_page_token. + * @type string $filter + * Optional. Filtering expression to specify restrictions over + * returned events. This is a sequence of terms, where each term applies some + * kind of a restriction to the returned user events. Use this expression to + * restrict results to a specific time range, or filter events by eventType. + * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + * eventTime<"2012-04-23T18:25:43.511Z" eventType=search + * We expect only 3 types of fields: + * * eventTime: this can be specified a maximum of 2 times, once with a + * less than operator and once with a greater than operator. The + * eventTime restrict should result in one contiguous valid eventTime + * range. + * * eventType: only 1 eventType restriction can be specified. + * * eventsMissingCatalogItems: specififying this will restrict results + * to events for which catalog items were not found in the catalog. The + * default behavior is to return only those events for which catalog + * items were found. + * Some examples of valid filters expressions: + * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z" + * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + * eventType = detail-page-view + * * Example 3: eventsMissingCatalogItems + * eventType = search eventTime < "2018-04-23T18:30:43.511Z" + * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" + * * Example 5: eventType = search + * * Example 6: eventsMissingCatalogItems + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent eventStore resource name, such as + * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent eventStore resource name, such as + * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Maximum number of results to return per page. If zero, the + * service will choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of results to return per page. If zero, the + * service will choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The previous ListUserEventsResponse.next_page_token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The previous ListUserEventsResponse.next_page_token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering expression to specify restrictions over + * returned events. This is a sequence of terms, where each term applies some + * kind of a restriction to the returned user events. Use this expression to + * restrict results to a specific time range, or filter events by eventType. + * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + * eventTime<"2012-04-23T18:25:43.511Z" eventType=search + * We expect only 3 types of fields: + * * eventTime: this can be specified a maximum of 2 times, once with a + * less than operator and once with a greater than operator. The + * eventTime restrict should result in one contiguous valid eventTime + * range. + * * eventType: only 1 eventType restriction can be specified. + * * eventsMissingCatalogItems: specififying this will restrict results + * to events for which catalog items were not found in the catalog. The + * default behavior is to return only those events for which catalog + * items were found. + * Some examples of valid filters expressions: + * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z" + * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + * eventType = detail-page-view + * * Example 3: eventsMissingCatalogItems + * eventType = search eventTime < "2018-04-23T18:30:43.511Z" + * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" + * * Example 5: eventType = search + * * Example 6: eventsMissingCatalogItems + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering expression to specify restrictions over + * returned events. This is a sequence of terms, where each term applies some + * kind of a restriction to the returned user events. Use this expression to + * restrict results to a specific time range, or filter events by eventType. + * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + * eventTime<"2012-04-23T18:25:43.511Z" eventType=search + * We expect only 3 types of fields: + * * eventTime: this can be specified a maximum of 2 times, once with a + * less than operator and once with a greater than operator. The + * eventTime restrict should result in one contiguous valid eventTime + * range. + * * eventType: only 1 eventType restriction can be specified. + * * eventsMissingCatalogItems: specififying this will restrict results + * to events for which catalog items were not found in the catalog. The + * default behavior is to return only those events for which catalog + * items were found. + * Some examples of valid filters expressions: + * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z" + * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + * eventType = detail-page-view + * * Example 3: eventsMissingCatalogItems + * eventType = search eventTime < "2018-04-23T18:30:43.511Z" + * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" + * * Example 5: eventType = search + * * Example 6: eventsMissingCatalogItems + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsResponse.php new file mode 100644 index 000000000000..dd173c6ca7ae --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsResponse.php @@ -0,0 +1,105 @@ +google.cloud.recommendationengine.v1beta1.ListUserEventsResponse + */ +class ListUserEventsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The user events. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + */ + private $user_events; + /** + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's ListUserEvents.page_token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $user_events + * The user events. + * @type string $next_page_token + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's ListUserEvents.page_token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * The user events. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserEvents() + { + return $this->user_events; + } + + /** + * The user events. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); + $this->user_events = $arr; + + return $this; + } + + /** + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's ListUserEvents.page_token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's ListUserEvents.page_token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php new file mode 100644 index 000000000000..944aa82724ec --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php @@ -0,0 +1,551 @@ +google.cloud.recommendationengine.v1beta1.PredictRequest + */ +class PredictRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of the format: + * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` + * The id of the recommendation engine placement. This id is used to identify + * the set of models that will be used to make the prediction. + * We currently support three placements with the following IDs by default: + * * `shopping_cart`: Predicts items frequently bought together with one or + * more catalog items in the same shopping session. Commonly displayed after + * `add-to-cart` events, on product detail pages, or on the shopping cart + * page. + * * `home_page`: Predicts the next product that a user will most likely + * engage with or purchase based on the shopping or viewing history of the + * specified `userId` or `visitorId`. For example - Recommendations for you. + * * `product_detail`: Predicts the next product that a user will most likely + * engage with or purchase. The prediction is based on the shopping or + * viewing history of the specified `userId` or `visitorId` and its + * relevance to a specified `CatalogItem`. Typically used on product detail + * pages. For example - More items like this. + * * `recently_viewed_default`: Returns up to 75 items recently viewed by the + * specified `userId` or `visitorId`, most recent ones first. Returns + * nothing if neither of them has viewed any items yet. For example - + * Recently viewed. + * The full list of available placements can be seen at + * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. Context about the user, what they are looking at and what action + * they took to trigger the predict request. Note that this user event detail + * won't be ingested to userEvent logs. Thus, a separate userEvent write + * request is required for event logging. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_event = null; + /** + * Optional. Maximum number of results to return per page. Set this property + * to the number of prediction results required. If zero, the service will + * choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. The previous PredictResponse.next_page_token. + * + * Generated from protobuf field string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filter for restricting prediction results. Accepts values for + * tags and the `filterOutOfStockItems` flag. + * * Tag expressions. Restricts predictions to items that match all of the + * specified tags. Boolean operators `OR` and `NOT` are supported if the + * expression is enclosed in parentheses, and must be separated from the + * tag values by a space. `-"tagA"` is also supported and is equivalent to + * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + * with a size limit of 1 KiB. + * * filterOutOfStockItems. Restricts predictions to items that do not have a + * stockState value of OUT_OF_STOCK. + * Examples: + * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + * * filterOutOfStockItems tag=(-"promotional") + * * filterOutOfStockItems + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Use dryRun mode for this prediction query. If set to true, a + * dummy model will be used that returns arbitrary catalog items. + * Note that the dryRun mode should only be used for testing the API, or if + * the model is not ready. + * + * Generated from protobuf field bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $dry_run = false; + /** + * Optional. Additional domain specific parameters for the predictions. + * Allowed values: + * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem + * object will be returned in the + * `PredictResponse.PredictionResult.itemMetadata` object in the method + * response. + * * `returnItemScore`: Boolean. If set to true, the prediction 'score' + * corresponding to each returned item will be set in the `metadata` + * field in the prediction response. The given 'score' indicates the + * probability of an item being clicked/purchased given the user's context + * and history. + * + * Generated from protobuf field map params = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $params; + /** + * Optional. The labels for the predict request. + * * Label keys can contain lowercase letters, digits and hyphens, must start + * with a letter, and must end with a letter or digit. + * * Non-zero label values can contain lowercase letters, digits and hyphens, + * must start with a letter, and must end with a letter or digit. + * * No more than 64 labels can be associated with a given request. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full resource name of the format: + * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` + * The id of the recommendation engine placement. This id is used to identify + * the set of models that will be used to make the prediction. + * We currently support three placements with the following IDs by default: + * * `shopping_cart`: Predicts items frequently bought together with one or + * more catalog items in the same shopping session. Commonly displayed after + * `add-to-cart` events, on product detail pages, or on the shopping cart + * page. + * * `home_page`: Predicts the next product that a user will most likely + * engage with or purchase based on the shopping or viewing history of the + * specified `userId` or `visitorId`. For example - Recommendations for you. + * * `product_detail`: Predicts the next product that a user will most likely + * engage with or purchase. The prediction is based on the shopping or + * viewing history of the specified `userId` or `visitorId` and its + * relevance to a specified `CatalogItem`. Typically used on product detail + * pages. For example - More items like this. + * * `recently_viewed_default`: Returns up to 75 items recently viewed by the + * specified `userId` or `visitorId`, most recent ones first. Returns + * nothing if neither of them has viewed any items yet. For example - + * Recently viewed. + * The full list of available placements can be seen at + * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + * @type \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $user_event + * Required. Context about the user, what they are looking at and what action + * they took to trigger the predict request. Note that this user event detail + * won't be ingested to userEvent logs. Thus, a separate userEvent write + * request is required for event logging. + * @type int $page_size + * Optional. Maximum number of results to return per page. Set this property + * to the number of prediction results required. If zero, the service will + * choose a reasonable default. + * @type string $page_token + * Optional. The previous PredictResponse.next_page_token. + * @type string $filter + * Optional. Filter for restricting prediction results. Accepts values for + * tags and the `filterOutOfStockItems` flag. + * * Tag expressions. Restricts predictions to items that match all of the + * specified tags. Boolean operators `OR` and `NOT` are supported if the + * expression is enclosed in parentheses, and must be separated from the + * tag values by a space. `-"tagA"` is also supported and is equivalent to + * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + * with a size limit of 1 KiB. + * * filterOutOfStockItems. Restricts predictions to items that do not have a + * stockState value of OUT_OF_STOCK. + * Examples: + * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + * * filterOutOfStockItems tag=(-"promotional") + * * filterOutOfStockItems + * @type bool $dry_run + * Optional. Use dryRun mode for this prediction query. If set to true, a + * dummy model will be used that returns arbitrary catalog items. + * Note that the dryRun mode should only be used for testing the API, or if + * the model is not ready. + * @type array|\Google\Protobuf\Internal\MapField $params + * Optional. Additional domain specific parameters for the predictions. + * Allowed values: + * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem + * object will be returned in the + * `PredictResponse.PredictionResult.itemMetadata` object in the method + * response. + * * `returnItemScore`: Boolean. If set to true, the prediction 'score' + * corresponding to each returned item will be set in the `metadata` + * field in the prediction response. The given 'score' indicates the + * probability of an item being clicked/purchased given the user's context + * and history. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels for the predict request. + * * Label keys can contain lowercase letters, digits and hyphens, must start + * with a letter, and must end with a letter or digit. + * * Non-zero label values can contain lowercase letters, digits and hyphens, + * must start with a letter, and must end with a letter or digit. + * * No more than 64 labels can be associated with a given request. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of the format: + * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` + * The id of the recommendation engine placement. This id is used to identify + * the set of models that will be used to make the prediction. + * We currently support three placements with the following IDs by default: + * * `shopping_cart`: Predicts items frequently bought together with one or + * more catalog items in the same shopping session. Commonly displayed after + * `add-to-cart` events, on product detail pages, or on the shopping cart + * page. + * * `home_page`: Predicts the next product that a user will most likely + * engage with or purchase based on the shopping or viewing history of the + * specified `userId` or `visitorId`. For example - Recommendations for you. + * * `product_detail`: Predicts the next product that a user will most likely + * engage with or purchase. The prediction is based on the shopping or + * viewing history of the specified `userId` or `visitorId` and its + * relevance to a specified `CatalogItem`. Typically used on product detail + * pages. For example - More items like this. + * * `recently_viewed_default`: Returns up to 75 items recently viewed by the + * specified `userId` or `visitorId`, most recent ones first. Returns + * nothing if neither of them has viewed any items yet. For example - + * Recently viewed. + * The full list of available placements can be seen at + * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Full resource name of the format: + * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` + * The id of the recommendation engine placement. This id is used to identify + * the set of models that will be used to make the prediction. + * We currently support three placements with the following IDs by default: + * * `shopping_cart`: Predicts items frequently bought together with one or + * more catalog items in the same shopping session. Commonly displayed after + * `add-to-cart` events, on product detail pages, or on the shopping cart + * page. + * * `home_page`: Predicts the next product that a user will most likely + * engage with or purchase based on the shopping or viewing history of the + * specified `userId` or `visitorId`. For example - Recommendations for you. + * * `product_detail`: Predicts the next product that a user will most likely + * engage with or purchase. The prediction is based on the shopping or + * viewing history of the specified `userId` or `visitorId` and its + * relevance to a specified `CatalogItem`. Typically used on product detail + * pages. For example - More items like this. + * * `recently_viewed_default`: Returns up to 75 items recently viewed by the + * specified `userId` or `visitorId`, most recent ones first. Returns + * nothing if neither of them has viewed any items yet. For example - + * Recently viewed. + * The full list of available placements can be seen at + * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Context about the user, what they are looking at and what action + * they took to trigger the predict request. Note that this user event detail + * won't be ingested to userEvent logs. Thus, a separate userEvent write + * request is required for event logging. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEvent|null + */ + public function getUserEvent() + { + return $this->user_event; + } + + public function hasUserEvent() + { + return isset($this->user_event); + } + + public function clearUserEvent() + { + unset($this->user_event); + } + + /** + * Required. Context about the user, what they are looking at and what action + * they took to trigger the predict request. Note that this user event detail + * won't be ingested to userEvent logs. Thus, a separate userEvent write + * request is required for event logging. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $var + * @return $this + */ + public function setUserEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); + $this->user_event = $var; + + return $this; + } + + /** + * Optional. Maximum number of results to return per page. Set this property + * to the number of prediction results required. If zero, the service will + * choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Maximum number of results to return per page. Set this property + * to the number of prediction results required. If zero, the service will + * choose a reasonable default. + * + * Generated from protobuf field int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. The previous PredictResponse.next_page_token. + * + * Generated from protobuf field string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. The previous PredictResponse.next_page_token. + * + * Generated from protobuf field string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filter for restricting prediction results. Accepts values for + * tags and the `filterOutOfStockItems` flag. + * * Tag expressions. Restricts predictions to items that match all of the + * specified tags. Boolean operators `OR` and `NOT` are supported if the + * expression is enclosed in parentheses, and must be separated from the + * tag values by a space. `-"tagA"` is also supported and is equivalent to + * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + * with a size limit of 1 KiB. + * * filterOutOfStockItems. Restricts predictions to items that do not have a + * stockState value of OUT_OF_STOCK. + * Examples: + * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + * * filterOutOfStockItems tag=(-"promotional") + * * filterOutOfStockItems + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter for restricting prediction results. Accepts values for + * tags and the `filterOutOfStockItems` flag. + * * Tag expressions. Restricts predictions to items that match all of the + * specified tags. Boolean operators `OR` and `NOT` are supported if the + * expression is enclosed in parentheses, and must be separated from the + * tag values by a space. `-"tagA"` is also supported and is equivalent to + * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + * with a size limit of 1 KiB. + * * filterOutOfStockItems. Restricts predictions to items that do not have a + * stockState value of OUT_OF_STOCK. + * Examples: + * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + * * filterOutOfStockItems tag=(-"promotional") + * * filterOutOfStockItems + * + * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Use dryRun mode for this prediction query. If set to true, a + * dummy model will be used that returns arbitrary catalog items. + * Note that the dryRun mode should only be used for testing the API, or if + * the model is not ready. + * + * Generated from protobuf field bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDryRun() + { + return $this->dry_run; + } + + /** + * Optional. Use dryRun mode for this prediction query. If set to true, a + * dummy model will be used that returns arbitrary catalog items. + * Note that the dryRun mode should only be used for testing the API, or if + * the model is not ready. + * + * Generated from protobuf field bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDryRun($var) + { + GPBUtil::checkBool($var); + $this->dry_run = $var; + + return $this; + } + + /** + * Optional. Additional domain specific parameters for the predictions. + * Allowed values: + * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem + * object will be returned in the + * `PredictResponse.PredictionResult.itemMetadata` object in the method + * response. + * * `returnItemScore`: Boolean. If set to true, the prediction 'score' + * corresponding to each returned item will be set in the `metadata` + * field in the prediction response. The given 'score' indicates the + * probability of an item being clicked/purchased given the user's context + * and history. + * + * Generated from protobuf field map params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getParams() + { + return $this->params; + } + + /** + * Optional. Additional domain specific parameters for the predictions. + * Allowed values: + * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem + * object will be returned in the + * `PredictResponse.PredictionResult.itemMetadata` object in the method + * response. + * * `returnItemScore`: Boolean. If set to true, the prediction 'score' + * corresponding to each returned item will be set in the `metadata` + * field in the prediction response. The given 'score' indicates the + * probability of an item being clicked/purchased given the user's context + * and history. + * + * Generated from protobuf field map params = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setParams($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->params = $arr; + + return $this; + } + + /** + * Optional. The labels for the predict request. + * * Label keys can contain lowercase letters, digits and hyphens, must start + * with a letter, and must end with a letter or digit. + * * Non-zero label values can contain lowercase letters, digits and hyphens, + * must start with a letter, and must end with a letter or digit. + * * No more than 64 labels can be associated with a given request. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels for the predict request. + * * Label keys can contain lowercase letters, digits and hyphens, must start + * with a letter, and must end with a letter or digit. + * * Non-zero label values can contain lowercase letters, digits and hyphens, + * must start with a letter, and must end with a letter or digit. + * * No more than 64 labels can be associated with a given request. + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse.php new file mode 100644 index 000000000000..dd9123fe4fff --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse.php @@ -0,0 +1,253 @@ +google.cloud.recommendationengine.v1beta1.PredictResponse + */ +class PredictResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of recommended items. The order represents the ranking (from the + * most relevant item to the least). + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + */ + private $results; + /** + * A unique recommendation token. This should be included in the user event + * logs resulting from this recommendation, which enables accurate attribution + * of recommendation model performance. + * + * Generated from protobuf field string recommendation_token = 2; + */ + protected $recommendation_token = ''; + /** + * IDs of items in the request that were missing from the catalog. + * + * Generated from protobuf field repeated string items_missing_in_catalog = 3; + */ + private $items_missing_in_catalog; + /** + * True if the dryRun property was set in the request. + * + * Generated from protobuf field bool dry_run = 4; + */ + protected $dry_run = false; + /** + * Additional domain specific prediction response metadata. + * + * Generated from protobuf field map metadata = 5; + */ + private $metadata; + /** + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's PredictRequest.page_token. + * + * Generated from protobuf field string next_page_token = 6; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $results + * A list of recommended items. The order represents the ranking (from the + * most relevant item to the least). + * @type string $recommendation_token + * A unique recommendation token. This should be included in the user event + * logs resulting from this recommendation, which enables accurate attribution + * of recommendation model performance. + * @type array|\Google\Protobuf\Internal\RepeatedField $items_missing_in_catalog + * IDs of items in the request that were missing from the catalog. + * @type bool $dry_run + * True if the dryRun property was set in the request. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Additional domain specific prediction response metadata. + * @type string $next_page_token + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's PredictRequest.page_token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * A list of recommended items. The order represents the ranking (from the + * most relevant item to the least). + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResults() + { + return $this->results; + } + + /** + * A list of recommended items. The order represents the ranking (from the + * most relevant item to the least). + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\PredictResponse\PredictionResult::class); + $this->results = $arr; + + return $this; + } + + /** + * A unique recommendation token. This should be included in the user event + * logs resulting from this recommendation, which enables accurate attribution + * of recommendation model performance. + * + * Generated from protobuf field string recommendation_token = 2; + * @return string + */ + public function getRecommendationToken() + { + return $this->recommendation_token; + } + + /** + * A unique recommendation token. This should be included in the user event + * logs resulting from this recommendation, which enables accurate attribution + * of recommendation model performance. + * + * Generated from protobuf field string recommendation_token = 2; + * @param string $var + * @return $this + */ + public function setRecommendationToken($var) + { + GPBUtil::checkString($var, True); + $this->recommendation_token = $var; + + return $this; + } + + /** + * IDs of items in the request that were missing from the catalog. + * + * Generated from protobuf field repeated string items_missing_in_catalog = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItemsMissingInCatalog() + { + return $this->items_missing_in_catalog; + } + + /** + * IDs of items in the request that were missing from the catalog. + * + * Generated from protobuf field repeated string items_missing_in_catalog = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItemsMissingInCatalog($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->items_missing_in_catalog = $arr; + + return $this; + } + + /** + * True if the dryRun property was set in the request. + * + * Generated from protobuf field bool dry_run = 4; + * @return bool + */ + public function getDryRun() + { + return $this->dry_run; + } + + /** + * True if the dryRun property was set in the request. + * + * Generated from protobuf field bool dry_run = 4; + * @param bool $var + * @return $this + */ + public function setDryRun($var) + { + GPBUtil::checkBool($var); + $this->dry_run = $var; + + return $this; + } + + /** + * Additional domain specific prediction response metadata. + * + * Generated from protobuf field map metadata = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Additional domain specific prediction response metadata. + * + * Generated from protobuf field map metadata = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->metadata = $arr; + + return $this; + } + + /** + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's PredictRequest.page_token. + * + * Generated from protobuf field string next_page_token = 6; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * If empty, the list is complete. If nonempty, the token to pass to the next + * request's PredictRequest.page_token. + * + * Generated from protobuf field string next_page_token = 6; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse/PredictionResult.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse/PredictionResult.php new file mode 100644 index 000000000000..a5b769c9f337 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse/PredictionResult.php @@ -0,0 +1,124 @@ +google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult + */ +class PredictionResult extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the recommended catalog item + * + * Generated from protobuf field string id = 1; + */ + protected $id = ''; + /** + * Additional item metadata / annotations. + * Possible values: + * * `catalogItem`: JSON representation of the catalogItem. Will be set if + * `returnCatalogItem` is set to true in `PredictRequest.params`. + * * `score`: Prediction score in double value. Will be set if + * `returnItemScore` is set to true in `PredictRequest.params`. + * + * Generated from protobuf field map item_metadata = 2; + */ + private $item_metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * ID of the recommended catalog item + * @type array|\Google\Protobuf\Internal\MapField $item_metadata + * Additional item metadata / annotations. + * Possible values: + * * `catalogItem`: JSON representation of the catalogItem. Will be set if + * `returnCatalogItem` is set to true in `PredictRequest.params`. + * * `score`: Prediction score in double value. Will be set if + * `returnItemScore` is set to true in `PredictRequest.params`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionService::initOnce(); + parent::__construct($data); + } + + /** + * ID of the recommended catalog item + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * ID of the recommended catalog item + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Additional item metadata / annotations. + * Possible values: + * * `catalogItem`: JSON representation of the catalogItem. Will be set if + * `returnCatalogItem` is set to true in `PredictRequest.params`. + * * `score`: Prediction score in double value. Will be set if + * `returnItemScore` is set to true in `PredictRequest.params`. + * + * Generated from protobuf field map item_metadata = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItemMetadata() + { + return $this->item_metadata; + } + + /** + * Additional item metadata / annotations. + * Possible values: + * * `catalogItem`: JSON representation of the catalogItem. Will be set if + * `returnCatalogItem` is set to true in `PredictRequest.params`. + * * `score`: Prediction score in double value. Will be set if + * `returnItemScore` is set to true in `PredictRequest.params`. + * + * Generated from protobuf field map item_metadata = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setItemMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->item_metadata = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PredictionResult::class, \Google\Cloud\RecommendationEngine\V1beta1\PredictResponse_PredictionResult::class); + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse_PredictionResult.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse_PredictionResult.php new file mode 100644 index 000000000000..e7823aafc5a6 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse_PredictionResult.php @@ -0,0 +1,16 @@ +google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration + */ +class PredictionApiKeyRegistration extends \Google\Protobuf\Internal\Message +{ + /** + * The API key. + * + * Generated from protobuf field string api_key = 1; + */ + protected $api_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $api_key + * The API key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); + parent::__construct($data); + } + + /** + * The API key. + * + * Generated from protobuf field string api_key = 1; + * @return string + */ + public function getApiKey() + { + return $this->api_key; + } + + /** + * The API key. + * + * Generated from protobuf field string api_key = 1; + * @param string $var + * @return $this + */ + public function setApiKey($var) + { + GPBUtil::checkString($var, True); + $this->api_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistryGrpcClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistryGrpcClient.php new file mode 100644 index 000000000000..f4cfcc6b460b --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistryGrpcClient.php @@ -0,0 +1,84 @@ +_simpleRequest('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/CreatePredictionApiKeyRegistration', + $argument, + ['\Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration', 'decode'], + $metadata, $options); + } + + /** + * List the registered apiKeys for use with predict method. + * @param \Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListPredictionApiKeyRegistrations(\Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/ListPredictionApiKeyRegistrations', + $argument, + ['\Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsResponse', 'decode'], + $metadata, $options); + } + + /** + * Unregister an apiKey from using for predict method. + * @param \Google\Cloud\RecommendationEngine\V1beta1\DeletePredictionApiKeyRegistrationRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeletePredictionApiKeyRegistration(\Google\Cloud\RecommendationEngine\V1beta1\DeletePredictionApiKeyRegistrationRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/DeletePredictionApiKeyRegistration', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionServiceGrpcClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionServiceGrpcClient.php new file mode 100644 index 000000000000..cebfa825285b --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionServiceGrpcClient.php @@ -0,0 +1,53 @@ +_simpleRequest('/google.cloud.recommendationengine.v1beta1.PredictionService/Predict', + $argument, + ['\Google\Cloud\RecommendationEngine\V1beta1\PredictResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php new file mode 100644 index 000000000000..adca031c6cea --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php @@ -0,0 +1,340 @@ +google.cloud.recommendationengine.v1beta1.ProductCatalogItem + */ +class ProductCatalogItem extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A map to pass the costs associated with the product. + * For example: + * {"manufacturing": 45.5} The profit of selling this item is computed like + * so: + * * If 'exactPrice' is provided, profit = displayPrice - sum(costs) + * * If 'priceRange' is provided, profit = minPrice - sum(costs) + * + * Generated from protobuf field map costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $costs; + /** + * Optional. Only required if the price is set. Currency code for price/costs. Use + * three-character ISO-4217 code. + * + * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $currency_code = ''; + /** + * Optional. Online stock state of the catalog item. Default is `IN_STOCK`. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $stock_state = 0; + /** + * Optional. The available quantity of the item. + * + * Generated from protobuf field int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $available_quantity = 0; + /** + * Optional. Canonical URL directly linking to the item detail page with a + * length limit of 5 KiB.. + * + * Generated from protobuf field string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $canonical_product_uri = ''; + /** + * Optional. Product images for the catalog item. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $images; + protected $price; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\ExactPrice $exact_price + * Optional. The exact product price. + * @type \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\PriceRange $price_range + * Optional. The product price range. + * @type array|\Google\Protobuf\Internal\MapField $costs + * Optional. A map to pass the costs associated with the product. + * For example: + * {"manufacturing": 45.5} The profit of selling this item is computed like + * so: + * * If 'exactPrice' is provided, profit = displayPrice - sum(costs) + * * If 'priceRange' is provided, profit = minPrice - sum(costs) + * @type string $currency_code + * Optional. Only required if the price is set. Currency code for price/costs. Use + * three-character ISO-4217 code. + * @type int $stock_state + * Optional. Online stock state of the catalog item. Default is `IN_STOCK`. + * @type int|string $available_quantity + * Optional. The available quantity of the item. + * @type string $canonical_product_uri + * Optional. Canonical URL directly linking to the item detail page with a + * length limit of 5 KiB.. + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\Image>|\Google\Protobuf\Internal\RepeatedField $images + * Optional. Product images for the catalog item. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The exact product price. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\ExactPrice|null + */ + public function getExactPrice() + { + return $this->readOneof(1); + } + + public function hasExactPrice() + { + return $this->hasOneof(1); + } + + /** + * Optional. The exact product price. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\ExactPrice $var + * @return $this + */ + public function setExactPrice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\ExactPrice::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. The product price range. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\PriceRange|null + */ + public function getPriceRange() + { + return $this->readOneof(2); + } + + public function hasPriceRange() + { + return $this->hasOneof(2); + } + + /** + * Optional. The product price range. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\PriceRange $var + * @return $this + */ + public function setPriceRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\PriceRange::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. A map to pass the costs associated with the product. + * For example: + * {"manufacturing": 45.5} The profit of selling this item is computed like + * so: + * * If 'exactPrice' is provided, profit = displayPrice - sum(costs) + * * If 'priceRange' is provided, profit = minPrice - sum(costs) + * + * Generated from protobuf field map costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getCosts() + { + return $this->costs; + } + + /** + * Optional. A map to pass the costs associated with the product. + * For example: + * {"manufacturing": 45.5} The profit of selling this item is computed like + * so: + * * If 'exactPrice' is provided, profit = displayPrice - sum(costs) + * * If 'priceRange' is provided, profit = minPrice - sum(costs) + * + * Generated from protobuf field map costs = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setCosts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::FLOAT); + $this->costs = $arr; + + return $this; + } + + /** + * Optional. Only required if the price is set. Currency code for price/costs. Use + * three-character ISO-4217 code. + * + * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * Optional. Only required if the price is set. Currency code for price/costs. Use + * three-character ISO-4217 code. + * + * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * Optional. Online stock state of the catalog item. Default is `IN_STOCK`. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getStockState() + { + return $this->stock_state; + } + + /** + * Optional. Online stock state of the catalog item. Default is `IN_STOCK`. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setStockState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\StockState::class); + $this->stock_state = $var; + + return $this; + } + + /** + * Optional. The available quantity of the item. + * + * Generated from protobuf field int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getAvailableQuantity() + { + return $this->available_quantity; + } + + /** + * Optional. The available quantity of the item. + * + * Generated from protobuf field int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setAvailableQuantity($var) + { + GPBUtil::checkInt64($var); + $this->available_quantity = $var; + + return $this; + } + + /** + * Optional. Canonical URL directly linking to the item detail page with a + * length limit of 5 KiB.. + * + * Generated from protobuf field string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCanonicalProductUri() + { + return $this->canonical_product_uri; + } + + /** + * Optional. Canonical URL directly linking to the item detail page with a + * length limit of 5 KiB.. + * + * Generated from protobuf field string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCanonicalProductUri($var) + { + GPBUtil::checkString($var, True); + $this->canonical_product_uri = $var; + + return $this; + } + + /** + * Optional. Product images for the catalog item. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImages() + { + return $this->images; + } + + /** + * Optional. Product images for the catalog item. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\Image>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\Image::class); + $this->images = $arr; + + return $this; + } + + /** + * @return string + */ + public function getPrice() + { + return $this->whichOneof("price"); + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/ExactPrice.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/ExactPrice.php new file mode 100644 index 000000000000..7c89cff9e04b --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/ExactPrice.php @@ -0,0 +1,108 @@ +google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice + */ +class ExactPrice extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Display price of the product. + * + * Generated from protobuf field float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_price = 0.0; + /** + * Optional. Price of the product without any discount. If zero, by default + * set to be the 'displayPrice'. + * + * Generated from protobuf field float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $original_price = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $display_price + * Optional. Display price of the product. + * @type float $original_price + * Optional. Price of the product without any discount. If zero, by default + * set to be the 'displayPrice'. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Display price of the product. + * + * Generated from protobuf field float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getDisplayPrice() + { + return $this->display_price; + } + + /** + * Optional. Display price of the product. + * + * Generated from protobuf field float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setDisplayPrice($var) + { + GPBUtil::checkFloat($var); + $this->display_price = $var; + + return $this; + } + + /** + * Optional. Price of the product without any discount. If zero, by default + * set to be the 'displayPrice'. + * + * Generated from protobuf field float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getOriginalPrice() + { + return $this->original_price; + } + + /** + * Optional. Price of the product without any discount. If zero, by default + * set to be the 'displayPrice'. + * + * Generated from protobuf field float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setOriginalPrice($var) + { + GPBUtil::checkFloat($var); + $this->original_price = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ExactPrice::class, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem_ExactPrice::class); + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/PriceRange.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/PriceRange.php new file mode 100644 index 000000000000..0e852c571278 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/PriceRange.php @@ -0,0 +1,105 @@ +google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange + */ +class PriceRange extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The minimum product price. + * + * Generated from protobuf field float min = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $min = 0.0; + /** + * Required. The maximum product price. + * + * Generated from protobuf field float max = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $max = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $min + * Required. The minimum product price. + * @type float $max + * Required. The maximum product price. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The minimum product price. + * + * Generated from protobuf field float min = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getMin() + { + return $this->min; + } + + /** + * Required. The minimum product price. + * + * Generated from protobuf field float min = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkFloat($var); + $this->min = $var; + + return $this; + } + + /** + * Required. The maximum product price. + * + * Generated from protobuf field float max = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getMax() + { + return $this->max; + } + + /** + * Required. The maximum product price. + * + * Generated from protobuf field float max = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkFloat($var); + $this->max = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PriceRange::class, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem_PriceRange::class); + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/StockState.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/StockState.php new file mode 100644 index 000000000000..1c3d3309882d --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/StockState.php @@ -0,0 +1,79 @@ +google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState + */ +class StockState +{ + /** + * Default item stock status. Should never be used. + * + * Generated from protobuf enum STOCK_STATE_UNSPECIFIED = 0; + */ + const STOCK_STATE_UNSPECIFIED = 0; + /** + * Item in stock. + * + * Generated from protobuf enum IN_STOCK = 0; + */ + const IN_STOCK = 0; + /** + * Item out of stock. + * + * Generated from protobuf enum OUT_OF_STOCK = 1; + */ + const OUT_OF_STOCK = 1; + /** + * Item that is in pre-order state. + * + * Generated from protobuf enum PREORDER = 2; + */ + const PREORDER = 2; + /** + * Item that is back-ordered (i.e. temporarily out of stock). + * + * Generated from protobuf enum BACKORDER = 3; + */ + const BACKORDER = 3; + + private static $valueToName = [ + self::STOCK_STATE_UNSPECIFIED => 'STOCK_STATE_UNSPECIFIED', + self::IN_STOCK => 'IN_STOCK', + self::OUT_OF_STOCK => 'OUT_OF_STOCK', + self::PREORDER => 'PREORDER', + self::BACKORDER => 'BACKORDER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StockState::class, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem_StockState::class); + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_ExactPrice.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_ExactPrice.php new file mode 100644 index 000000000000..b0c815b4c813 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_ExactPrice.php @@ -0,0 +1,16 @@ +google.cloud.recommendationengine.v1beta1.ProductDetail + */ +class ProductDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 + * characters. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $id = ''; + /** + * Optional. Currency code for price/costs. Use three-character ISO-4217 + * code. Required only if originalPrice or displayPrice is set. + * + * Generated from protobuf field string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $currency_code = ''; + /** + * Optional. Original price of the product. If provided, this will override + * the original price in Catalog for this product. + * + * Generated from protobuf field float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $original_price = 0.0; + /** + * Optional. Display price of the product (e.g. discounted price). If + * provided, this will override the display price in Catalog for this product. + * + * Generated from protobuf field float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_price = 0.0; + /** + * Optional. Item stock state. If provided, this overrides the stock state + * in Catalog for items in this event. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $stock_state = 0; + /** + * Optional. Quantity of the product associated with the user event. For + * example, this field will be 2 if two products are added to the shopping + * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, + * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event + * types. + * + * Generated from protobuf field int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $quantity = 0; + /** + * Optional. Quantity of the products in stock when a user event happens. + * Optional. If provided, this overrides the available quantity in Catalog for + * this event. and can only be set if `stock_status` is set to `IN_STOCK`. + * Note that if an item is out of stock, you must set the `stock_state` field + * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not + * sufficient to mark the item out of stock. + * + * Generated from protobuf field int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $available_quantity = 0; + /** + * Optional. Extra features associated with a product in the user event. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $item_attributes = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 + * characters. + * @type string $currency_code + * Optional. Currency code for price/costs. Use three-character ISO-4217 + * code. Required only if originalPrice or displayPrice is set. + * @type float $original_price + * Optional. Original price of the product. If provided, this will override + * the original price in Catalog for this product. + * @type float $display_price + * Optional. Display price of the product (e.g. discounted price). If + * provided, this will override the display price in Catalog for this product. + * @type int $stock_state + * Optional. Item stock state. If provided, this overrides the stock state + * in Catalog for items in this event. + * @type int $quantity + * Optional. Quantity of the product associated with the user event. For + * example, this field will be 2 if two products are added to the shopping + * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, + * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event + * types. + * @type int $available_quantity + * Optional. Quantity of the products in stock when a user event happens. + * Optional. If provided, this overrides the available quantity in Catalog for + * this event. and can only be set if `stock_status` is set to `IN_STOCK`. + * Note that if an item is out of stock, you must set the `stock_state` field + * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not + * sufficient to mark the item out of stock. + * @type \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $item_attributes + * Optional. Extra features associated with a product in the user event. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 + * characters. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 + * characters. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Optional. Currency code for price/costs. Use three-character ISO-4217 + * code. Required only if originalPrice or displayPrice is set. + * + * Generated from protobuf field string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * Optional. Currency code for price/costs. Use three-character ISO-4217 + * code. Required only if originalPrice or displayPrice is set. + * + * Generated from protobuf field string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + + /** + * Optional. Original price of the product. If provided, this will override + * the original price in Catalog for this product. + * + * Generated from protobuf field float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getOriginalPrice() + { + return $this->original_price; + } + + /** + * Optional. Original price of the product. If provided, this will override + * the original price in Catalog for this product. + * + * Generated from protobuf field float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setOriginalPrice($var) + { + GPBUtil::checkFloat($var); + $this->original_price = $var; + + return $this; + } + + /** + * Optional. Display price of the product (e.g. discounted price). If + * provided, this will override the display price in Catalog for this product. + * + * Generated from protobuf field float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getDisplayPrice() + { + return $this->display_price; + } + + /** + * Optional. Display price of the product (e.g. discounted price). If + * provided, this will override the display price in Catalog for this product. + * + * Generated from protobuf field float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setDisplayPrice($var) + { + GPBUtil::checkFloat($var); + $this->display_price = $var; + + return $this; + } + + /** + * Optional. Item stock state. If provided, this overrides the stock state + * in Catalog for items in this event. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getStockState() + { + return $this->stock_state; + } + + /** + * Optional. Item stock state. If provided, this overrides the stock state + * in Catalog for items in this event. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setStockState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\StockState::class); + $this->stock_state = $var; + + return $this; + } + + /** + * Optional. Quantity of the product associated with the user event. For + * example, this field will be 2 if two products are added to the shopping + * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, + * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event + * types. + * + * Generated from protobuf field int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + * Optional. Quantity of the product associated with the user event. For + * example, this field will be 2 if two products are added to the shopping + * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, + * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event + * types. + * + * Generated from protobuf field int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setQuantity($var) + { + GPBUtil::checkInt32($var); + $this->quantity = $var; + + return $this; + } + + /** + * Optional. Quantity of the products in stock when a user event happens. + * Optional. If provided, this overrides the available quantity in Catalog for + * this event. and can only be set if `stock_status` is set to `IN_STOCK`. + * Note that if an item is out of stock, you must set the `stock_state` field + * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not + * sufficient to mark the item out of stock. + * + * Generated from protobuf field int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAvailableQuantity() + { + return $this->available_quantity; + } + + /** + * Optional. Quantity of the products in stock when a user event happens. + * Optional. If provided, this overrides the available quantity in Catalog for + * this event. and can only be set if `stock_status` is set to `IN_STOCK`. + * Note that if an item is out of stock, you must set the `stock_state` field + * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not + * sufficient to mark the item out of stock. + * + * Generated from protobuf field int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAvailableQuantity($var) + { + GPBUtil::checkInt32($var); + $this->available_quantity = $var; + + return $this; + } + + /** + * Optional. Extra features associated with a product in the user event. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap|null + */ + public function getItemAttributes() + { + return $this->item_attributes; + } + + public function hasItemAttributes() + { + return isset($this->item_attributes); + } + + public function clearItemAttributes() + { + unset($this->item_attributes); + } + + /** + * Optional. Extra features associated with a product in the user event. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $var + * @return $this + */ + public function setItemAttributes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap::class); + $this->item_attributes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductEventDetail.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductEventDetail.php new file mode 100644 index 000000000000..d65f1cc9d8d6 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductEventDetail.php @@ -0,0 +1,368 @@ +google.cloud.recommendationengine.v1beta1.ProductEventDetail + */ +class ProductEventDetail extends \Google\Protobuf\Internal\Message +{ + /** + * Required for `search` events. Other event types should not set this field. + * The user's search query as UTF-8 encoded text with a length limit of 5 KiB. + * + * Generated from protobuf field string search_query = 1; + */ + protected $search_query = ''; + /** + * Required for `category-page-view` events. Other event types should not set + * this field. + * The categories associated with a category page. + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * categories : ["Sales", "2017 Black Friday Deals"]. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + */ + private $page_categories; + /** + * The main product details related to the event. + * This field is required for the following event types: + * * `add-to-cart` + * * `add-to-list` + * * `checkout-start` + * * `detail-page-view` + * * `purchase-complete` + * * `refund` + * * `remove-from-cart` + * * `remove-from-list` + * This field is optional for the following event types: + * * `page-visit` + * * `shopping-cart-page-view` - note that 'product_details' should be set for + * this unless the shopping cart is empty. + * This field is not allowed for the following event types: + * * `category-page-view` + * * `home-page-view` + * * `search` + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + */ + private $product_details; + /** + * Required for `add-to-list` and `remove-from-list` events. The id or name of + * the list that the item is being added to or removed from. Other event types + * should not set this field. + * + * Generated from protobuf field string list_id = 4; + */ + protected $list_id = ''; + /** + * Optional. The id or name of the associated shopping cart. This id is used + * to associate multiple items added or present in the cart before purchase. + * This can only be set for `add-to-cart`, `remove-from-cart`, + * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. + * + * Generated from protobuf field string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cart_id = ''; + /** + * Optional. A transaction represents the entire purchase transaction. + * Required for `purchase-complete` events. Optional for `checkout-start` + * events. Other event types should not set this field. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $purchase_transaction = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $search_query + * Required for `search` events. Other event types should not set this field. + * The user's search query as UTF-8 encoded text with a length limit of 5 KiB. + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy>|\Google\Protobuf\Internal\RepeatedField $page_categories + * Required for `category-page-view` events. Other event types should not set + * this field. + * The categories associated with a category page. + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * categories : ["Sales", "2017 Black Friday Deals"]. + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $product_details + * The main product details related to the event. + * This field is required for the following event types: + * * `add-to-cart` + * * `add-to-list` + * * `checkout-start` + * * `detail-page-view` + * * `purchase-complete` + * * `refund` + * * `remove-from-cart` + * * `remove-from-list` + * This field is optional for the following event types: + * * `page-visit` + * * `shopping-cart-page-view` - note that 'product_details' should be set for + * this unless the shopping cart is empty. + * This field is not allowed for the following event types: + * * `category-page-view` + * * `home-page-view` + * * `search` + * @type string $list_id + * Required for `add-to-list` and `remove-from-list` events. The id or name of + * the list that the item is being added to or removed from. Other event types + * should not set this field. + * @type string $cart_id + * Optional. The id or name of the associated shopping cart. This id is used + * to associate multiple items added or present in the cart before purchase. + * This can only be set for `add-to-cart`, `remove-from-cart`, + * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. + * @type \Google\Cloud\RecommendationEngine\V1beta1\PurchaseTransaction $purchase_transaction + * Optional. A transaction represents the entire purchase transaction. + * Required for `purchase-complete` events. Optional for `checkout-start` + * events. Other event types should not set this field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * Required for `search` events. Other event types should not set this field. + * The user's search query as UTF-8 encoded text with a length limit of 5 KiB. + * + * Generated from protobuf field string search_query = 1; + * @return string + */ + public function getSearchQuery() + { + return $this->search_query; + } + + /** + * Required for `search` events. Other event types should not set this field. + * The user's search query as UTF-8 encoded text with a length limit of 5 KiB. + * + * Generated from protobuf field string search_query = 1; + * @param string $var + * @return $this + */ + public function setSearchQuery($var) + { + GPBUtil::checkString($var, True); + $this->search_query = $var; + + return $this; + } + + /** + * Required for `category-page-view` events. Other event types should not set + * this field. + * The categories associated with a category page. + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * categories : ["Sales", "2017 Black Friday Deals"]. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPageCategories() + { + return $this->page_categories; + } + + /** + * Required for `category-page-view` events. Other event types should not set + * this field. + * The categories associated with a category page. + * Category pages include special pages such as sales or promotions. For + * instance, a special sale page may have the category hierarchy: + * categories : ["Sales", "2017 Black Friday Deals"]. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPageCategories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy::class); + $this->page_categories = $arr; + + return $this; + } + + /** + * The main product details related to the event. + * This field is required for the following event types: + * * `add-to-cart` + * * `add-to-list` + * * `checkout-start` + * * `detail-page-view` + * * `purchase-complete` + * * `refund` + * * `remove-from-cart` + * * `remove-from-list` + * This field is optional for the following event types: + * * `page-visit` + * * `shopping-cart-page-view` - note that 'product_details' should be set for + * this unless the shopping cart is empty. + * This field is not allowed for the following event types: + * * `category-page-view` + * * `home-page-view` + * * `search` + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProductDetails() + { + return $this->product_details; + } + + /** + * The main product details related to the event. + * This field is required for the following event types: + * * `add-to-cart` + * * `add-to-list` + * * `checkout-start` + * * `detail-page-view` + * * `purchase-complete` + * * `refund` + * * `remove-from-cart` + * * `remove-from-list` + * This field is optional for the following event types: + * * `page-visit` + * * `shopping-cart-page-view` - note that 'product_details' should be set for + * this unless the shopping cart is empty. + * This field is not allowed for the following event types: + * * `category-page-view` + * * `home-page-view` + * * `search` + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProductDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\ProductDetail::class); + $this->product_details = $arr; + + return $this; + } + + /** + * Required for `add-to-list` and `remove-from-list` events. The id or name of + * the list that the item is being added to or removed from. Other event types + * should not set this field. + * + * Generated from protobuf field string list_id = 4; + * @return string + */ + public function getListId() + { + return $this->list_id; + } + + /** + * Required for `add-to-list` and `remove-from-list` events. The id or name of + * the list that the item is being added to or removed from. Other event types + * should not set this field. + * + * Generated from protobuf field string list_id = 4; + * @param string $var + * @return $this + */ + public function setListId($var) + { + GPBUtil::checkString($var, True); + $this->list_id = $var; + + return $this; + } + + /** + * Optional. The id or name of the associated shopping cart. This id is used + * to associate multiple items added or present in the cart before purchase. + * This can only be set for `add-to-cart`, `remove-from-cart`, + * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. + * + * Generated from protobuf field string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCartId() + { + return $this->cart_id; + } + + /** + * Optional. The id or name of the associated shopping cart. This id is used + * to associate multiple items added or present in the cart before purchase. + * This can only be set for `add-to-cart`, `remove-from-cart`, + * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. + * + * Generated from protobuf field string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCartId($var) + { + GPBUtil::checkString($var, True); + $this->cart_id = $var; + + return $this; + } + + /** + * Optional. A transaction represents the entire purchase transaction. + * Required for `purchase-complete` events. Optional for `checkout-start` + * events. Other event types should not set this field. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\PurchaseTransaction|null + */ + public function getPurchaseTransaction() + { + return $this->purchase_transaction; + } + + public function hasPurchaseTransaction() + { + return isset($this->purchase_transaction); + } + + public function clearPurchaseTransaction() + { + unset($this->purchase_transaction); + } + + /** + * Optional. A transaction represents the entire purchase transaction. + * Required for `purchase-complete` events. Optional for `checkout-start` + * events. Other event types should not set this field. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\PurchaseTransaction $var + * @return $this + */ + public function setPurchaseTransaction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\PurchaseTransaction::class); + $this->purchase_transaction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurchaseTransaction.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurchaseTransaction.php new file mode 100644 index 000000000000..871a95215d5d --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurchaseTransaction.php @@ -0,0 +1,251 @@ +google.cloud.recommendationengine.v1beta1.PurchaseTransaction + */ +class PurchaseTransaction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The transaction ID with a length limit of 128 bytes. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $id = ''; + /** + * Required. Total revenue or grand total associated with the transaction. + * This value include shipping, tax, or other adjustments to total revenue + * that you want to include as part of your revenue calculations. This field + * is not required if the event type is `refund`. + * + * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $revenue = 0.0; + /** + * Optional. All the taxes associated with the transaction. + * + * Generated from protobuf field map taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $taxes; + /** + * Optional. All the costs associated with the product. These can be + * manufacturing costs, shipping expenses not borne by the end user, or any + * other costs. + * Total product cost such that + * profit = revenue - (sum(taxes) + sum(costs)) + * If product_cost is not set, then + * profit = revenue - tax - shipping - sum(CatalogItem.costs). + * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost + * based profit *cannot* be calculated for this Transaction. + * + * Generated from protobuf field map costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $costs; + /** + * Required. Currency code. Use three-character ISO-4217 code. This field + * is not required if the event type is `refund`. + * + * Generated from protobuf field string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $currency_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Optional. The transaction ID with a length limit of 128 bytes. + * @type float $revenue + * Required. Total revenue or grand total associated with the transaction. + * This value include shipping, tax, or other adjustments to total revenue + * that you want to include as part of your revenue calculations. This field + * is not required if the event type is `refund`. + * @type array|\Google\Protobuf\Internal\MapField $taxes + * Optional. All the taxes associated with the transaction. + * @type array|\Google\Protobuf\Internal\MapField $costs + * Optional. All the costs associated with the product. These can be + * manufacturing costs, shipping expenses not borne by the end user, or any + * other costs. + * Total product cost such that + * profit = revenue - (sum(taxes) + sum(costs)) + * If product_cost is not set, then + * profit = revenue - tax - shipping - sum(CatalogItem.costs). + * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost + * based profit *cannot* be calculated for this Transaction. + * @type string $currency_code + * Required. Currency code. Use three-character ISO-4217 code. This field + * is not required if the event type is `refund`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The transaction ID with a length limit of 128 bytes. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Optional. The transaction ID with a length limit of 128 bytes. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Required. Total revenue or grand total associated with the transaction. + * This value include shipping, tax, or other adjustments to total revenue + * that you want to include as part of your revenue calculations. This field + * is not required if the event type is `refund`. + * + * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getRevenue() + { + return $this->revenue; + } + + /** + * Required. Total revenue or grand total associated with the transaction. + * This value include shipping, tax, or other adjustments to total revenue + * that you want to include as part of your revenue calculations. This field + * is not required if the event type is `refund`. + * + * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setRevenue($var) + { + GPBUtil::checkFloat($var); + $this->revenue = $var; + + return $this; + } + + /** + * Optional. All the taxes associated with the transaction. + * + * Generated from protobuf field map taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTaxes() + { + return $this->taxes; + } + + /** + * Optional. All the taxes associated with the transaction. + * + * Generated from protobuf field map taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTaxes($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::FLOAT); + $this->taxes = $arr; + + return $this; + } + + /** + * Optional. All the costs associated with the product. These can be + * manufacturing costs, shipping expenses not borne by the end user, or any + * other costs. + * Total product cost such that + * profit = revenue - (sum(taxes) + sum(costs)) + * If product_cost is not set, then + * profit = revenue - tax - shipping - sum(CatalogItem.costs). + * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost + * based profit *cannot* be calculated for this Transaction. + * + * Generated from protobuf field map costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getCosts() + { + return $this->costs; + } + + /** + * Optional. All the costs associated with the product. These can be + * manufacturing costs, shipping expenses not borne by the end user, or any + * other costs. + * Total product cost such that + * profit = revenue - (sum(taxes) + sum(costs)) + * If product_cost is not set, then + * profit = revenue - tax - shipping - sum(CatalogItem.costs). + * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost + * based profit *cannot* be calculated for this Transaction. + * + * Generated from protobuf field map costs = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setCosts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::FLOAT); + $this->costs = $arr; + + return $this; + } + + /** + * Required. Currency code. Use three-character ISO-4217 code. This field + * is not required if the event type is `refund`. + * + * Generated from protobuf field string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCurrencyCode() + { + return $this->currency_code; + } + + /** + * Required. Currency code. Use three-character ISO-4217 code. This field + * is not required if the event type is `refund`. + * + * Generated from protobuf field string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCurrencyCode($var) + { + GPBUtil::checkString($var, True); + $this->currency_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsMetadata.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsMetadata.php new file mode 100644 index 000000000000..8dbccb355655 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsMetadata.php @@ -0,0 +1,112 @@ +google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata + */ +class PurgeUserEventsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the request / operation. + * + * Generated from protobuf field string operation_name = 1; + */ + protected $operation_name = ''; + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + */ + protected $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation_name + * The ID of the request / operation. + * @type \Google\Protobuf\Timestamp $create_time + * Operation create time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the request / operation. + * + * Generated from protobuf field string operation_name = 1; + * @return string + */ + public function getOperationName() + { + return $this->operation_name; + } + + /** + * The ID of the request / operation. + * + * Generated from protobuf field string operation_name = 1; + * @param string $var + * @return $this + */ + public function setOperationName($var) + { + GPBUtil::checkString($var, True); + $this->operation_name = $var; + + return $this; + } + + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Operation create time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php new file mode 100644 index 000000000000..74043bb2aa2c --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php @@ -0,0 +1,219 @@ +google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest + */ +class PurgeUserEventsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the event_store under which the events are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The filter string to specify the events to be deleted. Empty + * string filter is not allowed. This filter can also be used with + * ListUserEvents API to list events that will be deleted. The eligible fields + * for filtering are: + * * eventType - UserEvent.eventType field of type string. + * * eventTime - in ISO 8601 "zulu" format. + * * visitorId - field of type string. Specifying this will delete all events + * associated with a visitor. + * * userId - field of type string. Specifying this will delete all events + * associated with a user. + * Example 1: Deleting all events in a time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < + * "2012-04-23T18:30:43.511Z"` + * Example 2: Deleting specific eventType in time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * Example 3: Deleting all events for a specific visitor + * `visitorId = visitor1024` + * The filtering fields are assumed to have an implicit AND. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $filter = ''; + /** + * Optional. The default value is false. Override this flag to true to + * actually perform the purge. If the field is not set to true, a sampling of + * events to be deleted will be returned. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the event_store under which the events are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` + * @type string $filter + * Required. The filter string to specify the events to be deleted. Empty + * string filter is not allowed. This filter can also be used with + * ListUserEvents API to list events that will be deleted. The eligible fields + * for filtering are: + * * eventType - UserEvent.eventType field of type string. + * * eventTime - in ISO 8601 "zulu" format. + * * visitorId - field of type string. Specifying this will delete all events + * associated with a visitor. + * * userId - field of type string. Specifying this will delete all events + * associated with a user. + * Example 1: Deleting all events in a time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < + * "2012-04-23T18:30:43.511Z"` + * Example 2: Deleting specific eventType in time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * Example 3: Deleting all events for a specific visitor + * `visitorId = visitor1024` + * The filtering fields are assumed to have an implicit AND. + * @type bool $force + * Optional. The default value is false. Override this flag to true to + * actually perform the purge. If the field is not set to true, a sampling of + * events to be deleted will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the event_store under which the events are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The resource name of the event_store under which the events are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The filter string to specify the events to be deleted. Empty + * string filter is not allowed. This filter can also be used with + * ListUserEvents API to list events that will be deleted. The eligible fields + * for filtering are: + * * eventType - UserEvent.eventType field of type string. + * * eventTime - in ISO 8601 "zulu" format. + * * visitorId - field of type string. Specifying this will delete all events + * associated with a visitor. + * * userId - field of type string. Specifying this will delete all events + * associated with a user. + * Example 1: Deleting all events in a time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < + * "2012-04-23T18:30:43.511Z"` + * Example 2: Deleting specific eventType in time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * Example 3: Deleting all events for a specific visitor + * `visitorId = visitor1024` + * The filtering fields are assumed to have an implicit AND. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Required. The filter string to specify the events to be deleted. Empty + * string filter is not allowed. This filter can also be used with + * ListUserEvents API to list events that will be deleted. The eligible fields + * for filtering are: + * * eventType - UserEvent.eventType field of type string. + * * eventTime - in ISO 8601 "zulu" format. + * * visitorId - field of type string. Specifying this will delete all events + * associated with a visitor. + * * userId - field of type string. Specifying this will delete all events + * associated with a user. + * Example 1: Deleting all events in a time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < + * "2012-04-23T18:30:43.511Z"` + * Example 2: Deleting specific eventType in time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * Example 3: Deleting all events for a specific visitor + * `visitorId = visitor1024` + * The filtering fields are assumed to have an implicit AND. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The default value is false. Override this flag to true to + * actually perform the purge. If the field is not set to true, a sampling of + * events to be deleted will be returned. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. The default value is false. Override this flag to true to + * actually perform the purge. If the field is not set to true, a sampling of + * events to be deleted will be returned. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsResponse.php new file mode 100644 index 000000000000..2ebd0d0f92e4 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsResponse.php @@ -0,0 +1,107 @@ +google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse + */ +class PurgeUserEventsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The total count of events purged as a result of the operation. + * + * Generated from protobuf field int64 purged_events_count = 1; + */ + protected $purged_events_count = 0; + /** + * A sampling of events deleted (or will be deleted) depending on the `force` + * property in the request. Max of 500 items will be returned. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + */ + private $user_events_sample; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $purged_events_count + * The total count of events purged as a result of the operation. + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $user_events_sample + * A sampling of events deleted (or will be deleted) depending on the `force` + * property in the request. Max of 500 items will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * The total count of events purged as a result of the operation. + * + * Generated from protobuf field int64 purged_events_count = 1; + * @return int|string + */ + public function getPurgedEventsCount() + { + return $this->purged_events_count; + } + + /** + * The total count of events purged as a result of the operation. + * + * Generated from protobuf field int64 purged_events_count = 1; + * @param int|string $var + * @return $this + */ + public function setPurgedEventsCount($var) + { + GPBUtil::checkInt64($var); + $this->purged_events_count = $var; + + return $this; + } + + /** + * A sampling of events deleted (or will be deleted) depending on the `force` + * property in the request. Max of 500 items will be returned. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserEventsSample() + { + return $this->user_events_sample; + } + + /** + * A sampling of events deleted (or will be deleted) depending on the `force` + * property in the request. Max of 500 items will be returned. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserEventsSample($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); + $this->user_events_sample = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php new file mode 100644 index 000000000000..a3c4899b1317 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php @@ -0,0 +1,167 @@ +google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest + */ +class UpdateCatalogItemRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Full resource name of catalog item, such as + * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The catalog item to update/create. The 'catalog_item_id' field + * has to match that in the 'name'. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $catalog_item = null; + /** + * Optional. Indicates which fields in the provided 'item' to update. If not + * set, will by default update all fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; + */ + protected $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Full resource name of catalog item, such as + * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + * @type \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalog_item + * Required. The catalog item to update/create. The 'catalog_item_id' field + * has to match that in the 'name'. + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Indicates which fields in the provided 'item' to update. If not + * set, will by default update all fields. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); + parent::__construct($data); + } + + /** + * Required. Full resource name of catalog item, such as + * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Full resource name of catalog item, such as + * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The catalog item to update/create. The 'catalog_item_id' field + * has to match that in the 'name'. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem|null + */ + public function getCatalogItem() + { + return $this->catalog_item; + } + + public function hasCatalogItem() + { + return isset($this->catalog_item); + } + + public function clearCatalogItem() + { + unset($this->catalog_item); + } + + /** + * Required. The catalog item to update/create. The 'catalog_item_id' field + * has to match that in the 'name'. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $var + * @return $this + */ + public function setCatalogItem($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem::class); + $this->catalog_item = $var; + + return $this; + } + + /** + * Optional. Indicates which fields in the provided 'item' to update. If not + * set, will by default update all fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Indicates which fields in the provided 'item' to update. If not + * set, will by default update all fields. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent.php new file mode 100644 index 000000000000..1d27319722d5 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent.php @@ -0,0 +1,422 @@ +google.cloud.recommendationengine.v1beta1.UserEvent + */ +class UserEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Required. User event type. Allowed values are: + * * `add-to-cart` Products being added to cart. + * * `add-to-list` Items being added to a list (shopping list, favorites + * etc). + * * `category-page-view` Special pages such as sale or promotion pages + * viewed. + * * `checkout-start` User starting a checkout process. + * * `detail-page-view` Products detail page viewed. + * * `home-page-view` Homepage viewed. + * * `page-visit` Generic page visits not included in the event types above. + * * `purchase-complete` User finishing a purchase. + * * `refund` Purchased items being refunded or returned. + * * `remove-from-cart` Products being removed from cart. + * * `remove-from-list` Items being removed from a list. + * * `search` Product search. + * * `shopping-cart-page-view` User viewing a shopping cart. + * * `impression` List of items displayed. Used by Google Tag Manager. + * + * Generated from protobuf field string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $event_type = ''; + /** + * Required. User information. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_info = null; + /** + * Optional. User event detailed information common across different + * recommendation types. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $event_detail = null; + /** + * Optional. Retail product specific user event metadata. + * This field is required for the following event types: + * * `add-to-cart` + * * `add-to-list` + * * `category-page-view` + * * `checkout-start` + * * `detail-page-view` + * * `purchase-complete` + * * `refund` + * * `remove-from-cart` + * * `remove-from-list` + * * `search` + * This field is optional for the following event types: + * * `page-visit` + * * `shopping-cart-page-view` - note that 'product_event_detail' should be + * set for this unless the shopping cart is empty. + * This field is not allowed for the following event types: + * * `home-page-view` + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $product_event_detail = null; + /** + * Optional. Only required for ImportUserEvents method. Timestamp of user + * event created. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $event_time = null; + /** + * Optional. This field should *not* be set when using JavaScript pixel + * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $event_source = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $event_type + * Required. User event type. Allowed values are: + * * `add-to-cart` Products being added to cart. + * * `add-to-list` Items being added to a list (shopping list, favorites + * etc). + * * `category-page-view` Special pages such as sale or promotion pages + * viewed. + * * `checkout-start` User starting a checkout process. + * * `detail-page-view` Products detail page viewed. + * * `home-page-view` Homepage viewed. + * * `page-visit` Generic page visits not included in the event types above. + * * `purchase-complete` User finishing a purchase. + * * `refund` Purchased items being refunded or returned. + * * `remove-from-cart` Products being removed from cart. + * * `remove-from-list` Items being removed from a list. + * * `search` Product search. + * * `shopping-cart-page-view` User viewing a shopping cart. + * * `impression` List of items displayed. Used by Google Tag Manager. + * @type \Google\Cloud\RecommendationEngine\V1beta1\UserInfo $user_info + * Required. User information. + * @type \Google\Cloud\RecommendationEngine\V1beta1\EventDetail $event_detail + * Optional. User event detailed information common across different + * recommendation types. + * @type \Google\Cloud\RecommendationEngine\V1beta1\ProductEventDetail $product_event_detail + * Optional. Retail product specific user event metadata. + * This field is required for the following event types: + * * `add-to-cart` + * * `add-to-list` + * * `category-page-view` + * * `checkout-start` + * * `detail-page-view` + * * `purchase-complete` + * * `refund` + * * `remove-from-cart` + * * `remove-from-list` + * * `search` + * This field is optional for the following event types: + * * `page-visit` + * * `shopping-cart-page-view` - note that 'product_event_detail' should be + * set for this unless the shopping cart is empty. + * This field is not allowed for the following event types: + * * `home-page-view` + * @type \Google\Protobuf\Timestamp $event_time + * Optional. Only required for ImportUserEvents method. Timestamp of user + * event created. + * @type int $event_source + * Optional. This field should *not* be set when using JavaScript pixel + * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * Required. User event type. Allowed values are: + * * `add-to-cart` Products being added to cart. + * * `add-to-list` Items being added to a list (shopping list, favorites + * etc). + * * `category-page-view` Special pages such as sale or promotion pages + * viewed. + * * `checkout-start` User starting a checkout process. + * * `detail-page-view` Products detail page viewed. + * * `home-page-view` Homepage viewed. + * * `page-visit` Generic page visits not included in the event types above. + * * `purchase-complete` User finishing a purchase. + * * `refund` Purchased items being refunded or returned. + * * `remove-from-cart` Products being removed from cart. + * * `remove-from-list` Items being removed from a list. + * * `search` Product search. + * * `shopping-cart-page-view` User viewing a shopping cart. + * * `impression` List of items displayed. Used by Google Tag Manager. + * + * Generated from protobuf field string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEventType() + { + return $this->event_type; + } + + /** + * Required. User event type. Allowed values are: + * * `add-to-cart` Products being added to cart. + * * `add-to-list` Items being added to a list (shopping list, favorites + * etc). + * * `category-page-view` Special pages such as sale or promotion pages + * viewed. + * * `checkout-start` User starting a checkout process. + * * `detail-page-view` Products detail page viewed. + * * `home-page-view` Homepage viewed. + * * `page-visit` Generic page visits not included in the event types above. + * * `purchase-complete` User finishing a purchase. + * * `refund` Purchased items being refunded or returned. + * * `remove-from-cart` Products being removed from cart. + * * `remove-from-list` Items being removed from a list. + * * `search` Product search. + * * `shopping-cart-page-view` User viewing a shopping cart. + * * `impression` List of items displayed. Used by Google Tag Manager. + * + * Generated from protobuf field string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEventType($var) + { + GPBUtil::checkString($var, True); + $this->event_type = $var; + + return $this; + } + + /** + * Required. User information. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\UserInfo|null + */ + public function getUserInfo() + { + return $this->user_info; + } + + public function hasUserInfo() + { + return isset($this->user_info); + } + + public function clearUserInfo() + { + unset($this->user_info); + } + + /** + * Required. User information. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\UserInfo $var + * @return $this + */ + public function setUserInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserInfo::class); + $this->user_info = $var; + + return $this; + } + + /** + * Optional. User event detailed information common across different + * recommendation types. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\EventDetail|null + */ + public function getEventDetail() + { + return $this->event_detail; + } + + public function hasEventDetail() + { + return isset($this->event_detail); + } + + public function clearEventDetail() + { + unset($this->event_detail); + } + + /** + * Optional. User event detailed information common across different + * recommendation types. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\EventDetail $var + * @return $this + */ + public function setEventDetail($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\EventDetail::class); + $this->event_detail = $var; + + return $this; + } + + /** + * Optional. Retail product specific user event metadata. + * This field is required for the following event types: + * * `add-to-cart` + * * `add-to-list` + * * `category-page-view` + * * `checkout-start` + * * `detail-page-view` + * * `purchase-complete` + * * `refund` + * * `remove-from-cart` + * * `remove-from-list` + * * `search` + * This field is optional for the following event types: + * * `page-visit` + * * `shopping-cart-page-view` - note that 'product_event_detail' should be + * set for this unless the shopping cart is empty. + * This field is not allowed for the following event types: + * * `home-page-view` + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\ProductEventDetail|null + */ + public function getProductEventDetail() + { + return $this->product_event_detail; + } + + public function hasProductEventDetail() + { + return isset($this->product_event_detail); + } + + public function clearProductEventDetail() + { + unset($this->product_event_detail); + } + + /** + * Optional. Retail product specific user event metadata. + * This field is required for the following event types: + * * `add-to-cart` + * * `add-to-list` + * * `category-page-view` + * * `checkout-start` + * * `detail-page-view` + * * `purchase-complete` + * * `refund` + * * `remove-from-cart` + * * `remove-from-list` + * * `search` + * This field is optional for the following event types: + * * `page-visit` + * * `shopping-cart-page-view` - note that 'product_event_detail' should be + * set for this unless the shopping cart is empty. + * This field is not allowed for the following event types: + * * `home-page-view` + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\ProductEventDetail $var + * @return $this + */ + public function setProductEventDetail($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductEventDetail::class); + $this->product_event_detail = $var; + + return $this; + } + + /** + * Optional. Only required for ImportUserEvents method. Timestamp of user + * event created. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEventTime() + { + return $this->event_time; + } + + public function hasEventTime() + { + return isset($this->event_time); + } + + public function clearEventTime() + { + unset($this->event_time); + } + + /** + * Optional. Only required for ImportUserEvents method. Timestamp of user + * event created. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEventTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->event_time = $var; + + return $this; + } + + /** + * Optional. This field should *not* be set when using JavaScript pixel + * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getEventSource() + { + return $this->event_source; + } + + /** + * Optional. This field should *not* be set when using JavaScript pixel + * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setEventSource($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent\EventSource::class); + $this->event_source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent/EventSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent/EventSource.php new file mode 100644 index 000000000000..32d9d868294a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent/EventSource.php @@ -0,0 +1,73 @@ +google.cloud.recommendationengine.v1beta1.UserEvent.EventSource + */ +class EventSource +{ + /** + * Unspecified event source. + * + * Generated from protobuf enum EVENT_SOURCE_UNSPECIFIED = 0; + */ + const EVENT_SOURCE_UNSPECIFIED = 0; + /** + * The event is ingested via a javascript pixel or Recommendations AI Tag + * through automl datalayer or JS Macros. + * + * Generated from protobuf enum AUTOML = 1; + */ + const AUTOML = 1; + /** + * The event is ingested via Recommendations AI Tag through Enhanced + * Ecommerce datalayer. + * + * Generated from protobuf enum ECOMMERCE = 2; + */ + const ECOMMERCE = 2; + /** + * The event is ingested via Import user events API. + * + * Generated from protobuf enum BATCH_UPLOAD = 3; + */ + const BATCH_UPLOAD = 3; + + private static $valueToName = [ + self::EVENT_SOURCE_UNSPECIFIED => 'EVENT_SOURCE_UNSPECIFIED', + self::AUTOML => 'AUTOML', + self::ECOMMERCE => 'ECOMMERCE', + self::BATCH_UPLOAD => 'BATCH_UPLOAD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EventSource::class, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent_EventSource::class); + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventImportSummary.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventImportSummary.php new file mode 100644 index 000000000000..5d66aa96e6e4 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventImportSummary.php @@ -0,0 +1,106 @@ +google.cloud.recommendationengine.v1beta1.UserEventImportSummary + */ +class UserEventImportSummary extends \Google\Protobuf\Internal\Message +{ + /** + * Count of user events imported with complete existing catalog information. + * + * Generated from protobuf field int64 joined_events_count = 1; + */ + protected $joined_events_count = 0; + /** + * Count of user events imported, but with catalog information not found + * in the imported catalog. + * + * Generated from protobuf field int64 unjoined_events_count = 2; + */ + protected $unjoined_events_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $joined_events_count + * Count of user events imported with complete existing catalog information. + * @type int|string $unjoined_events_count + * Count of user events imported, but with catalog information not found + * in the imported catalog. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * Count of user events imported with complete existing catalog information. + * + * Generated from protobuf field int64 joined_events_count = 1; + * @return int|string + */ + public function getJoinedEventsCount() + { + return $this->joined_events_count; + } + + /** + * Count of user events imported with complete existing catalog information. + * + * Generated from protobuf field int64 joined_events_count = 1; + * @param int|string $var + * @return $this + */ + public function setJoinedEventsCount($var) + { + GPBUtil::checkInt64($var); + $this->joined_events_count = $var; + + return $this; + } + + /** + * Count of user events imported, but with catalog information not found + * in the imported catalog. + * + * Generated from protobuf field int64 unjoined_events_count = 2; + * @return int|string + */ + public function getUnjoinedEventsCount() + { + return $this->unjoined_events_count; + } + + /** + * Count of user events imported, but with catalog information not found + * in the imported catalog. + * + * Generated from protobuf field int64 unjoined_events_count = 2; + * @param int|string $var + * @return $this + */ + public function setUnjoinedEventsCount($var) + { + GPBUtil::checkInt64($var); + $this->unjoined_events_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventInlineSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventInlineSource.php new file mode 100644 index 000000000000..65b1597982a9 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventInlineSource.php @@ -0,0 +1,67 @@ +google.cloud.recommendationengine.v1beta1.UserEventInlineSource + */ +class UserEventInlineSource extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of user events to import. Recommended max of 10k items. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $user_events; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $user_events + * Optional. A list of user events to import. Recommended max of 10k items. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of user events to import. Recommended max of 10k items. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserEvents() + { + return $this->user_events; + } + + /** + * Optional. A list of user events to import. Recommended max of 10k items. + * + * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); + $this->user_events = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventServiceGrpcClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventServiceGrpcClient.php new file mode 100644 index 000000000000..d3413e43cbfd --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventServiceGrpcClient.php @@ -0,0 +1,123 @@ +_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/WriteUserEvent', + $argument, + ['\Google\Cloud\RecommendationEngine\V1beta1\UserEvent', 'decode'], + $metadata, $options); + } + + /** + * Writes a single user event from the browser. This uses a GET request to + * due to browser restriction of POST-ing to a 3rd party domain. + * + * This method is used only by the Recommendations AI JavaScript pixel. + * Users should not call this method directly. + * @param \Google\Cloud\RecommendationEngine\V1beta1\CollectUserEventRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CollectUserEvent(\Google\Cloud\RecommendationEngine\V1beta1\CollectUserEventRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/CollectUserEvent', + $argument, + ['\Google\Api\HttpBody', 'decode'], + $metadata, $options); + } + + /** + * Gets a list of user events within a time range, with potential filtering. + * @param \Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListUserEvents(\Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/ListUserEvents', + $argument, + ['\Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsResponse', 'decode'], + $metadata, $options); + } + + /** + * Deletes permanently all user events specified by the filter provided. + * Depending on the number of events specified by the filter, this operation + * could take hours or days to complete. To test a filter, use the list + * command first. + * @param \Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function PurgeUserEvents(\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/PurgeUserEvents', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Bulk import of User events. Request processing might be + * synchronous. Events that already exist are skipped. + * Use this method for backfilling historical user events. + * + * Operation.response is of type ImportResponse. Note that it is + * possible for a subset of the items to be successfully inserted. + * Operation.metadata is of type ImportMetadata. + * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportUserEventsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ImportUserEvents(\Google\Cloud\RecommendationEngine\V1beta1\ImportUserEventsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/ImportUserEvents', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent_EventSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent_EventSource.php new file mode 100644 index 000000000000..a1a76c364d8e --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent_EventSource.php @@ -0,0 +1,16 @@ +google.cloud.recommendationengine.v1beta1.UserInfo + */ +class UserInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A unique identifier for tracking visitors with a length limit of + * 128 bytes. + * For example, this could be implemented with a http cookie, which should be + * able to uniquely identify a visitor on a single device. This unique + * identifier should not change if the visitor log in/out of the website. + * Maximum length 128 bytes. Cannot be empty. + * + * Generated from protobuf field string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $visitor_id = ''; + /** + * Optional. Unique identifier for logged-in user with a length limit of 128 + * bytes. Required only for logged-in users. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_id = ''; + /** + * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or + * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be + * set when using the javascript pixel or if `direct_user_request` is set. + * Used to extract location information for personalization. + * + * Generated from protobuf field string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ip_address = ''; + /** + * Optional. User agent as included in the HTTP header. UTF-8 encoded string + * with a length limit of 1 KiB. + * This should *not* be set when using the JavaScript pixel or if + * `directUserRequest` is set. + * + * Generated from protobuf field string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $user_agent = ''; + /** + * Optional. Indicates if the request is made directly from the end user + * in which case the user_agent and ip_address fields can be populated + * from the HTTP request. This should *not* be set when using the javascript + * pixel. This flag should be set only if the API request is made directly + * from the end user such as a mobile app (and not if a gateway or a server is + * processing and pushing the user events). + * + * Generated from protobuf field bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $direct_user_request = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $visitor_id + * Required. A unique identifier for tracking visitors with a length limit of + * 128 bytes. + * For example, this could be implemented with a http cookie, which should be + * able to uniquely identify a visitor on a single device. This unique + * identifier should not change if the visitor log in/out of the website. + * Maximum length 128 bytes. Cannot be empty. + * @type string $user_id + * Optional. Unique identifier for logged-in user with a length limit of 128 + * bytes. Required only for logged-in users. + * @type string $ip_address + * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or + * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be + * set when using the javascript pixel or if `direct_user_request` is set. + * Used to extract location information for personalization. + * @type string $user_agent + * Optional. User agent as included in the HTTP header. UTF-8 encoded string + * with a length limit of 1 KiB. + * This should *not* be set when using the JavaScript pixel or if + * `directUserRequest` is set. + * @type bool $direct_user_request + * Optional. Indicates if the request is made directly from the end user + * in which case the user_agent and ip_address fields can be populated + * from the HTTP request. This should *not* be set when using the javascript + * pixel. This flag should be set only if the API request is made directly + * from the end user such as a mobile app (and not if a gateway or a server is + * processing and pushing the user events). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); + parent::__construct($data); + } + + /** + * Required. A unique identifier for tracking visitors with a length limit of + * 128 bytes. + * For example, this could be implemented with a http cookie, which should be + * able to uniquely identify a visitor on a single device. This unique + * identifier should not change if the visitor log in/out of the website. + * Maximum length 128 bytes. Cannot be empty. + * + * Generated from protobuf field string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVisitorId() + { + return $this->visitor_id; + } + + /** + * Required. A unique identifier for tracking visitors with a length limit of + * 128 bytes. + * For example, this could be implemented with a http cookie, which should be + * able to uniquely identify a visitor on a single device. This unique + * identifier should not change if the visitor log in/out of the website. + * Maximum length 128 bytes. Cannot be empty. + * + * Generated from protobuf field string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVisitorId($var) + { + GPBUtil::checkString($var, True); + $this->visitor_id = $var; + + return $this; + } + + /** + * Optional. Unique identifier for logged-in user with a length limit of 128 + * bytes. Required only for logged-in users. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * Optional. Unique identifier for logged-in user with a length limit of 128 + * bytes. Required only for logged-in users. + * + * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkString($var, True); + $this->user_id = $var; + + return $this; + } + + /** + * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or + * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be + * set when using the javascript pixel or if `direct_user_request` is set. + * Used to extract location information for personalization. + * + * Generated from protobuf field string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or + * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be + * set when using the javascript pixel or if `direct_user_request` is set. + * Used to extract location information for personalization. + * + * Generated from protobuf field string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Optional. User agent as included in the HTTP header. UTF-8 encoded string + * with a length limit of 1 KiB. + * This should *not* be set when using the JavaScript pixel or if + * `directUserRequest` is set. + * + * Generated from protobuf field string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getUserAgent() + { + return $this->user_agent; + } + + /** + * Optional. User agent as included in the HTTP header. UTF-8 encoded string + * with a length limit of 1 KiB. + * This should *not* be set when using the JavaScript pixel or if + * `directUserRequest` is set. + * + * Generated from protobuf field string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setUserAgent($var) + { + GPBUtil::checkString($var, True); + $this->user_agent = $var; + + return $this; + } + + /** + * Optional. Indicates if the request is made directly from the end user + * in which case the user_agent and ip_address fields can be populated + * from the HTTP request. This should *not* be set when using the javascript + * pixel. This flag should be set only if the API request is made directly + * from the end user such as a mobile app (and not if a gateway or a server is + * processing and pushing the user events). + * + * Generated from protobuf field bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDirectUserRequest() + { + return $this->direct_user_request; + } + + /** + * Optional. Indicates if the request is made directly from the end user + * in which case the user_agent and ip_address fields can be populated + * from the HTTP request. This should *not* be set when using the javascript + * pixel. This flag should be set only if the API request is made directly + * from the end user such as a mobile app (and not if a gateway or a server is + * processing and pushing the user events). + * + * Generated from protobuf field bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDirectUserRequest($var) + { + GPBUtil::checkBool($var); + $this->direct_user_request = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php new file mode 100644 index 000000000000..c13bd5bae366 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php @@ -0,0 +1,115 @@ +google.cloud.recommendationengine.v1beta1.WriteUserEventRequest + */ +class WriteUserEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent eventStore resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. User event to write. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $user_event = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent eventStore resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * @type \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $user_event + * Required. User event to write. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent eventStore resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent eventStore resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. User event to write. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEvent|null + */ + public function getUserEvent() + { + return $this->user_event; + } + + public function hasUserEvent() + { + return isset($this->user_event); + } + + public function clearUserEvent() + { + unset($this->user_event); + } + + /** + * Required. User event to write. + * + * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $var + * @return $this + */ + public function setUserEvent($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); + $this->user_event = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php new file mode 100644 index 000000000000..93c362ed9186 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php @@ -0,0 +1,36 @@ +catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + * $catalogItem = new CatalogItem(); + * $response = $catalogServiceClient->createCatalogItem($formattedParent, $catalogItem); + * } finally { + * $catalogServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + */ +class CatalogServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.CatalogService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $catalogNameTemplate; + + private static $catalogItemPathNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/catalog_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/catalog_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/catalog_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/catalog_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getCatalogNameTemplate() + { + if (self::$catalogNameTemplate == null) { + self::$catalogNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}'); + } + + return self::$catalogNameTemplate; + } + + private static function getCatalogItemPathNameTemplate() + { + if (self::$catalogItemPathNameTemplate == null) { + self::$catalogItemPathNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}'); + } + + return self::$catalogItemPathNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'catalog' => self::getCatalogNameTemplate(), + 'catalogItemPath' => self::getCatalogItemPathNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a catalog + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * + * @return string The formatted catalog resource. + * + * @experimental + */ + public static function catalogName($project, $location, $catalog) + { + return self::getCatalogNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * catalog_item_path resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $catalogItemPath + * + * @return string The formatted catalog_item_path resource. + * + * @experimental + */ + public static function catalogItemPathName($project, $location, $catalog, $catalogItemPath) + { + return self::getCatalogItemPathNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'catalog_item_path' => $catalogItemPath, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - catalog: projects/{project}/locations/{location}/catalogs/{catalog} + * - catalogItemPath: projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + * + * @experimental + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + * + * @experimental + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'recommendationengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates a catalog item. + * + * Sample code: + * ``` + * $catalogServiceClient = new CatalogServiceClient(); + * try { + * $formattedParent = $catalogServiceClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + * $catalogItem = new CatalogItem(); + * $response = $catalogServiceClient->createCatalogItem($formattedParent, $catalogItem); + * } finally { + * $catalogServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @param CatalogItem $catalogItem Required. The catalog item to create. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createCatalogItem($parent, $catalogItem, array $optionalArgs = []) + { + $request = new CreateCatalogItemRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setCatalogItem($catalogItem); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateCatalogItem', CatalogItem::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a catalog item. + * + * Sample code: + * ``` + * $catalogServiceClient = new CatalogServiceClient(); + * try { + * $formattedName = $catalogServiceClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); + * $catalogServiceClient->deleteCatalogItem($formattedName); + * } finally { + * $catalogServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deleteCatalogItem($name, array $optionalArgs = []) + { + $request = new DeleteCatalogItemRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteCatalogItem', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a specific catalog item. + * + * Sample code: + * ``` + * $catalogServiceClient = new CatalogServiceClient(); + * try { + * $formattedName = $catalogServiceClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); + * $response = $catalogServiceClient->getCatalogItem($formattedName); + * } finally { + * $catalogServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Full resource name of catalog item, such as + * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function getCatalogItem($name, array $optionalArgs = []) + { + $request = new GetCatalogItemRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetCatalogItem', CatalogItem::class, $optionalArgs, $request)->wait(); + } + + /** + * Bulk import of multiple catalog items. Request processing may be + * synchronous. No partial updating supported. Non-existing items will be + * created. + * + * Operation.response is of type ImportResponse. Note that it is + * possible for a subset of the items to be successfully updated. + * + * Sample code: + * ``` + * $catalogServiceClient = new CatalogServiceClient(); + * try { + * $formattedParent = $catalogServiceClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + * $inputConfig = new InputConfig(); + * $operationResponse = $catalogServiceClient->importCatalogItems($formattedParent, $inputConfig); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $catalogServiceClient->importCatalogItems($formattedParent, $inputConfig); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'importCatalogItems'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $catalogServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. `projects/1234/locations/global/catalogs/default_catalog` + * @param InputConfig $inputConfig Required. The desired input location of the data. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency and used for request deduplication. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. + * @type ImportErrorsConfig $errorsConfig + * Optional. The desired location of errors incurred during the Import. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function importCatalogItems($parent, $inputConfig, array $optionalArgs = []) + { + $request = new ImportCatalogItemsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setInputConfig($inputConfig); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['errorsConfig'])) { + $request->setErrorsConfig($optionalArgs['errorsConfig']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ImportCatalogItems', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets a list of catalog items. + * + * Sample code: + * ``` + * $catalogServiceClient = new CatalogServiceClient(); + * try { + * $formattedParent = $catalogServiceClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + * // Iterate over pages of elements + * $pagedResponse = $catalogServiceClient->listCatalogItems($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $catalogServiceClient->listCatalogItems($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $catalogServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent catalog resource name, such as + * `projects/*/locations/global/catalogs/default_catalog`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. A filter to apply on the list results. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listCatalogItems($parent, array $optionalArgs = []) + { + $request = new ListCatalogItemsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListCatalogItems', $optionalArgs, ListCatalogItemsResponse::class, $request); + } + + /** + * Updates a catalog item. Partial updating is supported. Non-existing + * items will be created. + * + * Sample code: + * ``` + * $catalogServiceClient = new CatalogServiceClient(); + * try { + * $formattedName = $catalogServiceClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); + * $catalogItem = new CatalogItem(); + * $response = $catalogServiceClient->updateCatalogItem($formattedName, $catalogItem); + * } finally { + * $catalogServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Full resource name of catalog item, such as + * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". + * @param CatalogItem $catalogItem Required. The catalog item to update/create. The 'catalog_item_id' field + * has to match that in the 'name'. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * Optional. Indicates which fields in the provided 'item' to update. If not + * set, will by default update all fields. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function updateCatalogItem($name, $catalogItem, array $optionalArgs = []) + { + $request = new UpdateCatalogItemRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setCatalogItem($catalogItem); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateCatalogItem', CatalogItem::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php new file mode 100644 index 000000000000..fcc5d51fa854 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php @@ -0,0 +1,469 @@ +eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + * $predictionApiKeyRegistration = new PredictionApiKeyRegistration(); + * $response = $predictionApiKeyRegistryClient->createPredictionApiKeyRegistration($formattedParent, $predictionApiKeyRegistration); + * } finally { + * $predictionApiKeyRegistryClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + */ +class PredictionApiKeyRegistryGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $eventStoreNameTemplate; + + private static $predictionApiKeyRegistrationNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/prediction_api_key_registry_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/prediction_api_key_registry_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/prediction_api_key_registry_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/prediction_api_key_registry_rest_client_config.php', + ], + ], + ]; + } + + private static function getEventStoreNameTemplate() + { + if (self::$eventStoreNameTemplate == null) { + self::$eventStoreNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}'); + } + + return self::$eventStoreNameTemplate; + } + + private static function getPredictionApiKeyRegistrationNameTemplate() + { + if (self::$predictionApiKeyRegistrationNameTemplate == null) { + self::$predictionApiKeyRegistrationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}'); + } + + return self::$predictionApiKeyRegistrationNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'eventStore' => self::getEventStoreNameTemplate(), + 'predictionApiKeyRegistration' => self::getPredictionApiKeyRegistrationNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a event_store + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $eventStore + * + * @return string The formatted event_store resource. + * + * @experimental + */ + public static function eventStoreName($project, $location, $catalog, $eventStore) + { + return self::getEventStoreNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'event_store' => $eventStore, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * prediction_api_key_registration resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $eventStore + * @param string $predictionApiKeyRegistration + * + * @return string The formatted prediction_api_key_registration resource. + * + * @experimental + */ + public static function predictionApiKeyRegistrationName($project, $location, $catalog, $eventStore, $predictionApiKeyRegistration) + { + return self::getPredictionApiKeyRegistrationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'event_store' => $eventStore, + 'prediction_api_key_registration' => $predictionApiKeyRegistration, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - eventStore: projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store} + * - predictionApiKeyRegistration: projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'recommendationengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Register an API key for use with predict method. + * + * Sample code: + * ``` + * $predictionApiKeyRegistryClient = new PredictionApiKeyRegistryClient(); + * try { + * $formattedParent = $predictionApiKeyRegistryClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + * $predictionApiKeyRegistration = new PredictionApiKeyRegistration(); + * $response = $predictionApiKeyRegistryClient->createPredictionApiKeyRegistration($formattedParent, $predictionApiKeyRegistration); + * } finally { + * $predictionApiKeyRegistryClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * @param PredictionApiKeyRegistration $predictionApiKeyRegistration Required. The prediction API key registration. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function createPredictionApiKeyRegistration($parent, $predictionApiKeyRegistration, array $optionalArgs = []) + { + $request = new CreatePredictionApiKeyRegistrationRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setPredictionApiKeyRegistration($predictionApiKeyRegistration); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreatePredictionApiKeyRegistration', PredictionApiKeyRegistration::class, $optionalArgs, $request)->wait(); + } + + /** + * Unregister an apiKey from using for predict method. + * + * Sample code: + * ``` + * $predictionApiKeyRegistryClient = new PredictionApiKeyRegistryClient(); + * try { + * $formattedName = $predictionApiKeyRegistryClient->predictionApiKeyRegistrationName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PREDICTION_API_KEY_REGISTRATION]'); + * $predictionApiKeyRegistryClient->deletePredictionApiKeyRegistration($formattedName); + * } finally { + * $predictionApiKeyRegistryClient->close(); + * } + * ``` + * + * @param string $name Required. The API key to unregister including full resource path. + * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function deletePredictionApiKeyRegistration($name, array $optionalArgs = []) + { + $request = new DeletePredictionApiKeyRegistrationRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeletePredictionApiKeyRegistration', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * List the registered apiKeys for use with predict method. + * + * Sample code: + * ``` + * $predictionApiKeyRegistryClient = new PredictionApiKeyRegistryClient(); + * try { + * $formattedParent = $predictionApiKeyRegistryClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + * // Iterate over pages of elements + * $pagedResponse = $predictionApiKeyRegistryClient->listPredictionApiKeyRegistrations($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $predictionApiKeyRegistryClient->listPredictionApiKeyRegistrations($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $predictionApiKeyRegistryClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent placement resource name such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listPredictionApiKeyRegistrations($parent, array $optionalArgs = []) + { + $request = new ListPredictionApiKeyRegistrationsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListPredictionApiKeyRegistrations', $optionalArgs, ListPredictionApiKeyRegistrationsResponse::class, $request); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php new file mode 100644 index 000000000000..44331dd823aa --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php @@ -0,0 +1,454 @@ +placementName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PLACEMENT]'); + * $userEvent = new UserEvent(); + * // Iterate over pages of elements + * $pagedResponse = $predictionServiceClient->predict($formattedName, $userEvent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $predictionServiceClient->predict($formattedName, $userEvent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $predictionServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + */ +class PredictionServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $placementNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/prediction_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/prediction_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/prediction_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/prediction_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getPlacementNameTemplate() + { + if (self::$placementNameTemplate == null) { + self::$placementNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}'); + } + + return self::$placementNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'placement' => self::getPlacementNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a placement + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $eventStore + * @param string $placement + * + * @return string The formatted placement resource. + * + * @experimental + */ + public static function placementName($project, $location, $catalog, $eventStore, $placement) + { + return self::getPlacementNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'event_store' => $eventStore, + 'placement' => $placement, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - placement: projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'recommendationengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Makes a recommendation prediction. If using API Key based authentication, + * the API Key must be registered using the + * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry] + * service. [Learn more](/recommendations-ai/docs/setting-up#register-key). + * + * Sample code: + * ``` + * $predictionServiceClient = new PredictionServiceClient(); + * try { + * $formattedName = $predictionServiceClient->placementName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PLACEMENT]'); + * $userEvent = new UserEvent(); + * // Iterate over pages of elements + * $pagedResponse = $predictionServiceClient->predict($formattedName, $userEvent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $predictionServiceClient->predict($formattedName, $userEvent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $predictionServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Full resource name of the format: + * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` + * The id of the recommendation engine placement. This id is used to identify + * the set of models that will be used to make the prediction. + * + * We currently support three placements with the following IDs by default: + * + * * `shopping_cart`: Predicts items frequently bought together with one or + * more catalog items in the same shopping session. Commonly displayed after + * `add-to-cart` events, on product detail pages, or on the shopping cart + * page. + * + * * `home_page`: Predicts the next product that a user will most likely + * engage with or purchase based on the shopping or viewing history of the + * specified `userId` or `visitorId`. For example - Recommendations for you. + * + * * `product_detail`: Predicts the next product that a user will most likely + * engage with or purchase. The prediction is based on the shopping or + * viewing history of the specified `userId` or `visitorId` and its + * relevance to a specified `CatalogItem`. Typically used on product detail + * pages. For example - More items like this. + * + * * `recently_viewed_default`: Returns up to 75 items recently viewed by the + * specified `userId` or `visitorId`, most recent ones first. Returns + * nothing if neither of them has viewed any items yet. For example - + * Recently viewed. + * + * The full list of available placements can be seen at + * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard + * @param UserEvent $userEvent Required. Context about the user, what they are looking at and what action + * they took to trigger the predict request. Note that this user event detail + * won't be ingested to userEvent logs. Thus, a separate userEvent write + * request is required for event logging. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filter for restricting prediction results. Accepts values for + * tags and the `filterOutOfStockItems` flag. + * + * * Tag expressions. Restricts predictions to items that match all of the + * specified tags. Boolean operators `OR` and `NOT` are supported if the + * expression is enclosed in parentheses, and must be separated from the + * tag values by a space. `-"tagA"` is also supported and is equivalent to + * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings + * with a size limit of 1 KiB. + * + * * filterOutOfStockItems. Restricts predictions to items that do not have a + * stockState value of OUT_OF_STOCK. + * + * Examples: + * + * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") + * * filterOutOfStockItems tag=(-"promotional") + * * filterOutOfStockItems + * @type bool $dryRun + * Optional. Use dryRun mode for this prediction query. If set to true, a + * dummy model will be used that returns arbitrary catalog items. + * Note that the dryRun mode should only be used for testing the API, or if + * the model is not ready. + * @type array $params + * Optional. Additional domain specific parameters for the predictions. + * + * Allowed values: + * + * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem + * object will be returned in the + * `PredictResponse.PredictionResult.itemMetadata` object in the method + * response. + * * `returnItemScore`: Boolean. If set to true, the prediction 'score' + * corresponding to each returned item will be set in the `metadata` + * field in the prediction response. The given 'score' indicates the + * probability of an item being clicked/purchased given the user's context + * and history. + * @type array $labels + * Optional. The labels for the predict request. + * + * * Label keys can contain lowercase letters, digits and hyphens, must start + * with a letter, and must end with a letter or digit. + * * Non-zero label values can contain lowercase letters, digits and hyphens, + * must start with a letter, and must end with a letter or digit. + * * No more than 64 labels can be associated with a given request. + * + * See https://goo.gl/xmQnxf for more information on and examples of labels. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function predict($name, $userEvent, array $optionalArgs = []) + { + $request = new PredictRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setUserEvent($userEvent); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['dryRun'])) { + $request->setDryRun($optionalArgs['dryRun']); + } + + if (isset($optionalArgs['params'])) { + $request->setParams($optionalArgs['params']); + } + + if (isset($optionalArgs['labels'])) { + $request->setLabels($optionalArgs['labels']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('Predict', $optionalArgs, PredictResponse::class, $request); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php new file mode 100644 index 000000000000..412eb6dfa2cd --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php @@ -0,0 +1,728 @@ +eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + * $userEvent = 'user_event'; + * $response = $userEventServiceClient->collectUserEvent($formattedParent, $userEvent); + * } finally { + * $userEventServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @experimental + */ +class UserEventServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.UserEventService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $eventStoreNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/user_event_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/user_event_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/user_event_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/user_event_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getEventStoreNameTemplate() + { + if (self::$eventStoreNameTemplate == null) { + self::$eventStoreNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}'); + } + + return self::$eventStoreNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'eventStore' => self::getEventStoreNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a event_store + * resource. + * + * @param string $project + * @param string $location + * @param string $catalog + * @param string $eventStore + * + * @return string The formatted event_store resource. + * + * @experimental + */ + public static function eventStoreName($project, $location, $catalog, $eventStore) + { + return self::getEventStoreNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'catalog' => $catalog, + 'event_store' => $eventStore, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - eventStore: projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + * + * @experimental + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + * + * @experimental + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + * + * @experimental + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'recommendationengine.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Writes a single user event from the browser. This uses a GET request to + * due to browser restriction of POST-ing to a 3rd party domain. + * + * This method is used only by the Recommendations AI JavaScript pixel. + * Users should not call this method directly. + * + * Sample code: + * ``` + * $userEventServiceClient = new UserEventServiceClient(); + * try { + * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + * $userEvent = 'user_event'; + * $response = $userEventServiceClient->collectUserEvent($formattedParent, $userEvent); + * } finally { + * $userEventServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent eventStore name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * @param string $userEvent Required. URL encoded UserEvent proto. + * @param array $optionalArgs { + * Optional. + * + * @type string $uri + * Optional. The url including cgi-parameters but excluding the hash fragment. + * The URL must be truncated to 1.5K bytes to conservatively be under the 2K + * bytes. This is often more useful than the referer url, because many + * browsers only send the domain for 3rd party requests. + * @type int $ets + * Optional. The event timestamp in milliseconds. This prevents browser + * caching of otherwise identical get requests. The name is abbreviated to + * reduce the payload bytes. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Api\HttpBody + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function collectUserEvent($parent, $userEvent, array $optionalArgs = []) + { + $request = new CollectUserEventRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setUserEvent($userEvent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['uri'])) { + $request->setUri($optionalArgs['uri']); + } + + if (isset($optionalArgs['ets'])) { + $request->setEts($optionalArgs['ets']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CollectUserEvent', HttpBody::class, $optionalArgs, $request)->wait(); + } + + /** + * Bulk import of User events. Request processing might be + * synchronous. Events that already exist are skipped. + * Use this method for backfilling historical user events. + * + * Operation.response is of type ImportResponse. Note that it is + * possible for a subset of the items to be successfully inserted. + * Operation.metadata is of type ImportMetadata. + * + * Sample code: + * ``` + * $userEventServiceClient = new UserEventServiceClient(); + * try { + * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + * $inputConfig = new InputConfig(); + * $operationResponse = $userEventServiceClient->importUserEvents($formattedParent, $inputConfig); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $userEventServiceClient->importUserEvents($formattedParent, $inputConfig); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $userEventServiceClient->resumeOperation($operationName, 'importUserEvents'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $userEventServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` + * @param InputConfig $inputConfig Required. The desired input location of the data. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. Unique identifier provided by client, within the ancestor + * dataset scope. Ensures idempotency for expensive long running operations. + * Server-generated if unspecified. Up to 128 characters long. This is + * returned as google.longrunning.Operation.name in the response. Note that + * this field must not be set if the desired input config is + * catalog_inline_source. + * @type ImportErrorsConfig $errorsConfig + * Optional. The desired location of errors incurred during the Import. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function importUserEvents($parent, $inputConfig, array $optionalArgs = []) + { + $request = new ImportUserEventsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setInputConfig($inputConfig); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['errorsConfig'])) { + $request->setErrorsConfig($optionalArgs['errorsConfig']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ImportUserEvents', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets a list of user events within a time range, with potential filtering. + * + * Sample code: + * ``` + * $userEventServiceClient = new UserEventServiceClient(); + * try { + * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + * // Iterate over pages of elements + * $pagedResponse = $userEventServiceClient->listUserEvents($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $userEventServiceClient->listUserEvents($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $userEventServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent eventStore resource name, such as + * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filtering expression to specify restrictions over + * returned events. This is a sequence of terms, where each term applies some + * kind of a restriction to the returned user events. Use this expression to + * restrict results to a specific time range, or filter events by eventType. + * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems + * eventTime<"2012-04-23T18:25:43.511Z" eventType=search + * + * We expect only 3 types of fields: + * + * * eventTime: this can be specified a maximum of 2 times, once with a + * less than operator and once with a greater than operator. The + * eventTime restrict should result in one contiguous valid eventTime + * range. + * + * * eventType: only 1 eventType restriction can be specified. + * + * * eventsMissingCatalogItems: specififying this will restrict results + * to events for which catalog items were not found in the catalog. The + * default behavior is to return only those events for which catalog + * items were found. + * + * Some examples of valid filters expressions: + * + * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" + * eventTime < "2012-04-23T18:30:43.511Z" + * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" + * eventType = detail-page-view + * * Example 3: eventsMissingCatalogItems + * eventType = search eventTime < "2018-04-23T18:30:43.511Z" + * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" + * * Example 5: eventType = search + * * Example 6: eventsMissingCatalogItems + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function listUserEvents($parent, array $optionalArgs = []) + { + $request = new ListUserEventsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListUserEvents', $optionalArgs, ListUserEventsResponse::class, $request); + } + + /** + * Deletes permanently all user events specified by the filter provided. + * Depending on the number of events specified by the filter, this operation + * could take hours or days to complete. To test a filter, use the list + * command first. + * + * Sample code: + * ``` + * $userEventServiceClient = new UserEventServiceClient(); + * try { + * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + * $filter = 'filter'; + * $operationResponse = $userEventServiceClient->purgeUserEvents($formattedParent, $filter); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $userEventServiceClient->purgeUserEvents($formattedParent, $filter); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $userEventServiceClient->resumeOperation($operationName, 'purgeUserEvents'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $userEventServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The resource name of the event_store under which the events are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` + * @param string $filter Required. The filter string to specify the events to be deleted. Empty + * string filter is not allowed. This filter can also be used with + * ListUserEvents API to list events that will be deleted. The eligible fields + * for filtering are: + * * eventType - UserEvent.eventType field of type string. + * * eventTime - in ISO 8601 "zulu" format. + * * visitorId - field of type string. Specifying this will delete all events + * associated with a visitor. + * * userId - field of type string. Specifying this will delete all events + * associated with a user. + * Example 1: Deleting all events in a time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < + * "2012-04-23T18:30:43.511Z"` + * Example 2: Deleting specific eventType in time range. + * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` + * Example 3: Deleting all events for a specific visitor + * `visitorId = visitor1024` + * The filtering fields are assumed to have an implicit AND. + * @param array $optionalArgs { + * Optional. + * + * @type bool $force + * Optional. The default value is false. Override this flag to true to + * actually perform the purge. If the field is not set to true, a sampling of + * events to be deleted will be returned. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function purgeUserEvents($parent, $filter, array $optionalArgs = []) + { + $request = new PurgeUserEventsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setFilter($filter); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('PurgeUserEvents', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Writes a single user event. + * + * Sample code: + * ``` + * $userEventServiceClient = new UserEventServiceClient(); + * try { + * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + * $userEvent = new UserEvent(); + * $response = $userEventServiceClient->writeUserEvent($formattedParent, $userEvent); + * } finally { + * $userEventServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent eventStore resource name, such as + * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. + * @param UserEvent $userEvent Required. User event to write. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEvent + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function writeUserEvent($parent, $userEvent, array $optionalArgs = []) + { + $request = new WriteUserEventRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setUserEvent($userEvent); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('WriteUserEvent', UserEvent::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionApiKeyRegistryClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionApiKeyRegistryClient.php new file mode 100644 index 000000000000..9a6b6c3e0d46 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionApiKeyRegistryClient.php @@ -0,0 +1,36 @@ + [ + 'google.cloud.recommendationengine.v1beta1.CatalogService' => [ + 'ImportCatalogItems' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\ImportCatalogItemsResponse', + 'metadataReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\ImportMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListCatalogItems' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCatalogItems', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php new file mode 100644 index 000000000000..a9d3f6981fa1 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php @@ -0,0 +1,113 @@ + [ + 'google.cloud.recommendationengine.v1beta1.CatalogService' => [ + 'CreateCatalogItem' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems', + 'body' => 'catalog_item', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteCatalogItem' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCatalogItem' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportCatalogItems' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListCatalogItems' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateCatalogItem' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}', + 'body' => 'catalog_item', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_client_config.json b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_client_config.json new file mode 100644 index 000000000000..deb13af32bda --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreatePredictionApiKeyRegistration": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeletePredictionApiKeyRegistration": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListPredictionApiKeyRegistrations": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php new file mode 100644 index 000000000000..489c66c61dfc --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php @@ -0,0 +1,18 @@ + [ + 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry' => [ + 'ListPredictionApiKeyRegistrations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getPredictionApiKeyRegistrations', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php new file mode 100644 index 000000000000..f1e73ffe52d3 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php @@ -0,0 +1,78 @@ + [ + 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry' => [ + 'CreatePredictionApiKeyRegistration' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeletePredictionApiKeyRegistration' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListPredictionApiKeyRegistrations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_client_config.json b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_client_config.json new file mode 100644 index 000000000000..3368352e1f6a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.recommendationengine.v1beta1.PredictionService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Predict": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php new file mode 100644 index 000000000000..52e2175fe76c --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php @@ -0,0 +1,18 @@ + [ + 'google.cloud.recommendationengine.v1beta1.PredictionService' => [ + 'Predict' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResults', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php new file mode 100644 index 000000000000..ef637277dd5a --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php @@ -0,0 +1,56 @@ + [ + 'google.cloud.recommendationengine.v1beta1.PredictionService' => [ + 'Predict' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_client_config.json b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_client_config.json new file mode 100644 index 000000000000..5f920c6228a8 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_client_config.json @@ -0,0 +1,60 @@ +{ + "interfaces": { + "google.cloud.recommendationengine.v1beta1.UserEventService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CollectUserEvent": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportUserEvents": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListUserEvents": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PurgeUserEvents": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "WriteUserEvent": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php new file mode 100644 index 000000000000..886947166e6f --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php @@ -0,0 +1,38 @@ + [ + 'google.cloud.recommendationengine.v1beta1.UserEventService' => [ + 'ImportUserEvents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\ImportUserEventsResponse', + 'metadataReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\ImportMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'PurgeUserEvents' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsResponse', + 'metadataReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListUserEvents' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getUserEvents', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php new file mode 100644 index 000000000000..47e11b7d1505 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php @@ -0,0 +1,102 @@ + [ + 'google.cloud.recommendationengine.v1beta1.UserEventService' => [ + 'CollectUserEvent' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collect', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ImportUserEvents' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:import', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListUserEvents' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PurgeUserEvents' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:purge', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'WriteUserEvent' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write', + 'body' => 'user_event', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php new file mode 100644 index 000000000000..1f2a0f2c7b2e --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php @@ -0,0 +1,584 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return CatalogServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CatalogServiceClient($options); + } + + /** + * @test + */ + public function createCatalogItemTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $title = 'title110371416'; + $description = 'description-1724546052'; + $languageCode = 'languageCode-412800396'; + $itemGroupId = 'itemGroupId894431879'; + $expectedResponse = new CatalogItem(); + $expectedResponse->setId($id); + $expectedResponse->setTitle($title); + $expectedResponse->setDescription($description); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setItemGroupId($itemGroupId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $catalogItem = new CatalogItem(); + $catalogItemId = 'catalogItemId-1850269433'; + $catalogItem->setId($catalogItemId); + $catalogItemCategoryHierarchies = []; + $catalogItem->setCategoryHierarchies($catalogItemCategoryHierarchies); + $catalogItemTitle = 'catalogItemTitle244020972'; + $catalogItem->setTitle($catalogItemTitle); + $response = $gapicClient->createCatalogItem($formattedParent, $catalogItem); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/CreateCatalogItem', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getCatalogItem(); + $this->assertProtobufEquals($catalogItem, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createCatalogItemExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $catalogItem = new CatalogItem(); + $catalogItemId = 'catalogItemId-1850269433'; + $catalogItem->setId($catalogItemId); + $catalogItemCategoryHierarchies = []; + $catalogItem->setCategoryHierarchies($catalogItemCategoryHierarchies); + $catalogItemTitle = 'catalogItemTitle244020972'; + $catalogItem->setTitle($catalogItemTitle); + try { + $gapicClient->createCatalogItem($formattedParent, $catalogItem); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteCatalogItemTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); + $gapicClient->deleteCatalogItem($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/DeleteCatalogItem', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteCatalogItemExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); + try { + $gapicClient->deleteCatalogItem($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getCatalogItemTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $title = 'title110371416'; + $description = 'description-1724546052'; + $languageCode = 'languageCode-412800396'; + $itemGroupId = 'itemGroupId894431879'; + $expectedResponse = new CatalogItem(); + $expectedResponse->setId($id); + $expectedResponse->setTitle($title); + $expectedResponse->setDescription($description); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setItemGroupId($itemGroupId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); + $response = $gapicClient->getCatalogItem($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/GetCatalogItem', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getCatalogItemExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); + try { + $gapicClient->getCatalogItem($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function importCatalogItemsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importCatalogItemsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportCatalogItemsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importCatalogItemsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $inputConfig = new InputConfig(); + $response = $gapicClient->importCatalogItems($formattedParent, $inputConfig); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/ImportCatalogItems', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importCatalogItemsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** + * @test + */ + public function importCatalogItemsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importCatalogItemsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $inputConfig = new InputConfig(); + $response = $gapicClient->importCatalogItems($formattedParent, $inputConfig); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importCatalogItemsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** + * @test + */ + public function listCatalogItemsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $catalogItemsElement = new CatalogItem(); + $catalogItems = [ + $catalogItemsElement, + ]; + $expectedResponse = new ListCatalogItemsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCatalogItems($catalogItems); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + $response = $gapicClient->listCatalogItems($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCatalogItems()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/ListCatalogItems', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listCatalogItemsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); + try { + $gapicClient->listCatalogItems($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateCatalogItemTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $title = 'title110371416'; + $description = 'description-1724546052'; + $languageCode = 'languageCode-412800396'; + $itemGroupId = 'itemGroupId894431879'; + $expectedResponse = new CatalogItem(); + $expectedResponse->setId($id); + $expectedResponse->setTitle($title); + $expectedResponse->setDescription($description); + $expectedResponse->setLanguageCode($languageCode); + $expectedResponse->setItemGroupId($itemGroupId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); + $catalogItem = new CatalogItem(); + $catalogItemId = 'catalogItemId-1850269433'; + $catalogItem->setId($catalogItemId); + $catalogItemCategoryHierarchies = []; + $catalogItem->setCategoryHierarchies($catalogItemCategoryHierarchies); + $catalogItemTitle = 'catalogItemTitle244020972'; + $catalogItem->setTitle($catalogItemTitle); + $response = $gapicClient->updateCatalogItem($formattedName, $catalogItem); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/UpdateCatalogItem', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getCatalogItem(); + $this->assertProtobufEquals($catalogItem, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateCatalogItemExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); + $catalogItem = new CatalogItem(); + $catalogItemId = 'catalogItemId-1850269433'; + $catalogItem->setId($catalogItemId); + $catalogItemCategoryHierarchies = []; + $catalogItem->setCategoryHierarchies($catalogItemCategoryHierarchies); + $catalogItemTitle = 'catalogItemTitle244020972'; + $catalogItem->setTitle($catalogItemTitle); + try { + $gapicClient->updateCatalogItem($formattedName, $catalogItem); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php new file mode 100644 index 000000000000..9f865b52aa15 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php @@ -0,0 +1,272 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return PredictionApiKeyRegistryClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PredictionApiKeyRegistryClient($options); + } + + /** + * @test + */ + public function createPredictionApiKeyRegistrationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $apiKey = 'apiKey-800085318'; + $expectedResponse = new PredictionApiKeyRegistration(); + $expectedResponse->setApiKey($apiKey); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $predictionApiKeyRegistration = new PredictionApiKeyRegistration(); + $response = $gapicClient->createPredictionApiKeyRegistration($formattedParent, $predictionApiKeyRegistration); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/CreatePredictionApiKeyRegistration', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getPredictionApiKeyRegistration(); + $this->assertProtobufEquals($predictionApiKeyRegistration, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function createPredictionApiKeyRegistrationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $predictionApiKeyRegistration = new PredictionApiKeyRegistration(); + try { + $gapicClient->createPredictionApiKeyRegistration($formattedParent, $predictionApiKeyRegistration); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deletePredictionApiKeyRegistrationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->predictionApiKeyRegistrationName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PREDICTION_API_KEY_REGISTRATION]'); + $gapicClient->deletePredictionApiKeyRegistration($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/DeletePredictionApiKeyRegistration', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deletePredictionApiKeyRegistrationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->predictionApiKeyRegistrationName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PREDICTION_API_KEY_REGISTRATION]'); + try { + $gapicClient->deletePredictionApiKeyRegistration($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listPredictionApiKeyRegistrationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $predictionApiKeyRegistrationsElement = new PredictionApiKeyRegistration(); + $predictionApiKeyRegistrations = [ + $predictionApiKeyRegistrationsElement, + ]; + $expectedResponse = new ListPredictionApiKeyRegistrationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setPredictionApiKeyRegistrations($predictionApiKeyRegistrations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $response = $gapicClient->listPredictionApiKeyRegistrations($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getPredictionApiKeyRegistrations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/ListPredictionApiKeyRegistrations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listPredictionApiKeyRegistrationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + try { + $gapicClient->listPredictionApiKeyRegistrations($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php new file mode 100644 index 000000000000..ee4ad4689b44 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php @@ -0,0 +1,163 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return PredictionServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PredictionServiceClient($options); + } + + /** + * @test + */ + public function predictTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $recommendationToken = 'recommendationToken-1973883405'; + $dryRun2 = true; + $nextPageToken = ''; + $resultsElement = new PredictionResult(); + $results = [ + $resultsElement, + ]; + $expectedResponse = new PredictResponse(); + $expectedResponse->setRecommendationToken($recommendationToken); + $expectedResponse->setDryRun($dryRun2); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResults($results); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->placementName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PLACEMENT]'); + $userEvent = new UserEvent(); + $userEventEventType = 'userEventEventType341658661'; + $userEvent->setEventType($userEventEventType); + $userEventUserInfo = new UserInfo(); + $userInfoVisitorId = 'userInfoVisitorId-1297088752'; + $userEventUserInfo->setVisitorId($userInfoVisitorId); + $userEvent->setUserInfo($userEventUserInfo); + $response = $gapicClient->predict($formattedName, $userEvent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResults()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.PredictionService/Predict', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getUserEvent(); + $this->assertProtobufEquals($userEvent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function predictExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->placementName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PLACEMENT]'); + $userEvent = new UserEvent(); + $userEventEventType = 'userEventEventType341658661'; + $userEvent->setEventType($userEventEventType); + $userEventUserInfo = new UserInfo(); + $userInfoVisitorId = 'userInfoVisitorId-1297088752'; + $userEventUserInfo->setVisitorId($userInfoVisitorId); + $userEvent->setUserInfo($userEventUserInfo); + try { + $gapicClient->predict($formattedName, $userEvent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php new file mode 100644 index 000000000000..4399337b46c5 --- /dev/null +++ b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php @@ -0,0 +1,554 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return UserEventServiceClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new UserEventServiceClient($options); + } + + /** + * @test + */ + public function collectUserEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $contentType = 'contentType831846208'; + $data = '-86'; + $expectedResponse = new HttpBody(); + $expectedResponse->setContentType($contentType); + $expectedResponse->setData($data); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $userEvent = 'userEvent1921940774'; + $response = $gapicClient->collectUserEvent($formattedParent, $userEvent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/CollectUserEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getUserEvent(); + $this->assertProtobufEquals($userEvent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function collectUserEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $userEvent = 'userEvent1921940774'; + try { + $gapicClient->collectUserEvent($formattedParent, $userEvent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function importUserEventsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importUserEventsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ImportUserEventsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importUserEventsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $inputConfig = new InputConfig(); + $response = $gapicClient->importUserEvents($formattedParent, $inputConfig); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/ImportUserEvents', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInputConfig(); + $this->assertProtobufEquals($inputConfig, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importUserEventsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** + * @test + */ + public function importUserEventsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importUserEventsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $inputConfig = new InputConfig(); + $response = $gapicClient->importUserEvents($formattedParent, $inputConfig); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importUserEventsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** + * @test + */ + public function listUserEventsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $userEventsElement = new UserEvent(); + $userEvents = [ + $userEventsElement, + ]; + $expectedResponse = new ListUserEventsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setUserEvents($userEvents); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $response = $gapicClient->listUserEvents($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getUserEvents()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/ListUserEvents', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listUserEventsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + try { + $gapicClient->listUserEvents($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function purgeUserEventsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/purgeUserEventsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $purgedEventsCount = 310774833; + $expectedResponse = new PurgeUserEventsResponse(); + $expectedResponse->setPurgedEventsCount($purgedEventsCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/purgeUserEventsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $filter = 'filter-1274492040'; + $response = $gapicClient->purgeUserEvents($formattedParent, $filter); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/PurgeUserEvents', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getFilter(); + $this->assertProtobufEquals($filter, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/purgeUserEventsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** + * @test + */ + public function purgeUserEventsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/purgeUserEventsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $filter = 'filter-1274492040'; + $response = $gapicClient->purgeUserEvents($formattedParent, $filter); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/purgeUserEventsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** + * @test + */ + public function writeUserEventTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $eventType = 'eventType984376767'; + $expectedResponse = new UserEvent(); + $expectedResponse->setEventType($eventType); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $userEvent = new UserEvent(); + $userEventEventType = 'userEventEventType341658661'; + $userEvent->setEventType($userEventEventType); + $userEventUserInfo = new UserInfo(); + $userInfoVisitorId = 'userInfoVisitorId-1297088752'; + $userEventUserInfo->setVisitorId($userInfoVisitorId); + $userEvent->setUserInfo($userEventUserInfo); + $response = $gapicClient->writeUserEvent($formattedParent, $userEvent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/WriteUserEvent', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getUserEvent(); + $this->assertProtobufEquals($userEvent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function writeUserEventExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); + $userEvent = new UserEvent(); + $userEventEventType = 'userEventEventType341658661'; + $userEvent->setEventType($userEventEventType); + $userEventUserInfo = new UserInfo(); + $userInfoVisitorId = 'userInfoVisitorId-1297088752'; + $userEventUserInfo->setVisitorId($userInfoVisitorId); + $userEvent->setUserInfo($userEventUserInfo); + try { + $gapicClient->writeUserEvent($formattedParent, $userEvent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From 405a6046b76597ca6365ca865bfa748b2cebc478 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 12 Sep 2022 18:58:08 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../V1Beta1/RecommendationengineResources.php | 8 +- .../Gapic/CatalogServiceGapicClient.php | 4 +- .../Recommendationengine/V1Beta1/Catalog.php | Bin 2632 -> 0 bytes .../V1Beta1/CatalogService.php | 70 -- .../Recommendationengine/V1Beta1/Common.php | 42 - .../Recommendationengine/V1Beta1/Import.php | Bin 3668 -> 0 bytes .../PredictionApikeyRegistryService.php | 55 -- .../V1Beta1/PredictionService.php | 70 -- .../V1Beta1/RecommendationengineResources.php | 33 - .../V1Beta1/UserEvent.php | Bin 3433 -> 0 bytes .../V1Beta1/UserEventService.php | 78 -- .../V1beta1/CatalogInlineSource.php | 71 -- .../V1beta1/CatalogItem.php | 473 ------------ .../V1beta1/CatalogItem/CategoryHierarchy.php | 82 -- .../V1beta1/CatalogItem_CategoryHierarchy.php | 16 - .../V1beta1/CatalogServiceGrpcClient.php | 131 ---- .../V1beta1/CollectUserEventRequest.php | 193 ----- .../V1beta1/CreateCatalogItemRequest.php | 115 --- ...atePredictionApiKeyRegistrationRequest.php | 115 --- .../V1beta1/DeleteCatalogItemRequest.php | 71 -- ...etePredictionApiKeyRegistrationRequest.php | 71 -- .../V1beta1/EventDetail.php | 359 --------- .../V1beta1/FeatureMap.php | 139 ---- .../V1beta1/FeatureMap/FloatList.php | 70 -- .../V1beta1/FeatureMap/StringList.php | 70 -- .../V1beta1/FeatureMap_FloatList.php | 16 - .../V1beta1/FeatureMap_StringList.php | 16 - .../V1beta1/GcsSource.php | 92 --- .../V1beta1/GetCatalogItemRequest.php | 71 -- .../RecommendationEngine/V1beta1/Image.php | 135 ---- .../V1beta1/ImportCatalogItemsRequest.php | 201 ----- .../V1beta1/ImportCatalogItemsResponse.php | 113 --- .../V1beta1/ImportErrorsConfig.php | 84 -- .../V1beta1/ImportMetadata.php | 266 ------- .../V1beta1/ImportUserEventsRequest.php | 213 ----- .../V1beta1/ImportUserEventsResponse.php | 161 ---- .../V1beta1/InputConfig.php | 141 ---- .../V1beta1/ListCatalogItemsRequest.php | 177 ----- .../V1beta1/ListCatalogItemsResponse.php | 105 --- ...stPredictionApiKeyRegistrationsRequest.php | 143 ---- ...tPredictionApiKeyRegistrationsResponse.php | 105 --- .../V1beta1/ListUserEventsRequest.php | 277 ------- .../V1beta1/ListUserEventsResponse.php | 105 --- .../V1beta1/PredictRequest.php | 551 ------------- .../V1beta1/PredictResponse.php | 253 ------ .../PredictResponse/PredictionResult.php | 124 --- .../PredictResponse_PredictionResult.php | 16 - .../V1beta1/PredictionApiKeyRegistration.php | 67 -- .../PredictionApiKeyRegistryGrpcClient.php | 84 -- .../V1beta1/PredictionServiceGrpcClient.php | 53 -- .../V1beta1/ProductCatalogItem.php | 340 -------- .../V1beta1/ProductCatalogItem/ExactPrice.php | 108 --- .../V1beta1/ProductCatalogItem/PriceRange.php | 105 --- .../V1beta1/ProductCatalogItem/StockState.php | 79 -- .../V1beta1/ProductCatalogItem_ExactPrice.php | 16 - .../V1beta1/ProductCatalogItem_PriceRange.php | 16 - .../V1beta1/ProductCatalogItem_StockState.php | 16 - .../V1beta1/ProductDetail.php | 371 --------- .../V1beta1/ProductEventDetail.php | 368 --------- .../V1beta1/PurchaseTransaction.php | 251 ------ .../V1beta1/PurgeUserEventsMetadata.php | 112 --- .../V1beta1/PurgeUserEventsRequest.php | 219 ------ .../V1beta1/PurgeUserEventsResponse.php | 107 --- .../V1beta1/UpdateCatalogItemRequest.php | 167 ---- .../V1beta1/UserEvent.php | 422 ---------- .../V1beta1/UserEvent/EventSource.php | 73 -- .../V1beta1/UserEventImportSummary.php | 106 --- .../V1beta1/UserEventInlineSource.php | 67 -- .../V1beta1/UserEventServiceGrpcClient.php | 123 --- .../V1beta1/UserEvent_EventSource.php | 16 - .../RecommendationEngine/V1beta1/UserInfo.php | 271 ------- .../V1beta1/WriteUserEventRequest.php | 115 --- .../src/V1beta1/CatalogServiceClient.php | 36 - .../Gapic/CatalogServiceGapicClient.php | 698 ----------------- .../PredictionApiKeyRegistryGapicClient.php | 469 ----------- .../Gapic/PredictionServiceGapicClient.php | 454 ----------- .../Gapic/UserEventServiceGapicClient.php | 728 ------------------ .../PredictionApiKeyRegistryClient.php | 36 - .../src/V1beta1/PredictionServiceClient.php | 36 - .../src/V1beta1/UserEventServiceClient.php | 36 - .../v1beta1/src/V1beta1/gapic_metadata.json | 120 --- .../catalog_service_client_config.json | 65 -- .../catalog_service_descriptor_config.php | 28 - .../catalog_service_rest_client_config.php | 113 --- ...iction_api_key_registry_client_config.json | 50 -- ...ion_api_key_registry_descriptor_config.php | 18 - ...on_api_key_registry_rest_client_config.php | 78 -- .../prediction_service_client_config.json | 40 - .../prediction_service_descriptor_config.php | 18 - .../prediction_service_rest_client_config.php | 56 -- .../user_event_service_client_config.json | 60 -- .../user_event_service_descriptor_config.php | 38 - .../user_event_service_rest_client_config.php | 102 --- .../Unit/V1beta1/CatalogServiceClientTest.php | 584 -------------- .../PredictionApiKeyRegistryClientTest.php | 272 ------- .../V1beta1/PredictionServiceClientTest.php | 163 ---- .../V1beta1/UserEventServiceClientTest.php | 554 ------------- 97 files changed, 6 insertions(+), 14219 deletions(-) delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Catalog.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/CatalogService.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Common.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Import.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionApikeyRegistryService.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionService.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/RecommendationengineResources.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/UserEvent.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/UserEventService.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogInlineSource.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem/CategoryHierarchy.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem_CategoryHierarchy.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogServiceGrpcClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/EventDetail.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/FloatList.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/StringList.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_FloatList.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_StringList.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GcsSource.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/Image.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsResponse.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportErrorsConfig.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportMetadata.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsResponse.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/InputConfig.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsResponse.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsResponse.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsResponse.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse/PredictionResult.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse_PredictionResult.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistration.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistryGrpcClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionServiceGrpcClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/ExactPrice.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/PriceRange.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/StockState.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_ExactPrice.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_PriceRange.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_StockState.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductDetail.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductEventDetail.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurchaseTransaction.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsMetadata.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsResponse.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent/EventSource.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventImportSummary.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventInlineSource.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventServiceGrpcClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent_EventSource.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserInfo.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/CatalogServiceGapicClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionApiKeyRegistryClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionServiceClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/UserEventServiceClient.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_client_config.json delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_descriptor_config.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_client_config.json delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_client_config.json delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_client_config.json delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php delete mode 100644 owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php diff --git a/RecommendationEngine/metadata/V1Beta1/RecommendationengineResources.php b/RecommendationEngine/metadata/V1Beta1/RecommendationengineResources.php index 5937c281a36c..e09b270728dd 100644 --- a/RecommendationEngine/metadata/V1Beta1/RecommendationengineResources.php +++ b/RecommendationEngine/metadata/V1Beta1/RecommendationengineResources.php @@ -17,11 +17,11 @@ public static function initOnce() { \GPBMetadata\Google\Api\Resource::initOnce(); $pool->internalAddGeneratedFile( ' - -Ngoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto)google.cloud.recommendationengine.v1beta1B + +Ngoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto)google.cloud.recommendationengine.v1beta1B -com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1Ai -+recommendationengine.googleapis.com/Catalog:projects/{project}/locations/{location}/catalogs/{catalog}A -3recommendationengine.googleapis.com/CatalogItemPath^projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path=**}A ++recommendationengine.googleapis.com/Catalog:projects/{project}/locations/{location}/catalogs/{catalog}A +3recommendationengine.googleapis.com/CatalogItemPath[projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}A .recommendationengine.googleapis.com/EventStoreTprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}A @recommendationengine.googleapis.com/PredictionApiKeyRegistrationprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}A -recommendationengine.googleapis.com/Placementkprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}bproto3' diff --git a/RecommendationEngine/src/V1beta1/Gapic/CatalogServiceGapicClient.php b/RecommendationEngine/src/V1beta1/Gapic/CatalogServiceGapicClient.php index 4f49f5244b92..a5215cf3a2d1 100644 --- a/RecommendationEngine/src/V1beta1/Gapic/CatalogServiceGapicClient.php +++ b/RecommendationEngine/src/V1beta1/Gapic/CatalogServiceGapicClient.php @@ -147,7 +147,7 @@ private static function getCatalogNameTemplate() private static function getCatalogItemPathNameTemplate() { if (self::$catalogItemPathNameTemplate == null) { - self::$catalogItemPathNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path=**}'); + self::$catalogItemPathNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}'); } return self::$catalogItemPathNameTemplate; @@ -214,7 +214,7 @@ public static function catalogItemPathName($project, $location, $catalog, $catal * The following name formats are supported: * Template: Pattern * - catalog: projects/{project}/locations/{location}/catalogs/{catalog} - * - catalogItemPath: projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path=**} + * - catalogItemPath: projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path} * * The optional $template argument can be supplied to specify a particular pattern, * and must match one of the templates listed above. If no $template argument is diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Catalog.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Catalog.php deleted file mode 100644 index fc32aeacdbbb5cc28320e4b203093278a4efc936..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2632 zcmbtWU2hvj6s^~F+FZA(yQQj?J}`tzb)-!4nTW^Ng5}P3#aOV(^RYojd2AIrq%n`|0P&IDz-kA&CgXocL%o zMSM(9!eSnKafn9Q$q8Y|izf*U39}H|@1o=G5ViL^!}rA2G|reuY!t+C5R$qV#+hGd zL~NLl$j6+<5s3mCk^0&8h;Y1J_b|s{99Sv`K!hhGO|VDMVXygGM2Jn;IaF{?OTsz* z1#r$6+f50#3*dz~O;Jn3!ViGNC&@-3^-#(M0}nl;sY@fuDGurP;*@*n1cxaRd#}fy zWRWLXBe|g)d8D?9G^UJwmc&ApJ#;~^CxsFsIh}|T7U9s@C#lD1!eiDGp|%|mekref zQrpbaN;rCgYMP^MUn9APILpXA;608mg7QQ2|aUv-c%yqaQ;wZ>)KwK~ONp)qG@FCphI7q8^#o3iS zDqL|0SezxUkZyGr{xwuYC-5_myOaF(S3wcnTY{jthZ15=Jw^2B*7_Dayr!f1M05=; zuB=kwf~nDb43Dll$mP?7Z2YzY=Jgb&4`uQe3+4%<9#Mu^uG-fzt+oX0Nxb|7GK<1@ znUI_aPs!>n@9j zK{*w#n^RY|LZa-s_J0pJkbnb;ryct)nD`9S5RXFQew*P)T%oD5ZBYkoz+(?baYQ{F zih62CW{g(v%)Hu$6*>`~*XAzoyj;Se9l24ZT5ki)sx0r4PtzpC(>WU%n$%NRiy0NK zPsK@kOjchnuD=ABmC>v~aY7^ILA7qEC;07bhav6)%<5v6p?FHBx{aClp>&4BEKgt? zpAn@;|5GEtFwemIA7fWH9JQAy(f diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/CatalogService.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/CatalogService.php deleted file mode 100644 index 5a5a3f68939d..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/CatalogService.php +++ /dev/null @@ -1,70 +0,0 @@ -internalAddGeneratedFile( - ' - -?google/cloud/recommendationengine/v1beta1/catalog_service.proto)google.cloud.recommendationengine.v1beta1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto7google/cloud/recommendationengine/v1beta1/catalog.proto6google/cloud/recommendationengine/v1beta1/import.protoNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto" -CreateCatalogItemRequestC -parent ( B3AA- -+recommendationengine.googleapis.com/CatalogQ - catalog_item ( 26.google.cloud.recommendationengine.v1beta1.CatalogItemBA"b -GetCatalogItemRequestI -name ( B;AA5 -3recommendationengine.googleapis.com/CatalogItemPath" -ListCatalogItemsRequestC -parent ( B3AA- -+recommendationengine.googleapis.com/Catalog - page_size (BA - -page_token ( BA -filter ( BA" -ListCatalogItemsResponseM - catalog_items ( 26.google.cloud.recommendationengine.v1beta1.CatalogItem -next_page_token ( " -UpdateCatalogItemRequestI -name ( B;AA5 -3recommendationengine.googleapis.com/CatalogItemPathQ - catalog_item ( 26.google.cloud.recommendationengine.v1beta1.CatalogItemBA/ - update_mask ( 2.google.protobuf.FieldMask"e -DeleteCatalogItemRequestI -name ( B;AA5 -3recommendationengine.googleapis.com/CatalogItemPath2 -CatalogService -CreateCatalogItemC.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"lP"@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems: catalog_itemAparent,catalog_item -GetCatalogItem@.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"PCA/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}Aname -ListCatalogItemsB.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequestC.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse"XB@/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItemsA parent,filter -UpdateCatalogItemC.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest6.google.cloud.recommendationengine.v1beta1.CatalogItem"wQ2A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}: catalog_itemAname,catalog_item,update_mask -DeleteCatalogItemC.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest.google.protobuf.Empty"PC*A/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}Aname -ImportCatalogItemsD.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest.google.longrunning.Operation"L"G/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import:*A -Dgoogle.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse8google.cloud.recommendationengine.v1beta1.ImportMetadataA,parent,request_id,input_config,errors_configWA#recommendationengine.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB --com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Common.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Common.php deleted file mode 100644 index 9f36cbaebada..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Common.php +++ /dev/null @@ -1,42 +0,0 @@ -internalAddGeneratedFile( - ' - -6google/cloud/recommendationengine/v1beta1/common.proto)google.cloud.recommendationengine.v1beta1" - -FeatureMapl -categorical_features ( 2N.google.cloud.recommendationengine.v1beta1.FeatureMap.CategoricalFeaturesEntryh -numerical_features ( 2L.google.cloud.recommendationengine.v1beta1.FeatureMap.NumericalFeaturesEntry - -StringList -value (  - FloatList -value (| -CategoricalFeaturesEntry -key ( O -value ( 2@.google.cloud.recommendationengine.v1beta1.FeatureMap.StringList:8y -NumericalFeaturesEntry -key ( N -value ( 2?.google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList:8B --com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Import.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/Import.php deleted file mode 100644 index 7c0befb90aadb59abcc28ea41c8758c2339ecbdc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3668 zcmds4-EQMV6yBt4MNeoiyxVQI2r-08n`*ZX?V=)Fx{&m5gG5`>fCMtKTxa4Aa%?kW zS1hP+0z%>jw2y*#2(EbmF1TX;?4+%ib$|=By{h6l-#K&6_nkTCz4zm@7~Vt&IK5!Y#~32`~bJS zAW8=>Yt-_X^PLPuDvFZ41B)T*gpWqQbX;_+Ol!2E;=w;r>0eLYPBBk`Ol_-|#zbqoErx z%uTPK9j2itVn)K?DD-f16)8+{b|sE@PPS1N-?2y&Pm$dX6HG%luy--@D2bDZ9`mD? z<>MqzuK1<7s@)1WGDJ-kqh(zSavLQy#gpC?Q^v@b9M->+=K6K!{$Gesj;f;Oet@( zNZzKF_wrrs!i@><1ByaQ?91z%4D3 zZW!>ssn7RdUgyLi2_7kv+Qz1-yp^bonZa^%;i}T`VKLXvC1;0F8|N`|_4X95a#-c) zT`*LC-lH_4Y$pnb#5ZmO_#Sg&iihNDo`Onq?(vPzJk$nUC?u3`N8_g|+*P&{;jca9hi+>%8RYcI}dpV|7@?p{i0Ip_&G6|$=|1z1{9^B3eO>fdR4?B!!|yKS5%EW z8E}1uf0{1kT~T6nU0Ge@GnmIR2ad*kNn&nKk=yH;R7w813QOu+p8Y&e`&aU`Df9Fe z6iZoAD$kSbttb3R!!Jszo>rkYQ5wU6#avucbdKs!N1=b=l2lw$p}$l{EEPh&naYWP{1+P{Hsd|!d(qK3laC}h}J)dF=Gf2sqVH9sQ@ zn0Iwky~#%Zs+Lt<|DBc_e^j7;UB>^D=y?BHAac@nSUMWH^oeeY?JPgfpAgJ3PLYa`esD^ zmXAY8)z-K-me_T+ik_h#t2cXlJMHe%>gs`9b4)qon!QVF&YoPFOugp(lAX2nPIP4{ zQm1Xc70Dgz_v!-$ZCMiAvWmbhOCLX-m3Mo1FCQ2msO4i~R}qs8@e1}7c~Wf?7jOaa E7trM5umAu6 diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionApikeyRegistryService.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionApikeyRegistryService.php deleted file mode 100644 index 68c28d18d427..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionApikeyRegistryService.php +++ /dev/null @@ -1,55 +0,0 @@ -internalAddGeneratedFile( - ' - -Rgoogle/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service.proto)google.cloud.recommendationengine.v1beta1google/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/empty.protogoogle/api/client.protoNgoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto"/ -PredictionApiKeyRegistration -api_key ( " -)CreatePredictionApiKeyRegistrationRequestF -parent ( B6AA0 -.recommendationengine.googleapis.com/EventStoreu -prediction_api_key_registration ( 2G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistrationBA" -(ListPredictionApiKeyRegistrationsRequestF -parent ( B6AA0 -.recommendationengine.googleapis.com/EventStore - page_size (BA - -page_token ( BA" -)ListPredictionApiKeyRegistrationsResponseq - prediction_api_key_registrations ( 2G.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration -next_page_token ( " -)DeletePredictionApiKeyRegistrationRequestV -name ( BHAAB -@recommendationengine.googleapis.com/PredictionApiKeyRegistration2 -PredictionApiKeyRegistry -"CreatePredictionApiKeyRegistrationT.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequestG.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration"d"_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations:*A&parent,prediction_api_key_registration -!ListPredictionApiKeyRegistrationsS.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequestT.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse"pa_/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrationsAparent -"DeletePredictionApiKeyRegistrationT.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest.google.protobuf.Empty"na*_/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}AnameWA#recommendationengine.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB --com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionService.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionService.php deleted file mode 100644 index f33b7e334437..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/PredictionService.php +++ /dev/null @@ -1,70 +0,0 @@ -internalAddGeneratedFile( - ' - -Bgoogle/cloud/recommendationengine/v1beta1/prediction_service.proto)google.cloud.recommendationengine.v1beta1google/api/field_behavior.protogoogle/api/resource.proto:google/cloud/recommendationengine/v1beta1/user_event.protogoogle/protobuf/struct.protogoogle/api/client.proto" -PredictRequestC -name ( B5AA/ --recommendationengine.googleapis.com/PlacementM - -user_event ( 24.google.cloud.recommendationengine.v1beta1.UserEventBA - page_size (BA - -page_token ( BA -filter ( BA -dry_run (BAZ -params ( 2E.google.cloud.recommendationengine.v1beta1.PredictRequest.ParamsEntryBAZ -labels ( 2E.google.cloud.recommendationengine.v1beta1.PredictRequest.LabelsEntryBAE - ParamsEntry -key ( % -value ( 2.google.protobuf.Value:8- - LabelsEntry -key (  -value ( :8" -PredictResponse\\ -results ( 2K.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult -recommendation_token (  -items_missing_in_catalog (  -dry_run (Z -metadata ( 2H.google.cloud.recommendationengine.v1beta1.PredictResponse.MetadataEntry -next_page_token (  -PredictionResult - -id ( t - item_metadata ( 2].google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult.ItemMetadataEntryK -ItemMetadataEntry -key ( % -value ( 2.google.protobuf.Value:8G - MetadataEntry -key ( % -value ( 2.google.protobuf.Value:82 -PredictionService -Predict9.google.cloud.recommendationengine.v1beta1.PredictRequest:.google.cloud.recommendationengine.v1beta1.PredictResponse"qY"T/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict:*Aname,user_eventWA#recommendationengine.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB --com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/RecommendationengineResources.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/RecommendationengineResources.php deleted file mode 100644 index e09b270728dd..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/RecommendationengineResources.php +++ /dev/null @@ -1,33 +0,0 @@ -internalAddGeneratedFile( - ' - -Ngoogle/cloud/recommendationengine/v1beta1/recommendationengine_resources.proto)google.cloud.recommendationengine.v1beta1B --com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1Ai -+recommendationengine.googleapis.com/Catalog:projects/{project}/locations/{location}/catalogs/{catalog}A -3recommendationengine.googleapis.com/CatalogItemPath[projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}A -.recommendationengine.googleapis.com/EventStoreTprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}A -@recommendationengine.googleapis.com/PredictionApiKeyRegistrationprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}A --recommendationengine.googleapis.com/Placementkprojects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/UserEvent.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/GPBMetadata/Google/Cloud/Recommendationengine/V1Beta1/UserEvent.php deleted file mode 100644 index 4c57575464d3ce7000998b3c07dbe2b31469ac5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3433 zcmb_f-EJF26vmsTNybSNZG$iYsnbxYiPWxDSCnc?3Xbih7ESCXPKChLGTxmyqi%M$ zv$LiK^@0cBh8IBMl1JewxZjgBBx+*OrwAZ7DqJdvWOOYcREy%JH;%e+@n1j2}d1+P(+Stnh>Aj?dIkVD1jYm zZ!5%hMIyHM&OmHGy|XD1A0Xt1Bu()FAlD=?`VnFHOR`SLe4Gk!!^byR>amCkMnd)j zgt~zbNtjZwKCOG0MZR<$OM^z_)3tT1F{SQ}BnE0W@W92UWDA&T*CRoBM8bBJraoth zh}WHDJM6u;29l19b-;K#-j(yZwc^f_^W*ef#rm? zw-^nBO?pInEat8|ifROMmg)K2w=0mUFz&uvOemf>x;W&J{}zKn6682J+g9c6_Csc} zR1Sh+QnsMF*M>AoQg5Q4mXZ7a%i3PowvK8E=d6}+OiQeMcJX6;&9`oym3tEyDpHNz zHDjk55GuDQ2Fz)N)n6{5xnVomA0VU}))W1N7IHYZHn%zTXW6p9LUXE}S#%f|Ecl); z-E}S;wkJE1yY=lLQawEjm%;2x>C1uH`4yv>Q@%Lr|Gt{S z3Viizlpp(Me~b#Xr?uUdx8FF}tJJ)M-Th{*Qs1iAs!Q+L2wg58v>H2)mvZ(3nyXbB zJ3BQ{Te9pWG{0GHRUUZ<&Bu*$b!lq#=Ny_Hq)gUCkEIMooX3Lknpj3Nx+Vfu5vo#h zQk^9p2?9>jRHb$#Q0k-$gS#LTV+0so4H&eI@RXd>7a26SqIgzE`ghKRs#6XgPi35q ze974#qIpi?0^@MyNRcGkz=J4(Grb<8-^&PO^%~Jf=n8$AP!1W51jwYnQv>03w0yFc zJrO^r(YWU=v_$1KtuqarZPUAAjMmhz?i2yB+=2nwvc_g3hiYypHjm8BMsNn!p1y+v|cJJMdcq^&c_V6yUVJ{RECMy`{TK)08jW zpWp}+kV)Vonh9AdDc5vDa5FyP>Vs@8lOFER^D8<^Gz zMU(xHg|0SF3++W@jaPe4ddOw6GpZ`clIE8E3{4C25=fVYlP}fZ&LyWMv1*avedV2m z_v2Kgz|y;buSl#h_!YF^XV5c|-}n4Dprf|2R&F6Q^2W}ispoW1a|>v?N5TOSu5~{r zwMXFRX|Miep@laK;so86eaf|yZ3~qSyCw;}gfpM2F{3h)lZF9HlaTa{Oimgj>!5rJ z>+W+;Zee%`)Kw>Mk2vPU(q?OKVL&O>A_`3Iw6GyHVQM~ zn^D+Diwyd2e3ZJ)!e(|bo=DvAmuJvvllBny%yjz5c4HH1bMJ*x; zOE2&McyMxj>es<<*7RPjQm+4Qt#7Nn-%-1#vv*?euc?=WWA^?(2D)wYNOinternalAddGeneratedFile( - ' - -Bgoogle/cloud/recommendationengine/v1beta1/user_event_service.proto)google.cloud.recommendationengine.v1beta1google/api/field_behavior.protogoogle/api/httpbody.protogoogle/api/resource.proto6google/cloud/recommendationengine/v1beta1/import.proto:google/cloud/recommendationengine/v1beta1/user_event.proto#google/longrunning/operations.protogoogle/protobuf/timestamp.protogoogle/api/client.proto" -PurgeUserEventsRequestF -parent ( B6AA0 -.recommendationengine.googleapis.com/EventStore -filter ( BA -force (BA"b -PurgeUserEventsMetadata -operation_name ( / - create_time ( 2.google.protobuf.Timestamp" -PurgeUserEventsResponse -purged_events_count (P -user_events_sample ( 24.google.cloud.recommendationengine.v1beta1.UserEvent" -WriteUserEventRequestF -parent ( B6AA0 -.recommendationengine.googleapis.com/EventStoreM - -user_event ( 24.google.cloud.recommendationengine.v1beta1.UserEventBA" -CollectUserEventRequestF -parent ( B6AA0 -.recommendationengine.googleapis.com/EventStore - -user_event ( BA -uri ( BA -ets (BA" -ListUserEventsRequestF -parent ( B6AA0 -.recommendationengine.googleapis.com/EventStore - page_size (BA - -page_token ( BA -filter ( BA"| -ListUserEventsResponseI - user_events ( 24.google.cloud.recommendationengine.v1beta1.UserEvent -next_page_token ( 2 -UserEventService -WriteUserEvent@.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest4.google.cloud.recommendationengine.v1beta1.UserEvent"z`"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write: -user_eventAparent,user_event -CollectUserEventB.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest.google.api.HttpBody"xVT/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collectAparent,user_event,uri,ets -ListUserEvents@.google.cloud.recommendationengine.v1beta1.ListUserEventsRequestA.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse"dNL/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEventsA parent,filter -PurgeUserEventsA.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest.google.longrunning.Operation"W"R/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:purge:*A -Agoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsResponseAgoogle.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadataAparent,filter,force -ImportUserEventsB.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest.google.longrunning.Operation"X"S/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:import:*A~ -Bgoogle.cloud.recommendationengine.v1beta1.ImportUserEventsResponse8google.cloud.recommendationengine.v1beta1.ImportMetadataA,parent,request_id,input_config,errors_configWA#recommendationengine.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB --com.google.cloud.recommendationengine.v1beta1PZ]google.golang.org/genproto/googleapis/cloud/recommendationengine/v1beta1;recommendationengineRECAI)Google.Cloud.RecommendationEngine.V1Beta1)Google\\Cloud\\RecommendationEngine\\V1beta1,Google::Cloud::RecommendationEngine::V1beta1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogInlineSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogInlineSource.php deleted file mode 100644 index f2ad496f059b..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogInlineSource.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.recommendationengine.v1beta1.CatalogInlineSource - */ -class CatalogInlineSource extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A list of catalog items to update/create. Recommended max of 10k - * items. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $catalog_items; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem>|\Google\Protobuf\Internal\RepeatedField $catalog_items - * Optional. A list of catalog items to update/create. Recommended max of 10k - * items. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A list of catalog items to update/create. Recommended max of 10k - * items. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCatalogItems() - { - return $this->catalog_items; - } - - /** - * Optional. A list of catalog items to update/create. Recommended max of 10k - * items. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCatalogItems($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem::class); - $this->catalog_items = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem.php deleted file mode 100644 index 6e86c77983ac..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem.php +++ /dev/null @@ -1,473 +0,0 @@ -google.cloud.recommendationengine.v1beta1.CatalogItem - */ -class CatalogItem extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Catalog item identifier. UTF-8 encoded string with a length limit - * of 128 bytes. - * This id must be unique among all catalog items within the same catalog. It - * should also be used when logging user events in order for the user events - * to be joined with the Catalog. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $id = ''; - /** - * Required. Catalog item categories. This field is repeated for supporting - * one catalog item belonging to several parallel category hierarchies. - * For example, if a shoes product belongs to both - * ["Shoes & Accessories" -> "Shoes"] and - * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - * represented as: - * "categoryHierarchies": [ - * { "categories": ["Shoes & Accessories", "Shoes"]}, - * { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } - * ] - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $category_hierarchies; - /** - * Required. Catalog item title. UTF-8 encoded string with a length limit of 1 - * KiB. - * - * Generated from protobuf field string title = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $title = ''; - /** - * Optional. Catalog item description. UTF-8 encoded string with a length - * limit of 5 KiB. - * - * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $description = ''; - /** - * Optional. Highly encouraged. Extra catalog item attributes to be - * included in the recommendation model. For example, for retail products, - * this could include the store name, vendor, style, color, etc. These are - * very strong signals for recommendation model, thus we highly recommend - * providing the item attributes here. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $item_attributes = null; - /** - * Optional. Language of the title/description/item_attributes. Use language - * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our - * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', - * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact - * your Google account manager. - * - * Generated from protobuf field string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $language_code = ''; - /** - * Optional. Filtering tags associated with the catalog item. Each tag should - * be a UTF-8 encoded string with a length limit of 1 KiB. - * This tag can be used for filtering recommendation results by passing the - * tag as part of the predict request filter. - * - * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $tags; - /** - * Optional. Variant group identifier for prediction results. UTF-8 encoded - * string with a length limit of 128 bytes. - * This field must be enabled before it can be used. [Learn - * more](/recommendations-ai/docs/catalog#item-group-id). - * - * Generated from protobuf field string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $item_group_id = ''; - protected $recommendation_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * Required. Catalog item identifier. UTF-8 encoded string with a length limit - * of 128 bytes. - * This id must be unique among all catalog items within the same catalog. It - * should also be used when logging user events in order for the user events - * to be joined with the Catalog. - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy>|\Google\Protobuf\Internal\RepeatedField $category_hierarchies - * Required. Catalog item categories. This field is repeated for supporting - * one catalog item belonging to several parallel category hierarchies. - * For example, if a shoes product belongs to both - * ["Shoes & Accessories" -> "Shoes"] and - * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - * represented as: - * "categoryHierarchies": [ - * { "categories": ["Shoes & Accessories", "Shoes"]}, - * { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } - * ] - * @type string $title - * Required. Catalog item title. UTF-8 encoded string with a length limit of 1 - * KiB. - * @type string $description - * Optional. Catalog item description. UTF-8 encoded string with a length - * limit of 5 KiB. - * @type \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $item_attributes - * Optional. Highly encouraged. Extra catalog item attributes to be - * included in the recommendation model. For example, for retail products, - * this could include the store name, vendor, style, color, etc. These are - * very strong signals for recommendation model, thus we highly recommend - * providing the item attributes here. - * @type string $language_code - * Optional. Language of the title/description/item_attributes. Use language - * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our - * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', - * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact - * your Google account manager. - * @type array|\Google\Protobuf\Internal\RepeatedField $tags - * Optional. Filtering tags associated with the catalog item. Each tag should - * be a UTF-8 encoded string with a length limit of 1 KiB. - * This tag can be used for filtering recommendation results by passing the - * tag as part of the predict request filter. - * @type string $item_group_id - * Optional. Variant group identifier for prediction results. UTF-8 encoded - * string with a length limit of 128 bytes. - * This field must be enabled before it can be used. [Learn - * more](/recommendations-ai/docs/catalog#item-group-id). - * @type \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem $product_metadata - * Optional. Metadata specific to retail products. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. Catalog item identifier. UTF-8 encoded string with a length limit - * of 128 bytes. - * This id must be unique among all catalog items within the same catalog. It - * should also be used when logging user events in order for the user events - * to be joined with the Catalog. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Required. Catalog item identifier. UTF-8 encoded string with a length limit - * of 128 bytes. - * This id must be unique among all catalog items within the same catalog. It - * should also be used when logging user events in order for the user events - * to be joined with the Catalog. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Required. Catalog item categories. This field is repeated for supporting - * one catalog item belonging to several parallel category hierarchies. - * For example, if a shoes product belongs to both - * ["Shoes & Accessories" -> "Shoes"] and - * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - * represented as: - * "categoryHierarchies": [ - * { "categories": ["Shoes & Accessories", "Shoes"]}, - * { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } - * ] - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCategoryHierarchies() - { - return $this->category_hierarchies; - } - - /** - * Required. Catalog item categories. This field is repeated for supporting - * one catalog item belonging to several parallel category hierarchies. - * For example, if a shoes product belongs to both - * ["Shoes & Accessories" -> "Shoes"] and - * ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be - * represented as: - * "categoryHierarchies": [ - * { "categories": ["Shoes & Accessories", "Shoes"]}, - * { "categories": ["Sports & Fitness", "Athletic Clothing", "Shoes"] } - * ] - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCategoryHierarchies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy::class); - $this->category_hierarchies = $arr; - - return $this; - } - - /** - * Required. Catalog item title. UTF-8 encoded string with a length limit of 1 - * KiB. - * - * Generated from protobuf field string title = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Required. Catalog item title. UTF-8 encoded string with a length limit of 1 - * KiB. - * - * Generated from protobuf field string title = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTitle($var) - { - GPBUtil::checkString($var, True); - $this->title = $var; - - return $this; - } - - /** - * Optional. Catalog item description. UTF-8 encoded string with a length - * limit of 5 KiB. - * - * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Optional. Catalog item description. UTF-8 encoded string with a length - * limit of 5 KiB. - * - * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Optional. Highly encouraged. Extra catalog item attributes to be - * included in the recommendation model. For example, for retail products, - * this could include the store name, vendor, style, color, etc. These are - * very strong signals for recommendation model, thus we highly recommend - * providing the item attributes here. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap|null - */ - public function getItemAttributes() - { - return $this->item_attributes; - } - - public function hasItemAttributes() - { - return isset($this->item_attributes); - } - - public function clearItemAttributes() - { - unset($this->item_attributes); - } - - /** - * Optional. Highly encouraged. Extra catalog item attributes to be - * included in the recommendation model. For example, for retail products, - * this could include the store name, vendor, style, color, etc. These are - * very strong signals for recommendation model, thus we highly recommend - * providing the item attributes here. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $var - * @return $this - */ - public function setItemAttributes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap::class); - $this->item_attributes = $var; - - return $this; - } - - /** - * Optional. Language of the title/description/item_attributes. Use language - * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our - * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', - * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact - * your Google account manager. - * - * Generated from protobuf field string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getLanguageCode() - { - return $this->language_code; - } - - /** - * Optional. Language of the title/description/item_attributes. Use language - * tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our - * supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', - * 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact - * your Google account manager. - * - * Generated from protobuf field string language_code = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setLanguageCode($var) - { - GPBUtil::checkString($var, True); - $this->language_code = $var; - - return $this; - } - - /** - * Optional. Filtering tags associated with the catalog item. Each tag should - * be a UTF-8 encoded string with a length limit of 1 KiB. - * This tag can be used for filtering recommendation results by passing the - * tag as part of the predict request filter. - * - * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTags() - { - return $this->tags; - } - - /** - * Optional. Filtering tags associated with the catalog item. Each tag should - * be a UTF-8 encoded string with a length limit of 1 KiB. - * This tag can be used for filtering recommendation results by passing the - * tag as part of the predict request filter. - * - * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->tags = $arr; - - return $this; - } - - /** - * Optional. Variant group identifier for prediction results. UTF-8 encoded - * string with a length limit of 128 bytes. - * This field must be enabled before it can be used. [Learn - * more](/recommendations-ai/docs/catalog#item-group-id). - * - * Generated from protobuf field string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getItemGroupId() - { - return $this->item_group_id; - } - - /** - * Optional. Variant group identifier for prediction results. UTF-8 encoded - * string with a length limit of 128 bytes. - * This field must be enabled before it can be used. [Learn - * more](/recommendations-ai/docs/catalog#item-group-id). - * - * Generated from protobuf field string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setItemGroupId($var) - { - GPBUtil::checkString($var, True); - $this->item_group_id = $var; - - return $this; - } - - /** - * Optional. Metadata specific to retail products. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem|null - */ - public function getProductMetadata() - { - return $this->readOneof(10); - } - - public function hasProductMetadata() - { - return $this->hasOneof(10); - } - - /** - * Optional. Metadata specific to retail products. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem $var - * @return $this - */ - public function setProductMetadata($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * @return string - */ - public function getRecommendationType() - { - return $this->whichOneof("recommendation_type"); - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem/CategoryHierarchy.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem/CategoryHierarchy.php deleted file mode 100644 index 560a234a76f5..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem/CategoryHierarchy.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy - */ -class CategoryHierarchy extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Catalog item categories. Each category should be a UTF-8 - * encoded string with a length limit of 2 KiB. - * Note that the order in the list denotes the specificity (from least to - * most specific). - * - * Generated from protobuf field repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $categories; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $categories - * Required. Catalog item categories. Each category should be a UTF-8 - * encoded string with a length limit of 2 KiB. - * Note that the order in the list denotes the specificity (from least to - * most specific). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. Catalog item categories. Each category should be a UTF-8 - * encoded string with a length limit of 2 KiB. - * Note that the order in the list denotes the specificity (from least to - * most specific). - * - * Generated from protobuf field repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCategories() - { - return $this->categories; - } - - /** - * Required. Catalog item categories. Each category should be a UTF-8 - * encoded string with a length limit of 2 KiB. - * Note that the order in the list denotes the specificity (from least to - * most specific). - * - * Generated from protobuf field repeated string categories = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCategories($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->categories = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CategoryHierarchy::class, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem_CategoryHierarchy::class); - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem_CategoryHierarchy.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem_CategoryHierarchy.php deleted file mode 100644 index e079386dd9eb..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CatalogItem_CategoryHierarchy.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/CreateCatalogItem', - $argument, - ['\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', 'decode'], - $metadata, $options); - } - - /** - * Gets a specific catalog item. - * @param \Google\Cloud\RecommendationEngine\V1beta1\GetCatalogItemRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetCatalogItem(\Google\Cloud\RecommendationEngine\V1beta1\GetCatalogItemRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/GetCatalogItem', - $argument, - ['\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', 'decode'], - $metadata, $options); - } - - /** - * Gets a list of catalog items. - * @param \Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListCatalogItems(\Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/ListCatalogItems', - $argument, - ['\Google\Cloud\RecommendationEngine\V1beta1\ListCatalogItemsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates a catalog item. Partial updating is supported. Non-existing - * items will be created. - * @param \Google\Cloud\RecommendationEngine\V1beta1\UpdateCatalogItemRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateCatalogItem(\Google\Cloud\RecommendationEngine\V1beta1\UpdateCatalogItemRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/UpdateCatalogItem', - $argument, - ['\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem', 'decode'], - $metadata, $options); - } - - /** - * Deletes a catalog item. - * @param \Google\Cloud\RecommendationEngine\V1beta1\DeleteCatalogItemRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteCatalogItem(\Google\Cloud\RecommendationEngine\V1beta1\DeleteCatalogItemRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/DeleteCatalogItem', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Bulk import of multiple catalog items. Request processing may be - * synchronous. No partial updating supported. Non-existing items will be - * created. - * - * Operation.response is of type ImportResponse. Note that it is - * possible for a subset of the items to be successfully updated. - * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportCatalogItemsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportCatalogItems(\Google\Cloud\RecommendationEngine\V1beta1\ImportCatalogItemsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.CatalogService/ImportCatalogItems', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php deleted file mode 100644 index 81d1b23439fd..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CollectUserEventRequest.php +++ /dev/null @@ -1,193 +0,0 @@ -google.cloud.recommendationengine.v1beta1.CollectUserEventRequest - */ -class CollectUserEventRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent eventStore name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. URL encoded UserEvent proto. - * - * Generated from protobuf field string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_event = ''; - /** - * Optional. The url including cgi-parameters but excluding the hash fragment. - * The URL must be truncated to 1.5K bytes to conservatively be under the 2K - * bytes. This is often more useful than the referer url, because many - * browsers only send the domain for 3rd party requests. - * - * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $uri = ''; - /** - * Optional. The event timestamp in milliseconds. This prevents browser - * caching of otherwise identical get requests. The name is abbreviated to - * reduce the payload bytes. - * - * Generated from protobuf field int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ets = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent eventStore name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * @type string $user_event - * Required. URL encoded UserEvent proto. - * @type string $uri - * Optional. The url including cgi-parameters but excluding the hash fragment. - * The URL must be truncated to 1.5K bytes to conservatively be under the 2K - * bytes. This is often more useful than the referer url, because many - * browsers only send the domain for 3rd party requests. - * @type int|string $ets - * Optional. The event timestamp in milliseconds. This prevents browser - * caching of otherwise identical get requests. The name is abbreviated to - * reduce the payload bytes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent eventStore name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent eventStore name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. URL encoded UserEvent proto. - * - * Generated from protobuf field string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUserEvent() - { - return $this->user_event; - } - - /** - * Required. URL encoded UserEvent proto. - * - * Generated from protobuf field string user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUserEvent($var) - { - GPBUtil::checkString($var, True); - $this->user_event = $var; - - return $this; - } - - /** - * Optional. The url including cgi-parameters but excluding the hash fragment. - * The URL must be truncated to 1.5K bytes to conservatively be under the 2K - * bytes. This is often more useful than the referer url, because many - * browsers only send the domain for 3rd party requests. - * - * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Optional. The url including cgi-parameters but excluding the hash fragment. - * The URL must be truncated to 1.5K bytes to conservatively be under the 2K - * bytes. This is often more useful than the referer url, because many - * browsers only send the domain for 3rd party requests. - * - * Generated from protobuf field string uri = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Optional. The event timestamp in milliseconds. This prevents browser - * caching of otherwise identical get requests. The name is abbreviated to - * reduce the payload bytes. - * - * Generated from protobuf field int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getEts() - { - return $this->ets; - } - - /** - * Optional. The event timestamp in milliseconds. This prevents browser - * caching of otherwise identical get requests. The name is abbreviated to - * reduce the payload bytes. - * - * Generated from protobuf field int64 ets = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setEts($var) - { - GPBUtil::checkInt64($var); - $this->ets = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php deleted file mode 100644 index 3090166caf60..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreateCatalogItemRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest - */ -class CreateCatalogItemRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The catalog item to create. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $catalog_item = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * @type \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalog_item - * Required. The catalog item to create. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The catalog item to create. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem|null - */ - public function getCatalogItem() - { - return $this->catalog_item; - } - - public function hasCatalogItem() - { - return isset($this->catalog_item); - } - - public function clearCatalogItem() - { - unset($this->catalog_item); - } - - /** - * Required. The catalog item to create. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $var - * @return $this - */ - public function setCatalogItem($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem::class); - $this->catalog_item = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php deleted file mode 100644 index bab271dd773d..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/CreatePredictionApiKeyRegistrationRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest - */ -class CreatePredictionApiKeyRegistrationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The prediction API key registration. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $prediction_api_key_registration = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * @type \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration $prediction_api_key_registration - * Required. The prediction API key registration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The prediction API key registration. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration|null - */ - public function getPredictionApiKeyRegistration() - { - return $this->prediction_api_key_registration; - } - - public function hasPredictionApiKeyRegistration() - { - return isset($this->prediction_api_key_registration); - } - - public function clearPredictionApiKeyRegistration() - { - unset($this->prediction_api_key_registration); - } - - /** - * Required. The prediction API key registration. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registration = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration $var - * @return $this - */ - public function setPredictionApiKeyRegistration($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration::class); - $this->prediction_api_key_registration = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php deleted file mode 100644 index 0cad6e0d9b42..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeleteCatalogItemRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest - */ -class DeleteCatalogItemRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php deleted file mode 100644 index 79e2b3e61c1c..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/DeletePredictionApiKeyRegistrationRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest - */ -class DeletePredictionApiKeyRegistrationRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The API key to unregister including full resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The API key to unregister including full resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The API key to unregister including full resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The API key to unregister including full resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/EventDetail.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/EventDetail.php deleted file mode 100644 index 25740f69bf0a..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/EventDetail.php +++ /dev/null @@ -1,359 +0,0 @@ -google.cloud.recommendationengine.v1beta1.EventDetail - */ -class EventDetail extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Complete url (window.location.href) of the user's current page. - * When using the JavaScript pixel, this value is filled in automatically. - * Maximum length 5KB. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $uri = ''; - /** - * Optional. The referrer url of the current page. When using - * the JavaScript pixel, this value is filled in automatically. - * - * Generated from protobuf field string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $referrer_uri = ''; - /** - * Optional. A unique id of a web page view. - * This should be kept the same for all user events triggered from the same - * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. - * The `pageViewId` property should be kept the same for all these events so - * that they can be grouped together properly. This `pageViewId` will be - * automatically generated if using the JavaScript pixel. - * - * Generated from protobuf field string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_view_id = ''; - /** - * Optional. A list of identifiers for the independent experiment groups - * this user event belongs to. This is used to distinguish between user events - * associated with different experiment setups (e.g. using Recommendation - * Engine system, using different recommendation models). - * - * Generated from protobuf field repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $experiment_ids; - /** - * Optional. Recommendation token included in the recommendation prediction - * response. - * This field enables accurate attribution of recommendation model - * performance. - * This token enables us to accurately attribute page view or purchase back to - * the event and the particular predict response containing this - * clicked/purchased item. If user clicks on product K in the recommendation - * results, pass the `PredictResponse.recommendationToken` property as a url - * parameter to product K's page. When recording events on product K's page, - * log the PredictResponse.recommendation_token to this field. - * Optional, but highly encouraged for user events that are the result of a - * recommendation prediction query. - * - * Generated from protobuf field string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $recommendation_token = ''; - /** - * Optional. Extra user event features to include in the recommendation - * model. - * For product recommendation, an example of extra user information is - * traffic_channel, i.e. how user arrives at the site. Users can arrive - * at the site by coming to the site directly, or coming through Google - * search, and etc. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $event_attributes = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Optional. Complete url (window.location.href) of the user's current page. - * When using the JavaScript pixel, this value is filled in automatically. - * Maximum length 5KB. - * @type string $referrer_uri - * Optional. The referrer url of the current page. When using - * the JavaScript pixel, this value is filled in automatically. - * @type string $page_view_id - * Optional. A unique id of a web page view. - * This should be kept the same for all user events triggered from the same - * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. - * The `pageViewId` property should be kept the same for all these events so - * that they can be grouped together properly. This `pageViewId` will be - * automatically generated if using the JavaScript pixel. - * @type array|\Google\Protobuf\Internal\RepeatedField $experiment_ids - * Optional. A list of identifiers for the independent experiment groups - * this user event belongs to. This is used to distinguish between user events - * associated with different experiment setups (e.g. using Recommendation - * Engine system, using different recommendation models). - * @type string $recommendation_token - * Optional. Recommendation token included in the recommendation prediction - * response. - * This field enables accurate attribution of recommendation model - * performance. - * This token enables us to accurately attribute page view or purchase back to - * the event and the particular predict response containing this - * clicked/purchased item. If user clicks on product K in the recommendation - * results, pass the `PredictResponse.recommendationToken` property as a url - * parameter to product K's page. When recording events on product K's page, - * log the PredictResponse.recommendation_token to this field. - * Optional, but highly encouraged for user events that are the result of a - * recommendation prediction query. - * @type \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $event_attributes - * Optional. Extra user event features to include in the recommendation - * model. - * For product recommendation, an example of extra user information is - * traffic_channel, i.e. how user arrives at the site. Users can arrive - * at the site by coming to the site directly, or coming through Google - * search, and etc. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Complete url (window.location.href) of the user's current page. - * When using the JavaScript pixel, this value is filled in automatically. - * Maximum length 5KB. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Optional. Complete url (window.location.href) of the user's current page. - * When using the JavaScript pixel, this value is filled in automatically. - * Maximum length 5KB. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Optional. The referrer url of the current page. When using - * the JavaScript pixel, this value is filled in automatically. - * - * Generated from protobuf field string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getReferrerUri() - { - return $this->referrer_uri; - } - - /** - * Optional. The referrer url of the current page. When using - * the JavaScript pixel, this value is filled in automatically. - * - * Generated from protobuf field string referrer_uri = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setReferrerUri($var) - { - GPBUtil::checkString($var, True); - $this->referrer_uri = $var; - - return $this; - } - - /** - * Optional. A unique id of a web page view. - * This should be kept the same for all user events triggered from the same - * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. - * The `pageViewId` property should be kept the same for all these events so - * that they can be grouped together properly. This `pageViewId` will be - * automatically generated if using the JavaScript pixel. - * - * Generated from protobuf field string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageViewId() - { - return $this->page_view_id; - } - - /** - * Optional. A unique id of a web page view. - * This should be kept the same for all user events triggered from the same - * pageview. For example, an item detail page view could trigger multiple - * events as the user is browsing the page. - * The `pageViewId` property should be kept the same for all these events so - * that they can be grouped together properly. This `pageViewId` will be - * automatically generated if using the JavaScript pixel. - * - * Generated from protobuf field string page_view_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageViewId($var) - { - GPBUtil::checkString($var, True); - $this->page_view_id = $var; - - return $this; - } - - /** - * Optional. A list of identifiers for the independent experiment groups - * this user event belongs to. This is used to distinguish between user events - * associated with different experiment setups (e.g. using Recommendation - * Engine system, using different recommendation models). - * - * Generated from protobuf field repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExperimentIds() - { - return $this->experiment_ids; - } - - /** - * Optional. A list of identifiers for the independent experiment groups - * this user event belongs to. This is used to distinguish between user events - * associated with different experiment setups (e.g. using Recommendation - * Engine system, using different recommendation models). - * - * Generated from protobuf field repeated string experiment_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExperimentIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->experiment_ids = $arr; - - return $this; - } - - /** - * Optional. Recommendation token included in the recommendation prediction - * response. - * This field enables accurate attribution of recommendation model - * performance. - * This token enables us to accurately attribute page view or purchase back to - * the event and the particular predict response containing this - * clicked/purchased item. If user clicks on product K in the recommendation - * results, pass the `PredictResponse.recommendationToken` property as a url - * parameter to product K's page. When recording events on product K's page, - * log the PredictResponse.recommendation_token to this field. - * Optional, but highly encouraged for user events that are the result of a - * recommendation prediction query. - * - * Generated from protobuf field string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRecommendationToken() - { - return $this->recommendation_token; - } - - /** - * Optional. Recommendation token included in the recommendation prediction - * response. - * This field enables accurate attribution of recommendation model - * performance. - * This token enables us to accurately attribute page view or purchase back to - * the event and the particular predict response containing this - * clicked/purchased item. If user clicks on product K in the recommendation - * results, pass the `PredictResponse.recommendationToken` property as a url - * parameter to product K's page. When recording events on product K's page, - * log the PredictResponse.recommendation_token to this field. - * Optional, but highly encouraged for user events that are the result of a - * recommendation prediction query. - * - * Generated from protobuf field string recommendation_token = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRecommendationToken($var) - { - GPBUtil::checkString($var, True); - $this->recommendation_token = $var; - - return $this; - } - - /** - * Optional. Extra user event features to include in the recommendation - * model. - * For product recommendation, an example of extra user information is - * traffic_channel, i.e. how user arrives at the site. Users can arrive - * at the site by coming to the site directly, or coming through Google - * search, and etc. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap|null - */ - public function getEventAttributes() - { - return $this->event_attributes; - } - - public function hasEventAttributes() - { - return isset($this->event_attributes); - } - - public function clearEventAttributes() - { - unset($this->event_attributes); - } - - /** - * Optional. Extra user event features to include in the recommendation - * model. - * For product recommendation, an example of extra user information is - * traffic_channel, i.e. how user arrives at the site. Users can arrive - * at the site by coming to the site directly, or coming through Google - * search, and etc. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap event_attributes = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $var - * @return $this - */ - public function setEventAttributes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap::class); - $this->event_attributes = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap.php deleted file mode 100644 index 0578372686e8..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.recommendationengine.v1beta1.FeatureMap - */ -class FeatureMap extends \Google\Protobuf\Internal\Message -{ - /** - * Categorical features that can take on one of a limited number of possible - * values. Some examples would be the brand/maker of a product, or country of - * a customer. - * Feature names and values must be UTF-8 encoded strings. - * For example: `{ "colors": {"value": ["yellow", "green"]}, - * "sizes": {"value":["S", "M"]}` - * - * Generated from protobuf field map categorical_features = 1; - */ - private $categorical_features; - /** - * Numerical features. Some examples would be the height/weight of a product, - * or age of a customer. - * Feature names must be UTF-8 encoded strings. - * For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, - * "heights_cm": {"value":[8.1, 6.4]} }` - * - * Generated from protobuf field map numerical_features = 2; - */ - private $numerical_features; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $categorical_features - * Categorical features that can take on one of a limited number of possible - * values. Some examples would be the brand/maker of a product, or country of - * a customer. - * Feature names and values must be UTF-8 encoded strings. - * For example: `{ "colors": {"value": ["yellow", "green"]}, - * "sizes": {"value":["S", "M"]}` - * @type array|\Google\Protobuf\Internal\MapField $numerical_features - * Numerical features. Some examples would be the height/weight of a product, - * or age of a customer. - * Feature names must be UTF-8 encoded strings. - * For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, - * "heights_cm": {"value":[8.1, 6.4]} }` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Common::initOnce(); - parent::__construct($data); - } - - /** - * Categorical features that can take on one of a limited number of possible - * values. Some examples would be the brand/maker of a product, or country of - * a customer. - * Feature names and values must be UTF-8 encoded strings. - * For example: `{ "colors": {"value": ["yellow", "green"]}, - * "sizes": {"value":["S", "M"]}` - * - * Generated from protobuf field map categorical_features = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getCategoricalFeatures() - { - return $this->categorical_features; - } - - /** - * Categorical features that can take on one of a limited number of possible - * values. Some examples would be the brand/maker of a product, or country of - * a customer. - * Feature names and values must be UTF-8 encoded strings. - * For example: `{ "colors": {"value": ["yellow", "green"]}, - * "sizes": {"value":["S", "M"]}` - * - * Generated from protobuf field map categorical_features = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setCategoricalFeatures($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap\StringList::class); - $this->categorical_features = $arr; - - return $this; - } - - /** - * Numerical features. Some examples would be the height/weight of a product, - * or age of a customer. - * Feature names must be UTF-8 encoded strings. - * For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, - * "heights_cm": {"value":[8.1, 6.4]} }` - * - * Generated from protobuf field map numerical_features = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getNumericalFeatures() - { - return $this->numerical_features; - } - - /** - * Numerical features. Some examples would be the height/weight of a product, - * or age of a customer. - * Feature names must be UTF-8 encoded strings. - * For example: `{ "lengths_cm": {"value":[2.3, 15.4]}, - * "heights_cm": {"value":[8.1, 6.4]} }` - * - * Generated from protobuf field map numerical_features = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setNumericalFeatures($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap\FloatList::class); - $this->numerical_features = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/FloatList.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/FloatList.php deleted file mode 100644 index a0245cbe9b4a..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/FloatList.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList - */ -class FloatList extends \Google\Protobuf\Internal\Message -{ - /** - * Float feature value. - * - * Generated from protobuf field repeated float value = 1; - */ - private $value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $value - * Float feature value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Common::initOnce(); - parent::__construct($data); - } - - /** - * Float feature value. - * - * Generated from protobuf field repeated float value = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValue() - { - return $this->value; - } - - /** - * Float feature value. - * - * Generated from protobuf field repeated float value = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValue($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FLOAT); - $this->value = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FloatList::class, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap_FloatList::class); - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/StringList.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/StringList.php deleted file mode 100644 index 20808ae96283..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap/StringList.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.recommendationengine.v1beta1.FeatureMap.StringList - */ -class StringList extends \Google\Protobuf\Internal\Message -{ - /** - * String feature value with a length limit of 128 bytes. - * - * Generated from protobuf field repeated string value = 1; - */ - private $value; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $value - * String feature value with a length limit of 128 bytes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Common::initOnce(); - parent::__construct($data); - } - - /** - * String feature value with a length limit of 128 bytes. - * - * Generated from protobuf field repeated string value = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValue() - { - return $this->value; - } - - /** - * String feature value with a length limit of 128 bytes. - * - * Generated from protobuf field repeated string value = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValue($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->value = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StringList::class, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap_StringList::class); - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_FloatList.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_FloatList.php deleted file mode 100644 index 9e54e7f448b9..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/FeatureMap_FloatList.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.recommendationengine.v1beta1.GcsSource - */ -class GcsSource extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Google Cloud Storage URIs to input files. URI can be up to - * 2000 characters long. URIs can match the full object path (for example, - * `gs://bucket/directory/object.json`) or a pattern matching one or more - * files, such as `gs://bucket/directory/*.json`. A request can - * contain at most 100 files, and each file can be up to 2 GB. See - * [Importing catalog information](/recommendations-ai/docs/upload-catalog) - * for the expected file format and setup instructions. - * - * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $input_uris; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $input_uris - * Required. Google Cloud Storage URIs to input files. URI can be up to - * 2000 characters long. URIs can match the full object path (for example, - * `gs://bucket/directory/object.json`) or a pattern matching one or more - * files, such as `gs://bucket/directory/*.json`. A request can - * contain at most 100 files, and each file can be up to 2 GB. See - * [Importing catalog information](/recommendations-ai/docs/upload-catalog) - * for the expected file format and setup instructions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * Required. Google Cloud Storage URIs to input files. URI can be up to - * 2000 characters long. URIs can match the full object path (for example, - * `gs://bucket/directory/object.json`) or a pattern matching one or more - * files, such as `gs://bucket/directory/*.json`. A request can - * contain at most 100 files, and each file can be up to 2 GB. See - * [Importing catalog information](/recommendations-ai/docs/upload-catalog) - * for the expected file format and setup instructions. - * - * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInputUris() - { - return $this->input_uris; - } - - /** - * Required. Google Cloud Storage URIs to input files. URI can be up to - * 2000 characters long. URIs can match the full object path (for example, - * `gs://bucket/directory/object.json`) or a pattern matching one or more - * files, such as `gs://bucket/directory/*.json`. A request can - * contain at most 100 files, and each file can be up to 2 GB. See - * [Importing catalog information](/recommendations-ai/docs/upload-catalog) - * for the expected file format and setup instructions. - * - * Generated from protobuf field repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInputUris($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->input_uris = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php deleted file mode 100644 index d992f00e0769..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/GetCatalogItemRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest - */ -class GetCatalogItemRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/Image.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/Image.php deleted file mode 100644 index 5790795608f8..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/Image.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.recommendationengine.v1beta1.Image - */ -class Image extends \Google\Protobuf\Internal\Message -{ - /** - * Required. URL of the image with a length limit of 5 KiB. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $uri = ''; - /** - * Optional. Height of the image in number of pixels. - * - * Generated from protobuf field int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $height = 0; - /** - * Optional. Width of the image in number of pixels. - * - * Generated from protobuf field int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $width = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * Required. URL of the image with a length limit of 5 KiB. - * @type int $height - * Optional. Height of the image in number of pixels. - * @type int $width - * Optional. Width of the image in number of pixels. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. URL of the image with a length limit of 5 KiB. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Required. URL of the image with a length limit of 5 KiB. - * - * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Optional. Height of the image in number of pixels. - * - * Generated from protobuf field int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getHeight() - { - return $this->height; - } - - /** - * Optional. Height of the image in number of pixels. - * - * Generated from protobuf field int32 height = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setHeight($var) - { - GPBUtil::checkInt32($var); - $this->height = $var; - - return $this; - } - - /** - * Optional. Width of the image in number of pixels. - * - * Generated from protobuf field int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getWidth() - { - return $this->width; - } - - /** - * Optional. Width of the image in number of pixels. - * - * Generated from protobuf field int32 width = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setWidth($var) - { - GPBUtil::checkInt32($var); - $this->width = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php deleted file mode 100644 index 941ab5b83ca0..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsRequest.php +++ /dev/null @@ -1,201 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest - */ -class ImportCatalogItemsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. `projects/1234/locations/global/catalogs/default_catalog` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency and used for request deduplication. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input_config = null; - /** - * Optional. The desired location of errors incurred during the Import. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $errors_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. `projects/1234/locations/global/catalogs/default_catalog` - * @type string $request_id - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency and used for request deduplication. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. - * @type \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $input_config - * Required. The desired input location of the data. - * @type \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errors_config - * Optional. The desired location of errors incurred during the Import. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * Required. `projects/1234/locations/global/catalogs/default_catalog` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. `projects/1234/locations/global/catalogs/default_catalog` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency and used for request deduplication. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency and used for request deduplication. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\InputConfig|null - */ - public function getInputConfig() - { - return $this->input_config; - } - - public function hasInputConfig() - { - return isset($this->input_config); - } - - public function clearInputConfig() - { - unset($this->input_config); - } - - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $var - * @return $this - */ - public function setInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\InputConfig::class); - $this->input_config = $var; - - return $this; - } - - /** - * Optional. The desired location of errors incurred during the Import. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig|null - */ - public function getErrorsConfig() - { - return $this->errors_config; - } - - public function hasErrorsConfig() - { - return isset($this->errors_config); - } - - public function clearErrorsConfig() - { - unset($this->errors_config); - } - - /** - * Optional. The desired location of errors incurred during the Import. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $var - * @return $this - */ - public function setErrorsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig::class); - $this->errors_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsResponse.php deleted file mode 100644 index f1d250f54aed..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportCatalogItemsResponse.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse - */ -class ImportCatalogItemsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A sample of errors encountered while processing the request. - * - * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; - */ - private $error_samples; - /** - * Echoes the destination for the complete errors in the request if set. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; - */ - protected $errors_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $error_samples - * A sample of errors encountered while processing the request. - * @type \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errors_config - * Echoes the destination for the complete errors in the request if set. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * A sample of errors encountered while processing the request. - * - * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrorSamples() - { - return $this->error_samples; - } - - /** - * A sample of errors encountered while processing the request. - * - * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; - * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrorSamples($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->error_samples = $arr; - - return $this; - } - - /** - * Echoes the destination for the complete errors in the request if set. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; - * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig|null - */ - public function getErrorsConfig() - { - return $this->errors_config; - } - - public function hasErrorsConfig() - { - return isset($this->errors_config); - } - - public function clearErrorsConfig() - { - unset($this->errors_config); - } - - /** - * Echoes the destination for the complete errors in the request if set. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; - * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $var - * @return $this - */ - public function setErrorsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig::class); - $this->errors_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportErrorsConfig.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportErrorsConfig.php deleted file mode 100644 index 0a56f1f1b5a6..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportErrorsConfig.php +++ /dev/null @@ -1,84 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ImportErrorsConfig - */ -class ImportErrorsConfig extends \Google\Protobuf\Internal\Message -{ - protected $destination; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $gcs_prefix - * Google Cloud Storage path for import errors. This must be an empty, - * existing Cloud Storage bucket. Import errors will be written to a file in - * this bucket, one per line, as a JSON-encoded - * `google.rpc.Status` message. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * Google Cloud Storage path for import errors. This must be an empty, - * existing Cloud Storage bucket. Import errors will be written to a file in - * this bucket, one per line, as a JSON-encoded - * `google.rpc.Status` message. - * - * Generated from protobuf field string gcs_prefix = 1; - * @return string - */ - public function getGcsPrefix() - { - return $this->readOneof(1); - } - - public function hasGcsPrefix() - { - return $this->hasOneof(1); - } - - /** - * Google Cloud Storage path for import errors. This must be an empty, - * existing Cloud Storage bucket. Import errors will be written to a file in - * this bucket, one per line, as a JSON-encoded - * `google.rpc.Status` message. - * - * Generated from protobuf field string gcs_prefix = 1; - * @param string $var - * @return $this - */ - public function setGcsPrefix($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getDestination() - { - return $this->whichOneof("destination"); - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportMetadata.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportMetadata.php deleted file mode 100644 index df36e57fb55e..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportMetadata.php +++ /dev/null @@ -1,266 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ImportMetadata - */ -class ImportMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Name of the operation. - * - * Generated from protobuf field string operation_name = 5; - */ - protected $operation_name = ''; - /** - * Id of the request / operation. This is parroting back the requestId that - * was passed in the request. - * - * Generated from protobuf field string request_id = 3; - */ - protected $request_id = ''; - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; - */ - protected $create_time = null; - /** - * Count of entries that were processed successfully. - * - * Generated from protobuf field int64 success_count = 1; - */ - protected $success_count = 0; - /** - * Count of entries that encountered errors while processing. - * - * Generated from protobuf field int64 failure_count = 2; - */ - protected $failure_count = 0; - /** - * Operation last update time. If the operation is done, this is also the - * finish time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - protected $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $operation_name - * Name of the operation. - * @type string $request_id - * Id of the request / operation. This is parroting back the requestId that - * was passed in the request. - * @type \Google\Protobuf\Timestamp $create_time - * Operation create time. - * @type int|string $success_count - * Count of entries that were processed successfully. - * @type int|string $failure_count - * Count of entries that encountered errors while processing. - * @type \Google\Protobuf\Timestamp $update_time - * Operation last update time. If the operation is done, this is also the - * finish time. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * Name of the operation. - * - * Generated from protobuf field string operation_name = 5; - * @return string - */ - public function getOperationName() - { - return $this->operation_name; - } - - /** - * Name of the operation. - * - * Generated from protobuf field string operation_name = 5; - * @param string $var - * @return $this - */ - public function setOperationName($var) - { - GPBUtil::checkString($var, True); - $this->operation_name = $var; - - return $this; - } - - /** - * Id of the request / operation. This is parroting back the requestId that - * was passed in the request. - * - * Generated from protobuf field string request_id = 3; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Id of the request / operation. This is parroting back the requestId that - * was passed in the request. - * - * Generated from protobuf field string request_id = 3; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Count of entries that were processed successfully. - * - * Generated from protobuf field int64 success_count = 1; - * @return int|string - */ - public function getSuccessCount() - { - return $this->success_count; - } - - /** - * Count of entries that were processed successfully. - * - * Generated from protobuf field int64 success_count = 1; - * @param int|string $var - * @return $this - */ - public function setSuccessCount($var) - { - GPBUtil::checkInt64($var); - $this->success_count = $var; - - return $this; - } - - /** - * Count of entries that encountered errors while processing. - * - * Generated from protobuf field int64 failure_count = 2; - * @return int|string - */ - public function getFailureCount() - { - return $this->failure_count; - } - - /** - * Count of entries that encountered errors while processing. - * - * Generated from protobuf field int64 failure_count = 2; - * @param int|string $var - * @return $this - */ - public function setFailureCount($var) - { - GPBUtil::checkInt64($var); - $this->failure_count = $var; - - return $this; - } - - /** - * Operation last update time. If the operation is done, this is also the - * finish time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Operation last update time. If the operation is done, this is also the - * finish time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php deleted file mode 100644 index 0c555beff807..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsRequest.php +++ /dev/null @@ -1,213 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest - */ -class ImportUserEventsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency for expensive long running operations. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. Note that - * this field must not be set if the desired input config is - * catalog_inline_source. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input_config = null; - /** - * Optional. The desired location of errors incurred during the Import. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $errors_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * @type string $request_id - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency for expensive long running operations. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. Note that - * this field must not be set if the desired input config is - * catalog_inline_source. - * @type \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $input_config - * Required. The desired input location of the data. - * @type \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errors_config - * Optional. The desired location of errors incurred during the Import. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * Required. - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency for expensive long running operations. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. Note that - * this field must not be set if the desired input config is - * catalog_inline_source. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency for expensive long running operations. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. Note that - * this field must not be set if the desired input config is - * catalog_inline_source. - * - * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\InputConfig|null - */ - public function getInputConfig() - { - return $this->input_config; - } - - public function hasInputConfig() - { - return isset($this->input_config); - } - - public function clearInputConfig() - { - unset($this->input_config); - } - - /** - * Required. The desired input location of the data. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.InputConfig input_config = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\InputConfig $var - * @return $this - */ - public function setInputConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\InputConfig::class); - $this->input_config = $var; - - return $this; - } - - /** - * Optional. The desired location of errors incurred during the Import. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig|null - */ - public function getErrorsConfig() - { - return $this->errors_config; - } - - public function hasErrorsConfig() - { - return isset($this->errors_config); - } - - public function clearErrorsConfig() - { - unset($this->errors_config); - } - - /** - * Optional. The desired location of errors incurred during the Import. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $var - * @return $this - */ - public function setErrorsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig::class); - $this->errors_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsResponse.php deleted file mode 100644 index a2c46b8b0d7d..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ImportUserEventsResponse.php +++ /dev/null @@ -1,161 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse - */ -class ImportUserEventsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A sample of errors encountered while processing the request. - * - * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; - */ - private $error_samples; - /** - * Echoes the destination for the complete errors if this field was set in - * the request. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; - */ - protected $errors_config = null; - /** - * Aggregated statistics of user event import status. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; - */ - protected $import_summary = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $error_samples - * A sample of errors encountered while processing the request. - * @type \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $errors_config - * Echoes the destination for the complete errors if this field was set in - * the request. - * @type \Google\Cloud\RecommendationEngine\V1beta1\UserEventImportSummary $import_summary - * Aggregated statistics of user event import status. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * A sample of errors encountered while processing the request. - * - * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getErrorSamples() - { - return $this->error_samples; - } - - /** - * A sample of errors encountered while processing the request. - * - * Generated from protobuf field repeated .google.rpc.Status error_samples = 1; - * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setErrorSamples($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->error_samples = $arr; - - return $this; - } - - /** - * Echoes the destination for the complete errors if this field was set in - * the request. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; - * @return \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig|null - */ - public function getErrorsConfig() - { - return $this->errors_config; - } - - public function hasErrorsConfig() - { - return isset($this->errors_config); - } - - public function clearErrorsConfig() - { - unset($this->errors_config); - } - - /** - * Echoes the destination for the complete errors if this field was set in - * the request. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ImportErrorsConfig errors_config = 2; - * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig $var - * @return $this - */ - public function setErrorsConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ImportErrorsConfig::class); - $this->errors_config = $var; - - return $this; - } - - /** - * Aggregated statistics of user event import status. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; - * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEventImportSummary|null - */ - public function getImportSummary() - { - return $this->import_summary; - } - - public function hasImportSummary() - { - return isset($this->import_summary); - } - - public function clearImportSummary() - { - unset($this->import_summary); - } - - /** - * Aggregated statistics of user event import status. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventImportSummary import_summary = 3; - * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEventImportSummary $var - * @return $this - */ - public function setImportSummary($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEventImportSummary::class); - $this->import_summary = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/InputConfig.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/InputConfig.php deleted file mode 100644 index bb1e3c8486ee..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/InputConfig.php +++ /dev/null @@ -1,141 +0,0 @@ -google.cloud.recommendationengine.v1beta1.InputConfig - */ -class InputConfig extends \Google\Protobuf\Internal\Message -{ - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\RecommendationEngine\V1beta1\CatalogInlineSource $catalog_inline_source - * The Inline source for the input content for Catalog items. - * @type \Google\Cloud\RecommendationEngine\V1beta1\GcsSource $gcs_source - * Google Cloud Storage location for the input content. - * @type \Google\Cloud\RecommendationEngine\V1beta1\UserEventInlineSource $user_event_inline_source - * The Inline source for the input content for UserEvents. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * The Inline source for the input content for Catalog items. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; - * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogInlineSource|null - */ - public function getCatalogInlineSource() - { - return $this->readOneof(1); - } - - public function hasCatalogInlineSource() - { - return $this->hasOneof(1); - } - - /** - * The Inline source for the input content for Catalog items. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogInlineSource catalog_inline_source = 1; - * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogInlineSource $var - * @return $this - */ - public function setCatalogInlineSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\CatalogInlineSource::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Google Cloud Storage location for the input content. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; - * @return \Google\Cloud\RecommendationEngine\V1beta1\GcsSource|null - */ - public function getGcsSource() - { - return $this->readOneof(2); - } - - public function hasGcsSource() - { - return $this->hasOneof(2); - } - - /** - * Google Cloud Storage location for the input content. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.GcsSource gcs_source = 2; - * @param \Google\Cloud\RecommendationEngine\V1beta1\GcsSource $var - * @return $this - */ - public function setGcsSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\GcsSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The Inline source for the input content for UserEvents. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; - * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEventInlineSource|null - */ - public function getUserEventInlineSource() - { - return $this->readOneof(3); - } - - public function hasUserEventInlineSource() - { - return $this->hasOneof(3); - } - - /** - * The Inline source for the input content for UserEvents. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEventInlineSource user_event_inline_source = 3; - * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEventInlineSource $var - * @return $this - */ - public function setUserEventInlineSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEventInlineSource::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php deleted file mode 100644 index bef80b265889..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsRequest.php +++ /dev/null @@ -1,177 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest - */ -class ListCatalogItemsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Maximum number of results to return per page. If zero, the - * service will choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The previous ListCatalogItemsResponse.next_page_token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. A filter to apply on the list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * @type int $page_size - * Optional. Maximum number of results to return per page. If zero, the - * service will choose a reasonable default. - * @type string $page_token - * Optional. The previous ListCatalogItemsResponse.next_page_token. - * @type string $filter - * Optional. A filter to apply on the list results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Maximum number of results to return per page. If zero, the - * service will choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Maximum number of results to return per page. If zero, the - * service will choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The previous ListCatalogItemsResponse.next_page_token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The previous ListCatalogItemsResponse.next_page_token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. A filter to apply on the list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. A filter to apply on the list results. - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsResponse.php deleted file mode 100644 index 5e6fc92950bf..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListCatalogItemsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse - */ -class ListCatalogItemsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The catalog items. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; - */ - private $catalog_items; - /** - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's ListCatalogItemRequest.page_token. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem>|\Google\Protobuf\Internal\RepeatedField $catalog_items - * The catalog items. - * @type string $next_page_token - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's ListCatalogItemRequest.page_token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * The catalog items. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCatalogItems() - { - return $this->catalog_items; - } - - /** - * The catalog items. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_items = 1; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCatalogItems($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem::class); - $this->catalog_items = $arr; - - return $this; - } - - /** - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's ListCatalogItemRequest.page_token. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's ListCatalogItemRequest.page_token. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php deleted file mode 100644 index 82bc79d0546a..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsRequest.php +++ /dev/null @@ -1,143 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest - */ -class ListPredictionApiKeyRegistrationsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent placement resource name such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Maximum number of results to return per page. If unset, the - * service will choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent placement resource name such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * @type int $page_size - * Optional. Maximum number of results to return per page. If unset, the - * service will choose a reasonable default. - * @type string $page_token - * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent placement resource name such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent placement resource name such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Maximum number of results to return per page. If unset, the - * service will choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Maximum number of results to return per page. If unset, the - * service will choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The previous `ListPredictionApiKeyRegistration.nextPageToken`. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsResponse.php deleted file mode 100644 index 10f6cde3a76e..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListPredictionApiKeyRegistrationsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse - */ -class ListPredictionApiKeyRegistrationsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The list of registered API keys. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; - */ - private $prediction_api_key_registrations; - /** - * If empty, the list is complete. If nonempty, pass the token to the next - * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration>|\Google\Protobuf\Internal\RepeatedField $prediction_api_key_registrations - * The list of registered API keys. - * @type string $next_page_token - * If empty, the list is complete. If nonempty, pass the token to the next - * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); - parent::__construct($data); - } - - /** - * The list of registered API keys. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPredictionApiKeyRegistrations() - { - return $this->prediction_api_key_registrations; - } - - /** - * The list of registered API keys. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration prediction_api_key_registrations = 1; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPredictionApiKeyRegistrations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration::class); - $this->prediction_api_key_registrations = $arr; - - return $this; - } - - /** - * If empty, the list is complete. If nonempty, pass the token to the next - * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If empty, the list is complete. If nonempty, pass the token to the next - * request's `ListPredictionApiKeysRegistrationsRequest.pageToken`. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php deleted file mode 100644 index 93f04a497213..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsRequest.php +++ /dev/null @@ -1,277 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ListUserEventsRequest - */ -class ListUserEventsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent eventStore resource name, such as - * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Optional. Maximum number of results to return per page. If zero, the - * service will choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The previous ListUserEventsResponse.next_page_token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filtering expression to specify restrictions over - * returned events. This is a sequence of terms, where each term applies some - * kind of a restriction to the returned user events. Use this expression to - * restrict results to a specific time range, or filter events by eventType. - * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems - * eventTime<"2012-04-23T18:25:43.511Z" eventType=search - * We expect only 3 types of fields: - * * eventTime: this can be specified a maximum of 2 times, once with a - * less than operator and once with a greater than operator. The - * eventTime restrict should result in one contiguous valid eventTime - * range. - * * eventType: only 1 eventType restriction can be specified. - * * eventsMissingCatalogItems: specififying this will restrict results - * to events for which catalog items were not found in the catalog. The - * default behavior is to return only those events for which catalog - * items were found. - * Some examples of valid filters expressions: - * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z" - * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" - * eventType = detail-page-view - * * Example 3: eventsMissingCatalogItems - * eventType = search eventTime < "2018-04-23T18:30:43.511Z" - * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" - * * Example 5: eventType = search - * * Example 6: eventsMissingCatalogItems - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent eventStore resource name, such as - * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. - * @type int $page_size - * Optional. Maximum number of results to return per page. If zero, the - * service will choose a reasonable default. - * @type string $page_token - * Optional. The previous ListUserEventsResponse.next_page_token. - * @type string $filter - * Optional. Filtering expression to specify restrictions over - * returned events. This is a sequence of terms, where each term applies some - * kind of a restriction to the returned user events. Use this expression to - * restrict results to a specific time range, or filter events by eventType. - * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems - * eventTime<"2012-04-23T18:25:43.511Z" eventType=search - * We expect only 3 types of fields: - * * eventTime: this can be specified a maximum of 2 times, once with a - * less than operator and once with a greater than operator. The - * eventTime restrict should result in one contiguous valid eventTime - * range. - * * eventType: only 1 eventType restriction can be specified. - * * eventsMissingCatalogItems: specififying this will restrict results - * to events for which catalog items were not found in the catalog. The - * default behavior is to return only those events for which catalog - * items were found. - * Some examples of valid filters expressions: - * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z" - * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" - * eventType = detail-page-view - * * Example 3: eventsMissingCatalogItems - * eventType = search eventTime < "2018-04-23T18:30:43.511Z" - * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" - * * Example 5: eventType = search - * * Example 6: eventsMissingCatalogItems - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent eventStore resource name, such as - * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent eventStore resource name, such as - * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Maximum number of results to return per page. If zero, the - * service will choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Maximum number of results to return per page. If zero, the - * service will choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The previous ListUserEventsResponse.next_page_token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The previous ListUserEventsResponse.next_page_token. - * - * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Filtering expression to specify restrictions over - * returned events. This is a sequence of terms, where each term applies some - * kind of a restriction to the returned user events. Use this expression to - * restrict results to a specific time range, or filter events by eventType. - * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems - * eventTime<"2012-04-23T18:25:43.511Z" eventType=search - * We expect only 3 types of fields: - * * eventTime: this can be specified a maximum of 2 times, once with a - * less than operator and once with a greater than operator. The - * eventTime restrict should result in one contiguous valid eventTime - * range. - * * eventType: only 1 eventType restriction can be specified. - * * eventsMissingCatalogItems: specififying this will restrict results - * to events for which catalog items were not found in the catalog. The - * default behavior is to return only those events for which catalog - * items were found. - * Some examples of valid filters expressions: - * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z" - * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" - * eventType = detail-page-view - * * Example 3: eventsMissingCatalogItems - * eventType = search eventTime < "2018-04-23T18:30:43.511Z" - * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" - * * Example 5: eventType = search - * * Example 6: eventsMissingCatalogItems - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filtering expression to specify restrictions over - * returned events. This is a sequence of terms, where each term applies some - * kind of a restriction to the returned user events. Use this expression to - * restrict results to a specific time range, or filter events by eventType. - * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems - * eventTime<"2012-04-23T18:25:43.511Z" eventType=search - * We expect only 3 types of fields: - * * eventTime: this can be specified a maximum of 2 times, once with a - * less than operator and once with a greater than operator. The - * eventTime restrict should result in one contiguous valid eventTime - * range. - * * eventType: only 1 eventType restriction can be specified. - * * eventsMissingCatalogItems: specififying this will restrict results - * to events for which catalog items were not found in the catalog. The - * default behavior is to return only those events for which catalog - * items were found. - * Some examples of valid filters expressions: - * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z" - * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" - * eventType = detail-page-view - * * Example 3: eventsMissingCatalogItems - * eventType = search eventTime < "2018-04-23T18:30:43.511Z" - * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" - * * Example 5: eventType = search - * * Example 6: eventsMissingCatalogItems - * - * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsResponse.php deleted file mode 100644 index dd173c6ca7ae..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ListUserEventsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ListUserEventsResponse - */ -class ListUserEventsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The user events. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; - */ - private $user_events; - /** - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's ListUserEvents.page_token. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $user_events - * The user events. - * @type string $next_page_token - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's ListUserEvents.page_token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * The user events. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUserEvents() - { - return $this->user_events; - } - - /** - * The user events. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUserEvents($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); - $this->user_events = $arr; - - return $this; - } - - /** - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's ListUserEvents.page_token. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's ListUserEvents.page_token. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php deleted file mode 100644 index 944aa82724ec..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictRequest.php +++ /dev/null @@ -1,551 +0,0 @@ -google.cloud.recommendationengine.v1beta1.PredictRequest - */ -class PredictRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of the format: - * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` - * The id of the recommendation engine placement. This id is used to identify - * the set of models that will be used to make the prediction. - * We currently support three placements with the following IDs by default: - * * `shopping_cart`: Predicts items frequently bought together with one or - * more catalog items in the same shopping session. Commonly displayed after - * `add-to-cart` events, on product detail pages, or on the shopping cart - * page. - * * `home_page`: Predicts the next product that a user will most likely - * engage with or purchase based on the shopping or viewing history of the - * specified `userId` or `visitorId`. For example - Recommendations for you. - * * `product_detail`: Predicts the next product that a user will most likely - * engage with or purchase. The prediction is based on the shopping or - * viewing history of the specified `userId` or `visitorId` and its - * relevance to a specified `CatalogItem`. Typically used on product detail - * pages. For example - More items like this. - * * `recently_viewed_default`: Returns up to 75 items recently viewed by the - * specified `userId` or `visitorId`, most recent ones first. Returns - * nothing if neither of them has viewed any items yet. For example - - * Recently viewed. - * The full list of available placements can be seen at - * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. Context about the user, what they are looking at and what action - * they took to trigger the predict request. Note that this user event detail - * won't be ingested to userEvent logs. Thus, a separate userEvent write - * request is required for event logging. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_event = null; - /** - * Optional. Maximum number of results to return per page. Set this property - * to the number of prediction results required. If zero, the service will - * choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. The previous PredictResponse.next_page_token. - * - * Generated from protobuf field string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. Filter for restricting prediction results. Accepts values for - * tags and the `filterOutOfStockItems` flag. - * * Tag expressions. Restricts predictions to items that match all of the - * specified tags. Boolean operators `OR` and `NOT` are supported if the - * expression is enclosed in parentheses, and must be separated from the - * tag values by a space. `-"tagA"` is also supported and is equivalent to - * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings - * with a size limit of 1 KiB. - * * filterOutOfStockItems. Restricts predictions to items that do not have a - * stockState value of OUT_OF_STOCK. - * Examples: - * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") - * * filterOutOfStockItems tag=(-"promotional") - * * filterOutOfStockItems - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $filter = ''; - /** - * Optional. Use dryRun mode for this prediction query. If set to true, a - * dummy model will be used that returns arbitrary catalog items. - * Note that the dryRun mode should only be used for testing the API, or if - * the model is not ready. - * - * Generated from protobuf field bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $dry_run = false; - /** - * Optional. Additional domain specific parameters for the predictions. - * Allowed values: - * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem - * object will be returned in the - * `PredictResponse.PredictionResult.itemMetadata` object in the method - * response. - * * `returnItemScore`: Boolean. If set to true, the prediction 'score' - * corresponding to each returned item will be set in the `metadata` - * field in the prediction response. The given 'score' indicates the - * probability of an item being clicked/purchased given the user's context - * and history. - * - * Generated from protobuf field map params = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $params; - /** - * Optional. The labels for the predict request. - * * Label keys can contain lowercase letters, digits and hyphens, must start - * with a letter, and must end with a letter or digit. - * * Non-zero label values can contain lowercase letters, digits and hyphens, - * must start with a letter, and must end with a letter or digit. - * * No more than 64 labels can be associated with a given request. - * See https://goo.gl/xmQnxf for more information on and examples of labels. - * - * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Full resource name of the format: - * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` - * The id of the recommendation engine placement. This id is used to identify - * the set of models that will be used to make the prediction. - * We currently support three placements with the following IDs by default: - * * `shopping_cart`: Predicts items frequently bought together with one or - * more catalog items in the same shopping session. Commonly displayed after - * `add-to-cart` events, on product detail pages, or on the shopping cart - * page. - * * `home_page`: Predicts the next product that a user will most likely - * engage with or purchase based on the shopping or viewing history of the - * specified `userId` or `visitorId`. For example - Recommendations for you. - * * `product_detail`: Predicts the next product that a user will most likely - * engage with or purchase. The prediction is based on the shopping or - * viewing history of the specified `userId` or `visitorId` and its - * relevance to a specified `CatalogItem`. Typically used on product detail - * pages. For example - More items like this. - * * `recently_viewed_default`: Returns up to 75 items recently viewed by the - * specified `userId` or `visitorId`, most recent ones first. Returns - * nothing if neither of them has viewed any items yet. For example - - * Recently viewed. - * The full list of available placements can be seen at - * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard - * @type \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $user_event - * Required. Context about the user, what they are looking at and what action - * they took to trigger the predict request. Note that this user event detail - * won't be ingested to userEvent logs. Thus, a separate userEvent write - * request is required for event logging. - * @type int $page_size - * Optional. Maximum number of results to return per page. Set this property - * to the number of prediction results required. If zero, the service will - * choose a reasonable default. - * @type string $page_token - * Optional. The previous PredictResponse.next_page_token. - * @type string $filter - * Optional. Filter for restricting prediction results. Accepts values for - * tags and the `filterOutOfStockItems` flag. - * * Tag expressions. Restricts predictions to items that match all of the - * specified tags. Boolean operators `OR` and `NOT` are supported if the - * expression is enclosed in parentheses, and must be separated from the - * tag values by a space. `-"tagA"` is also supported and is equivalent to - * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings - * with a size limit of 1 KiB. - * * filterOutOfStockItems. Restricts predictions to items that do not have a - * stockState value of OUT_OF_STOCK. - * Examples: - * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") - * * filterOutOfStockItems tag=(-"promotional") - * * filterOutOfStockItems - * @type bool $dry_run - * Optional. Use dryRun mode for this prediction query. If set to true, a - * dummy model will be used that returns arbitrary catalog items. - * Note that the dryRun mode should only be used for testing the API, or if - * the model is not ready. - * @type array|\Google\Protobuf\Internal\MapField $params - * Optional. Additional domain specific parameters for the predictions. - * Allowed values: - * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem - * object will be returned in the - * `PredictResponse.PredictionResult.itemMetadata` object in the method - * response. - * * `returnItemScore`: Boolean. If set to true, the prediction 'score' - * corresponding to each returned item will be set in the `metadata` - * field in the prediction response. The given 'score' indicates the - * probability of an item being clicked/purchased given the user's context - * and history. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. The labels for the predict request. - * * Label keys can contain lowercase letters, digits and hyphens, must start - * with a letter, and must end with a letter or digit. - * * Non-zero label values can contain lowercase letters, digits and hyphens, - * must start with a letter, and must end with a letter or digit. - * * No more than 64 labels can be associated with a given request. - * See https://goo.gl/xmQnxf for more information on and examples of labels. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of the format: - * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` - * The id of the recommendation engine placement. This id is used to identify - * the set of models that will be used to make the prediction. - * We currently support three placements with the following IDs by default: - * * `shopping_cart`: Predicts items frequently bought together with one or - * more catalog items in the same shopping session. Commonly displayed after - * `add-to-cart` events, on product detail pages, or on the shopping cart - * page. - * * `home_page`: Predicts the next product that a user will most likely - * engage with or purchase based on the shopping or viewing history of the - * specified `userId` or `visitorId`. For example - Recommendations for you. - * * `product_detail`: Predicts the next product that a user will most likely - * engage with or purchase. The prediction is based on the shopping or - * viewing history of the specified `userId` or `visitorId` and its - * relevance to a specified `CatalogItem`. Typically used on product detail - * pages. For example - More items like this. - * * `recently_viewed_default`: Returns up to 75 items recently viewed by the - * specified `userId` or `visitorId`, most recent ones first. Returns - * nothing if neither of them has viewed any items yet. For example - - * Recently viewed. - * The full list of available placements can be seen at - * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Full resource name of the format: - * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` - * The id of the recommendation engine placement. This id is used to identify - * the set of models that will be used to make the prediction. - * We currently support three placements with the following IDs by default: - * * `shopping_cart`: Predicts items frequently bought together with one or - * more catalog items in the same shopping session. Commonly displayed after - * `add-to-cart` events, on product detail pages, or on the shopping cart - * page. - * * `home_page`: Predicts the next product that a user will most likely - * engage with or purchase based on the shopping or viewing history of the - * specified `userId` or `visitorId`. For example - Recommendations for you. - * * `product_detail`: Predicts the next product that a user will most likely - * engage with or purchase. The prediction is based on the shopping or - * viewing history of the specified `userId` or `visitorId` and its - * relevance to a specified `CatalogItem`. Typically used on product detail - * pages. For example - More items like this. - * * `recently_viewed_default`: Returns up to 75 items recently viewed by the - * specified `userId` or `visitorId`, most recent ones first. Returns - * nothing if neither of them has viewed any items yet. For example - - * Recently viewed. - * The full list of available placements can be seen at - * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. Context about the user, what they are looking at and what action - * they took to trigger the predict request. Note that this user event detail - * won't be ingested to userEvent logs. Thus, a separate userEvent write - * request is required for event logging. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEvent|null - */ - public function getUserEvent() - { - return $this->user_event; - } - - public function hasUserEvent() - { - return isset($this->user_event); - } - - public function clearUserEvent() - { - unset($this->user_event); - } - - /** - * Required. Context about the user, what they are looking at and what action - * they took to trigger the predict request. Note that this user event detail - * won't be ingested to userEvent logs. Thus, a separate userEvent write - * request is required for event logging. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $var - * @return $this - */ - public function setUserEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); - $this->user_event = $var; - - return $this; - } - - /** - * Optional. Maximum number of results to return per page. Set this property - * to the number of prediction results required. If zero, the service will - * choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. Maximum number of results to return per page. Set this property - * to the number of prediction results required. If zero, the service will - * choose a reasonable default. - * - * Generated from protobuf field int32 page_size = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. The previous PredictResponse.next_page_token. - * - * Generated from protobuf field string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. The previous PredictResponse.next_page_token. - * - * Generated from protobuf field string page_token = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. Filter for restricting prediction results. Accepts values for - * tags and the `filterOutOfStockItems` flag. - * * Tag expressions. Restricts predictions to items that match all of the - * specified tags. Boolean operators `OR` and `NOT` are supported if the - * expression is enclosed in parentheses, and must be separated from the - * tag values by a space. `-"tagA"` is also supported and is equivalent to - * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings - * with a size limit of 1 KiB. - * * filterOutOfStockItems. Restricts predictions to items that do not have a - * stockState value of OUT_OF_STOCK. - * Examples: - * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") - * * filterOutOfStockItems tag=(-"promotional") - * * filterOutOfStockItems - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. Filter for restricting prediction results. Accepts values for - * tags and the `filterOutOfStockItems` flag. - * * Tag expressions. Restricts predictions to items that match all of the - * specified tags. Boolean operators `OR` and `NOT` are supported if the - * expression is enclosed in parentheses, and must be separated from the - * tag values by a space. `-"tagA"` is also supported and is equivalent to - * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings - * with a size limit of 1 KiB. - * * filterOutOfStockItems. Restricts predictions to items that do not have a - * stockState value of OUT_OF_STOCK. - * Examples: - * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") - * * filterOutOfStockItems tag=(-"promotional") - * * filterOutOfStockItems - * - * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. Use dryRun mode for this prediction query. If set to true, a - * dummy model will be used that returns arbitrary catalog items. - * Note that the dryRun mode should only be used for testing the API, or if - * the model is not ready. - * - * Generated from protobuf field bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDryRun() - { - return $this->dry_run; - } - - /** - * Optional. Use dryRun mode for this prediction query. If set to true, a - * dummy model will be used that returns arbitrary catalog items. - * Note that the dryRun mode should only be used for testing the API, or if - * the model is not ready. - * - * Generated from protobuf field bool dry_run = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDryRun($var) - { - GPBUtil::checkBool($var); - $this->dry_run = $var; - - return $this; - } - - /** - * Optional. Additional domain specific parameters for the predictions. - * Allowed values: - * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem - * object will be returned in the - * `PredictResponse.PredictionResult.itemMetadata` object in the method - * response. - * * `returnItemScore`: Boolean. If set to true, the prediction 'score' - * corresponding to each returned item will be set in the `metadata` - * field in the prediction response. The given 'score' indicates the - * probability of an item being clicked/purchased given the user's context - * and history. - * - * Generated from protobuf field map params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getParams() - { - return $this->params; - } - - /** - * Optional. Additional domain specific parameters for the predictions. - * Allowed values: - * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem - * object will be returned in the - * `PredictResponse.PredictionResult.itemMetadata` object in the method - * response. - * * `returnItemScore`: Boolean. If set to true, the prediction 'score' - * corresponding to each returned item will be set in the `metadata` - * field in the prediction response. The given 'score' indicates the - * probability of an item being clicked/purchased given the user's context - * and history. - * - * Generated from protobuf field map params = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setParams($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); - $this->params = $arr; - - return $this; - } - - /** - * Optional. The labels for the predict request. - * * Label keys can contain lowercase letters, digits and hyphens, must start - * with a letter, and must end with a letter or digit. - * * Non-zero label values can contain lowercase letters, digits and hyphens, - * must start with a letter, and must end with a letter or digit. - * * No more than 64 labels can be associated with a given request. - * See https://goo.gl/xmQnxf for more information on and examples of labels. - * - * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. The labels for the predict request. - * * Label keys can contain lowercase letters, digits and hyphens, must start - * with a letter, and must end with a letter or digit. - * * Non-zero label values can contain lowercase letters, digits and hyphens, - * must start with a letter, and must end with a letter or digit. - * * No more than 64 labels can be associated with a given request. - * See https://goo.gl/xmQnxf for more information on and examples of labels. - * - * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse.php deleted file mode 100644 index dd9123fe4fff..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse.php +++ /dev/null @@ -1,253 +0,0 @@ -google.cloud.recommendationengine.v1beta1.PredictResponse - */ -class PredictResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of recommended items. The order represents the ranking (from the - * most relevant item to the least). - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; - */ - private $results; - /** - * A unique recommendation token. This should be included in the user event - * logs resulting from this recommendation, which enables accurate attribution - * of recommendation model performance. - * - * Generated from protobuf field string recommendation_token = 2; - */ - protected $recommendation_token = ''; - /** - * IDs of items in the request that were missing from the catalog. - * - * Generated from protobuf field repeated string items_missing_in_catalog = 3; - */ - private $items_missing_in_catalog; - /** - * True if the dryRun property was set in the request. - * - * Generated from protobuf field bool dry_run = 4; - */ - protected $dry_run = false; - /** - * Additional domain specific prediction response metadata. - * - * Generated from protobuf field map metadata = 5; - */ - private $metadata; - /** - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's PredictRequest.page_token. - * - * Generated from protobuf field string next_page_token = 6; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $results - * A list of recommended items. The order represents the ranking (from the - * most relevant item to the least). - * @type string $recommendation_token - * A unique recommendation token. This should be included in the user event - * logs resulting from this recommendation, which enables accurate attribution - * of recommendation model performance. - * @type array|\Google\Protobuf\Internal\RepeatedField $items_missing_in_catalog - * IDs of items in the request that were missing from the catalog. - * @type bool $dry_run - * True if the dryRun property was set in the request. - * @type array|\Google\Protobuf\Internal\MapField $metadata - * Additional domain specific prediction response metadata. - * @type string $next_page_token - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's PredictRequest.page_token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionService::initOnce(); - parent::__construct($data); - } - - /** - * A list of recommended items. The order represents the ranking (from the - * most relevant item to the least). - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResults() - { - return $this->results; - } - - /** - * A list of recommended items. The order represents the ranking (from the - * most relevant item to the least). - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\PredictResponse\PredictionResult::class); - $this->results = $arr; - - return $this; - } - - /** - * A unique recommendation token. This should be included in the user event - * logs resulting from this recommendation, which enables accurate attribution - * of recommendation model performance. - * - * Generated from protobuf field string recommendation_token = 2; - * @return string - */ - public function getRecommendationToken() - { - return $this->recommendation_token; - } - - /** - * A unique recommendation token. This should be included in the user event - * logs resulting from this recommendation, which enables accurate attribution - * of recommendation model performance. - * - * Generated from protobuf field string recommendation_token = 2; - * @param string $var - * @return $this - */ - public function setRecommendationToken($var) - { - GPBUtil::checkString($var, True); - $this->recommendation_token = $var; - - return $this; - } - - /** - * IDs of items in the request that were missing from the catalog. - * - * Generated from protobuf field repeated string items_missing_in_catalog = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getItemsMissingInCatalog() - { - return $this->items_missing_in_catalog; - } - - /** - * IDs of items in the request that were missing from the catalog. - * - * Generated from protobuf field repeated string items_missing_in_catalog = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setItemsMissingInCatalog($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->items_missing_in_catalog = $arr; - - return $this; - } - - /** - * True if the dryRun property was set in the request. - * - * Generated from protobuf field bool dry_run = 4; - * @return bool - */ - public function getDryRun() - { - return $this->dry_run; - } - - /** - * True if the dryRun property was set in the request. - * - * Generated from protobuf field bool dry_run = 4; - * @param bool $var - * @return $this - */ - public function setDryRun($var) - { - GPBUtil::checkBool($var); - $this->dry_run = $var; - - return $this; - } - - /** - * Additional domain specific prediction response metadata. - * - * Generated from protobuf field map metadata = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getMetadata() - { - return $this->metadata; - } - - /** - * Additional domain specific prediction response metadata. - * - * Generated from protobuf field map metadata = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); - $this->metadata = $arr; - - return $this; - } - - /** - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's PredictRequest.page_token. - * - * Generated from protobuf field string next_page_token = 6; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * If empty, the list is complete. If nonempty, the token to pass to the next - * request's PredictRequest.page_token. - * - * Generated from protobuf field string next_page_token = 6; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse/PredictionResult.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse/PredictionResult.php deleted file mode 100644 index a5b769c9f337..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse/PredictionResult.php +++ /dev/null @@ -1,124 +0,0 @@ -google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult - */ -class PredictionResult extends \Google\Protobuf\Internal\Message -{ - /** - * ID of the recommended catalog item - * - * Generated from protobuf field string id = 1; - */ - protected $id = ''; - /** - * Additional item metadata / annotations. - * Possible values: - * * `catalogItem`: JSON representation of the catalogItem. Will be set if - * `returnCatalogItem` is set to true in `PredictRequest.params`. - * * `score`: Prediction score in double value. Will be set if - * `returnItemScore` is set to true in `PredictRequest.params`. - * - * Generated from protobuf field map item_metadata = 2; - */ - private $item_metadata; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * ID of the recommended catalog item - * @type array|\Google\Protobuf\Internal\MapField $item_metadata - * Additional item metadata / annotations. - * Possible values: - * * `catalogItem`: JSON representation of the catalogItem. Will be set if - * `returnCatalogItem` is set to true in `PredictRequest.params`. - * * `score`: Prediction score in double value. Will be set if - * `returnItemScore` is set to true in `PredictRequest.params`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionService::initOnce(); - parent::__construct($data); - } - - /** - * ID of the recommended catalog item - * - * Generated from protobuf field string id = 1; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * ID of the recommended catalog item - * - * Generated from protobuf field string id = 1; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Additional item metadata / annotations. - * Possible values: - * * `catalogItem`: JSON representation of the catalogItem. Will be set if - * `returnCatalogItem` is set to true in `PredictRequest.params`. - * * `score`: Prediction score in double value. Will be set if - * `returnItemScore` is set to true in `PredictRequest.params`. - * - * Generated from protobuf field map item_metadata = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getItemMetadata() - { - return $this->item_metadata; - } - - /** - * Additional item metadata / annotations. - * Possible values: - * * `catalogItem`: JSON representation of the catalogItem. Will be set if - * `returnCatalogItem` is set to true in `PredictRequest.params`. - * * `score`: Prediction score in double value. Will be set if - * `returnItemScore` is set to true in `PredictRequest.params`. - * - * Generated from protobuf field map item_metadata = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setItemMetadata($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); - $this->item_metadata = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PredictionResult::class, \Google\Cloud\RecommendationEngine\V1beta1\PredictResponse_PredictionResult::class); - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse_PredictionResult.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse_PredictionResult.php deleted file mode 100644 index e7823aafc5a6..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictResponse_PredictionResult.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration - */ -class PredictionApiKeyRegistration extends \Google\Protobuf\Internal\Message -{ - /** - * The API key. - * - * Generated from protobuf field string api_key = 1; - */ - protected $api_key = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $api_key - * The API key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\PredictionApikeyRegistryService::initOnce(); - parent::__construct($data); - } - - /** - * The API key. - * - * Generated from protobuf field string api_key = 1; - * @return string - */ - public function getApiKey() - { - return $this->api_key; - } - - /** - * The API key. - * - * Generated from protobuf field string api_key = 1; - * @param string $var - * @return $this - */ - public function setApiKey($var) - { - GPBUtil::checkString($var, True); - $this->api_key = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistryGrpcClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistryGrpcClient.php deleted file mode 100644 index f4cfcc6b460b..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionApiKeyRegistryGrpcClient.php +++ /dev/null @@ -1,84 +0,0 @@ -_simpleRequest('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/CreatePredictionApiKeyRegistration', - $argument, - ['\Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration', 'decode'], - $metadata, $options); - } - - /** - * List the registered apiKeys for use with predict method. - * @param \Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListPredictionApiKeyRegistrations(\Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/ListPredictionApiKeyRegistrations', - $argument, - ['\Google\Cloud\RecommendationEngine\V1beta1\ListPredictionApiKeyRegistrationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Unregister an apiKey from using for predict method. - * @param \Google\Cloud\RecommendationEngine\V1beta1\DeletePredictionApiKeyRegistrationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeletePredictionApiKeyRegistration(\Google\Cloud\RecommendationEngine\V1beta1\DeletePredictionApiKeyRegistrationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/DeletePredictionApiKeyRegistration', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionServiceGrpcClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionServiceGrpcClient.php deleted file mode 100644 index cebfa825285b..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PredictionServiceGrpcClient.php +++ /dev/null @@ -1,53 +0,0 @@ -_simpleRequest('/google.cloud.recommendationengine.v1beta1.PredictionService/Predict', - $argument, - ['\Google\Cloud\RecommendationEngine\V1beta1\PredictResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php deleted file mode 100644 index adca031c6cea..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem.php +++ /dev/null @@ -1,340 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ProductCatalogItem - */ -class ProductCatalogItem extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A map to pass the costs associated with the product. - * For example: - * {"manufacturing": 45.5} The profit of selling this item is computed like - * so: - * * If 'exactPrice' is provided, profit = displayPrice - sum(costs) - * * If 'priceRange' is provided, profit = minPrice - sum(costs) - * - * Generated from protobuf field map costs = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $costs; - /** - * Optional. Only required if the price is set. Currency code for price/costs. Use - * three-character ISO-4217 code. - * - * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $currency_code = ''; - /** - * Optional. Online stock state of the catalog item. Default is `IN_STOCK`. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $stock_state = 0; - /** - * Optional. The available quantity of the item. - * - * Generated from protobuf field int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $available_quantity = 0; - /** - * Optional. Canonical URL directly linking to the item detail page with a - * length limit of 5 KiB.. - * - * Generated from protobuf field string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $canonical_product_uri = ''; - /** - * Optional. Product images for the catalog item. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $images; - protected $price; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\ExactPrice $exact_price - * Optional. The exact product price. - * @type \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\PriceRange $price_range - * Optional. The product price range. - * @type array|\Google\Protobuf\Internal\MapField $costs - * Optional. A map to pass the costs associated with the product. - * For example: - * {"manufacturing": 45.5} The profit of selling this item is computed like - * so: - * * If 'exactPrice' is provided, profit = displayPrice - sum(costs) - * * If 'priceRange' is provided, profit = minPrice - sum(costs) - * @type string $currency_code - * Optional. Only required if the price is set. Currency code for price/costs. Use - * three-character ISO-4217 code. - * @type int $stock_state - * Optional. Online stock state of the catalog item. Default is `IN_STOCK`. - * @type int|string $available_quantity - * Optional. The available quantity of the item. - * @type string $canonical_product_uri - * Optional. Canonical URL directly linking to the item detail page with a - * length limit of 5 KiB.. - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\Image>|\Google\Protobuf\Internal\RepeatedField $images - * Optional. Product images for the catalog item. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The exact product price. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\ExactPrice|null - */ - public function getExactPrice() - { - return $this->readOneof(1); - } - - public function hasExactPrice() - { - return $this->hasOneof(1); - } - - /** - * Optional. The exact product price. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\ExactPrice $var - * @return $this - */ - public function setExactPrice($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\ExactPrice::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Optional. The product price range. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\PriceRange|null - */ - public function getPriceRange() - { - return $this->readOneof(2); - } - - public function hasPriceRange() - { - return $this->hasOneof(2); - } - - /** - * Optional. The product price range. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\PriceRange $var - * @return $this - */ - public function setPriceRange($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\PriceRange::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Optional. A map to pass the costs associated with the product. - * For example: - * {"manufacturing": 45.5} The profit of selling this item is computed like - * so: - * * If 'exactPrice' is provided, profit = displayPrice - sum(costs) - * * If 'priceRange' is provided, profit = minPrice - sum(costs) - * - * Generated from protobuf field map costs = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getCosts() - { - return $this->costs; - } - - /** - * Optional. A map to pass the costs associated with the product. - * For example: - * {"manufacturing": 45.5} The profit of selling this item is computed like - * so: - * * If 'exactPrice' is provided, profit = displayPrice - sum(costs) - * * If 'priceRange' is provided, profit = minPrice - sum(costs) - * - * Generated from protobuf field map costs = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setCosts($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::FLOAT); - $this->costs = $arr; - - return $this; - } - - /** - * Optional. Only required if the price is set. Currency code for price/costs. Use - * three-character ISO-4217 code. - * - * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCurrencyCode() - { - return $this->currency_code; - } - - /** - * Optional. Only required if the price is set. Currency code for price/costs. Use - * three-character ISO-4217 code. - * - * Generated from protobuf field string currency_code = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCurrencyCode($var) - { - GPBUtil::checkString($var, True); - $this->currency_code = $var; - - return $this; - } - - /** - * Optional. Online stock state of the catalog item. Default is `IN_STOCK`. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getStockState() - { - return $this->stock_state; - } - - /** - * Optional. Online stock state of the catalog item. Default is `IN_STOCK`. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setStockState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\StockState::class); - $this->stock_state = $var; - - return $this; - } - - /** - * Optional. The available quantity of the item. - * - * Generated from protobuf field int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string - */ - public function getAvailableQuantity() - { - return $this->available_quantity; - } - - /** - * Optional. The available quantity of the item. - * - * Generated from protobuf field int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string $var - * @return $this - */ - public function setAvailableQuantity($var) - { - GPBUtil::checkInt64($var); - $this->available_quantity = $var; - - return $this; - } - - /** - * Optional. Canonical URL directly linking to the item detail page with a - * length limit of 5 KiB.. - * - * Generated from protobuf field string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCanonicalProductUri() - { - return $this->canonical_product_uri; - } - - /** - * Optional. Canonical URL directly linking to the item detail page with a - * length limit of 5 KiB.. - * - * Generated from protobuf field string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCanonicalProductUri($var) - { - GPBUtil::checkString($var, True); - $this->canonical_product_uri = $var; - - return $this; - } - - /** - * Optional. Product images for the catalog item. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * Optional. Product images for the catalog item. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\Image>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\Image::class); - $this->images = $arr; - - return $this; - } - - /** - * @return string - */ - public function getPrice() - { - return $this->whichOneof("price"); - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/ExactPrice.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/ExactPrice.php deleted file mode 100644 index 7c89cff9e04b..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/ExactPrice.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice - */ -class ExactPrice extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Display price of the product. - * - * Generated from protobuf field float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $display_price = 0.0; - /** - * Optional. Price of the product without any discount. If zero, by default - * set to be the 'displayPrice'. - * - * Generated from protobuf field float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $original_price = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $display_price - * Optional. Display price of the product. - * @type float $original_price - * Optional. Price of the product without any discount. If zero, by default - * set to be the 'displayPrice'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Display price of the product. - * - * Generated from protobuf field float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getDisplayPrice() - { - return $this->display_price; - } - - /** - * Optional. Display price of the product. - * - * Generated from protobuf field float display_price = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setDisplayPrice($var) - { - GPBUtil::checkFloat($var); - $this->display_price = $var; - - return $this; - } - - /** - * Optional. Price of the product without any discount. If zero, by default - * set to be the 'displayPrice'. - * - * Generated from protobuf field float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getOriginalPrice() - { - return $this->original_price; - } - - /** - * Optional. Price of the product without any discount. If zero, by default - * set to be the 'displayPrice'. - * - * Generated from protobuf field float original_price = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setOriginalPrice($var) - { - GPBUtil::checkFloat($var); - $this->original_price = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ExactPrice::class, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem_ExactPrice::class); - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/PriceRange.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/PriceRange.php deleted file mode 100644 index 0e852c571278..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/PriceRange.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange - */ -class PriceRange extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The minimum product price. - * - * Generated from protobuf field float min = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $min = 0.0; - /** - * Required. The maximum product price. - * - * Generated from protobuf field float max = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $max = 0.0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type float $min - * Required. The minimum product price. - * @type float $max - * Required. The maximum product price. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Catalog::initOnce(); - parent::__construct($data); - } - - /** - * Required. The minimum product price. - * - * Generated from protobuf field float min = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return float - */ - public function getMin() - { - return $this->min; - } - - /** - * Required. The minimum product price. - * - * Generated from protobuf field float min = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param float $var - * @return $this - */ - public function setMin($var) - { - GPBUtil::checkFloat($var); - $this->min = $var; - - return $this; - } - - /** - * Required. The maximum product price. - * - * Generated from protobuf field float max = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return float - */ - public function getMax() - { - return $this->max; - } - - /** - * Required. The maximum product price. - * - * Generated from protobuf field float max = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param float $var - * @return $this - */ - public function setMax($var) - { - GPBUtil::checkFloat($var); - $this->max = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PriceRange::class, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem_PriceRange::class); - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/StockState.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/StockState.php deleted file mode 100644 index 1c3d3309882d..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem/StockState.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState - */ -class StockState -{ - /** - * Default item stock status. Should never be used. - * - * Generated from protobuf enum STOCK_STATE_UNSPECIFIED = 0; - */ - const STOCK_STATE_UNSPECIFIED = 0; - /** - * Item in stock. - * - * Generated from protobuf enum IN_STOCK = 0; - */ - const IN_STOCK = 0; - /** - * Item out of stock. - * - * Generated from protobuf enum OUT_OF_STOCK = 1; - */ - const OUT_OF_STOCK = 1; - /** - * Item that is in pre-order state. - * - * Generated from protobuf enum PREORDER = 2; - */ - const PREORDER = 2; - /** - * Item that is back-ordered (i.e. temporarily out of stock). - * - * Generated from protobuf enum BACKORDER = 3; - */ - const BACKORDER = 3; - - private static $valueToName = [ - self::STOCK_STATE_UNSPECIFIED => 'STOCK_STATE_UNSPECIFIED', - self::IN_STOCK => 'IN_STOCK', - self::OUT_OF_STOCK => 'OUT_OF_STOCK', - self::PREORDER => 'PREORDER', - self::BACKORDER => 'BACKORDER', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StockState::class, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem_StockState::class); - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_ExactPrice.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_ExactPrice.php deleted file mode 100644 index b0c815b4c813..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductCatalogItem_ExactPrice.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ProductDetail - */ -class ProductDetail extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 - * characters. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $id = ''; - /** - * Optional. Currency code for price/costs. Use three-character ISO-4217 - * code. Required only if originalPrice or displayPrice is set. - * - * Generated from protobuf field string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $currency_code = ''; - /** - * Optional. Original price of the product. If provided, this will override - * the original price in Catalog for this product. - * - * Generated from protobuf field float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $original_price = 0.0; - /** - * Optional. Display price of the product (e.g. discounted price). If - * provided, this will override the display price in Catalog for this product. - * - * Generated from protobuf field float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $display_price = 0.0; - /** - * Optional. Item stock state. If provided, this overrides the stock state - * in Catalog for items in this event. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $stock_state = 0; - /** - * Optional. Quantity of the product associated with the user event. For - * example, this field will be 2 if two products are added to the shopping - * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, - * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event - * types. - * - * Generated from protobuf field int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $quantity = 0; - /** - * Optional. Quantity of the products in stock when a user event happens. - * Optional. If provided, this overrides the available quantity in Catalog for - * this event. and can only be set if `stock_status` is set to `IN_STOCK`. - * Note that if an item is out of stock, you must set the `stock_state` field - * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not - * sufficient to mark the item out of stock. - * - * Generated from protobuf field int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $available_quantity = 0; - /** - * Optional. Extra features associated with a product in the user event. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $item_attributes = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 - * characters. - * @type string $currency_code - * Optional. Currency code for price/costs. Use three-character ISO-4217 - * code. Required only if originalPrice or displayPrice is set. - * @type float $original_price - * Optional. Original price of the product. If provided, this will override - * the original price in Catalog for this product. - * @type float $display_price - * Optional. Display price of the product (e.g. discounted price). If - * provided, this will override the display price in Catalog for this product. - * @type int $stock_state - * Optional. Item stock state. If provided, this overrides the stock state - * in Catalog for items in this event. - * @type int $quantity - * Optional. Quantity of the product associated with the user event. For - * example, this field will be 2 if two products are added to the shopping - * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, - * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event - * types. - * @type int $available_quantity - * Optional. Quantity of the products in stock when a user event happens. - * Optional. If provided, this overrides the available quantity in Catalog for - * this event. and can only be set if `stock_status` is set to `IN_STOCK`. - * Note that if an item is out of stock, you must set the `stock_state` field - * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not - * sufficient to mark the item out of stock. - * @type \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $item_attributes - * Optional. Extra features associated with a product in the user event. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 - * characters. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 - * characters. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Optional. Currency code for price/costs. Use three-character ISO-4217 - * code. Required only if originalPrice or displayPrice is set. - * - * Generated from protobuf field string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCurrencyCode() - { - return $this->currency_code; - } - - /** - * Optional. Currency code for price/costs. Use three-character ISO-4217 - * code. Required only if originalPrice or displayPrice is set. - * - * Generated from protobuf field string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCurrencyCode($var) - { - GPBUtil::checkString($var, True); - $this->currency_code = $var; - - return $this; - } - - /** - * Optional. Original price of the product. If provided, this will override - * the original price in Catalog for this product. - * - * Generated from protobuf field float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getOriginalPrice() - { - return $this->original_price; - } - - /** - * Optional. Original price of the product. If provided, this will override - * the original price in Catalog for this product. - * - * Generated from protobuf field float original_price = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setOriginalPrice($var) - { - GPBUtil::checkFloat($var); - $this->original_price = $var; - - return $this; - } - - /** - * Optional. Display price of the product (e.g. discounted price). If - * provided, this will override the display price in Catalog for this product. - * - * Generated from protobuf field float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return float - */ - public function getDisplayPrice() - { - return $this->display_price; - } - - /** - * Optional. Display price of the product (e.g. discounted price). If - * provided, this will override the display price in Catalog for this product. - * - * Generated from protobuf field float display_price = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param float $var - * @return $this - */ - public function setDisplayPrice($var) - { - GPBUtil::checkFloat($var); - $this->display_price = $var; - - return $this; - } - - /** - * Optional. Item stock state. If provided, this overrides the stock state - * in Catalog for items in this event. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getStockState() - { - return $this->stock_state; - } - - /** - * Optional. Item stock state. If provided, this overrides the stock state - * in Catalog for items in this event. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setStockState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductCatalogItem\StockState::class); - $this->stock_state = $var; - - return $this; - } - - /** - * Optional. Quantity of the product associated with the user event. For - * example, this field will be 2 if two products are added to the shopping - * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, - * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event - * types. - * - * Generated from protobuf field int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getQuantity() - { - return $this->quantity; - } - - /** - * Optional. Quantity of the product associated with the user event. For - * example, this field will be 2 if two products are added to the shopping - * cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, - * `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event - * types. - * - * Generated from protobuf field int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setQuantity($var) - { - GPBUtil::checkInt32($var); - $this->quantity = $var; - - return $this; - } - - /** - * Optional. Quantity of the products in stock when a user event happens. - * Optional. If provided, this overrides the available quantity in Catalog for - * this event. and can only be set if `stock_status` is set to `IN_STOCK`. - * Note that if an item is out of stock, you must set the `stock_state` field - * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not - * sufficient to mark the item out of stock. - * - * Generated from protobuf field int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getAvailableQuantity() - { - return $this->available_quantity; - } - - /** - * Optional. Quantity of the products in stock when a user event happens. - * Optional. If provided, this overrides the available quantity in Catalog for - * this event. and can only be set if `stock_status` is set to `IN_STOCK`. - * Note that if an item is out of stock, you must set the `stock_state` field - * to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not - * sufficient to mark the item out of stock. - * - * Generated from protobuf field int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setAvailableQuantity($var) - { - GPBUtil::checkInt32($var); - $this->available_quantity = $var; - - return $this; - } - - /** - * Optional. Extra features associated with a product in the user event. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap|null - */ - public function getItemAttributes() - { - return $this->item_attributes; - } - - public function hasItemAttributes() - { - return isset($this->item_attributes); - } - - public function clearItemAttributes() - { - unset($this->item_attributes); - } - - /** - * Optional. Extra features associated with a product in the user event. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap $var - * @return $this - */ - public function setItemAttributes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\FeatureMap::class); - $this->item_attributes = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductEventDetail.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductEventDetail.php deleted file mode 100644 index d65f1cc9d8d6..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/ProductEventDetail.php +++ /dev/null @@ -1,368 +0,0 @@ -google.cloud.recommendationengine.v1beta1.ProductEventDetail - */ -class ProductEventDetail extends \Google\Protobuf\Internal\Message -{ - /** - * Required for `search` events. Other event types should not set this field. - * The user's search query as UTF-8 encoded text with a length limit of 5 KiB. - * - * Generated from protobuf field string search_query = 1; - */ - protected $search_query = ''; - /** - * Required for `category-page-view` events. Other event types should not set - * this field. - * The categories associated with a category page. - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * categories : ["Sales", "2017 Black Friday Deals"]. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; - */ - private $page_categories; - /** - * The main product details related to the event. - * This field is required for the following event types: - * * `add-to-cart` - * * `add-to-list` - * * `checkout-start` - * * `detail-page-view` - * * `purchase-complete` - * * `refund` - * * `remove-from-cart` - * * `remove-from-list` - * This field is optional for the following event types: - * * `page-visit` - * * `shopping-cart-page-view` - note that 'product_details' should be set for - * this unless the shopping cart is empty. - * This field is not allowed for the following event types: - * * `category-page-view` - * * `home-page-view` - * * `search` - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; - */ - private $product_details; - /** - * Required for `add-to-list` and `remove-from-list` events. The id or name of - * the list that the item is being added to or removed from. Other event types - * should not set this field. - * - * Generated from protobuf field string list_id = 4; - */ - protected $list_id = ''; - /** - * Optional. The id or name of the associated shopping cart. This id is used - * to associate multiple items added or present in the cart before purchase. - * This can only be set for `add-to-cart`, `remove-from-cart`, - * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. - * - * Generated from protobuf field string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $cart_id = ''; - /** - * Optional. A transaction represents the entire purchase transaction. - * Required for `purchase-complete` events. Optional for `checkout-start` - * events. Other event types should not set this field. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $purchase_transaction = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $search_query - * Required for `search` events. Other event types should not set this field. - * The user's search query as UTF-8 encoded text with a length limit of 5 KiB. - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy>|\Google\Protobuf\Internal\RepeatedField $page_categories - * Required for `category-page-view` events. Other event types should not set - * this field. - * The categories associated with a category page. - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * categories : ["Sales", "2017 Black Friday Deals"]. - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $product_details - * The main product details related to the event. - * This field is required for the following event types: - * * `add-to-cart` - * * `add-to-list` - * * `checkout-start` - * * `detail-page-view` - * * `purchase-complete` - * * `refund` - * * `remove-from-cart` - * * `remove-from-list` - * This field is optional for the following event types: - * * `page-visit` - * * `shopping-cart-page-view` - note that 'product_details' should be set for - * this unless the shopping cart is empty. - * This field is not allowed for the following event types: - * * `category-page-view` - * * `home-page-view` - * * `search` - * @type string $list_id - * Required for `add-to-list` and `remove-from-list` events. The id or name of - * the list that the item is being added to or removed from. Other event types - * should not set this field. - * @type string $cart_id - * Optional. The id or name of the associated shopping cart. This id is used - * to associate multiple items added or present in the cart before purchase. - * This can only be set for `add-to-cart`, `remove-from-cart`, - * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. - * @type \Google\Cloud\RecommendationEngine\V1beta1\PurchaseTransaction $purchase_transaction - * Optional. A transaction represents the entire purchase transaction. - * Required for `purchase-complete` events. Optional for `checkout-start` - * events. Other event types should not set this field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * Required for `search` events. Other event types should not set this field. - * The user's search query as UTF-8 encoded text with a length limit of 5 KiB. - * - * Generated from protobuf field string search_query = 1; - * @return string - */ - public function getSearchQuery() - { - return $this->search_query; - } - - /** - * Required for `search` events. Other event types should not set this field. - * The user's search query as UTF-8 encoded text with a length limit of 5 KiB. - * - * Generated from protobuf field string search_query = 1; - * @param string $var - * @return $this - */ - public function setSearchQuery($var) - { - GPBUtil::checkString($var, True); - $this->search_query = $var; - - return $this; - } - - /** - * Required for `category-page-view` events. Other event types should not set - * this field. - * The categories associated with a category page. - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * categories : ["Sales", "2017 Black Friday Deals"]. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPageCategories() - { - return $this->page_categories; - } - - /** - * Required for `category-page-view` events. Other event types should not set - * this field. - * The categories associated with a category page. - * Category pages include special pages such as sales or promotions. For - * instance, a special sale page may have the category hierarchy: - * categories : ["Sales", "2017 Black Friday Deals"]. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy page_categories = 2; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPageCategories($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem\CategoryHierarchy::class); - $this->page_categories = $arr; - - return $this; - } - - /** - * The main product details related to the event. - * This field is required for the following event types: - * * `add-to-cart` - * * `add-to-list` - * * `checkout-start` - * * `detail-page-view` - * * `purchase-complete` - * * `refund` - * * `remove-from-cart` - * * `remove-from-list` - * This field is optional for the following event types: - * * `page-visit` - * * `shopping-cart-page-view` - note that 'product_details' should be set for - * this unless the shopping cart is empty. - * This field is not allowed for the following event types: - * * `category-page-view` - * * `home-page-view` - * * `search` - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProductDetails() - { - return $this->product_details; - } - - /** - * The main product details related to the event. - * This field is required for the following event types: - * * `add-to-cart` - * * `add-to-list` - * * `checkout-start` - * * `detail-page-view` - * * `purchase-complete` - * * `refund` - * * `remove-from-cart` - * * `remove-from-list` - * This field is optional for the following event types: - * * `page-visit` - * * `shopping-cart-page-view` - note that 'product_details' should be set for - * this unless the shopping cart is empty. - * This field is not allowed for the following event types: - * * `category-page-view` - * * `home-page-view` - * * `search` - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.ProductDetail product_details = 3; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\ProductDetail>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProductDetails($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\ProductDetail::class); - $this->product_details = $arr; - - return $this; - } - - /** - * Required for `add-to-list` and `remove-from-list` events. The id or name of - * the list that the item is being added to or removed from. Other event types - * should not set this field. - * - * Generated from protobuf field string list_id = 4; - * @return string - */ - public function getListId() - { - return $this->list_id; - } - - /** - * Required for `add-to-list` and `remove-from-list` events. The id or name of - * the list that the item is being added to or removed from. Other event types - * should not set this field. - * - * Generated from protobuf field string list_id = 4; - * @param string $var - * @return $this - */ - public function setListId($var) - { - GPBUtil::checkString($var, True); - $this->list_id = $var; - - return $this; - } - - /** - * Optional. The id or name of the associated shopping cart. This id is used - * to associate multiple items added or present in the cart before purchase. - * This can only be set for `add-to-cart`, `remove-from-cart`, - * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. - * - * Generated from protobuf field string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCartId() - { - return $this->cart_id; - } - - /** - * Optional. The id or name of the associated shopping cart. This id is used - * to associate multiple items added or present in the cart before purchase. - * This can only be set for `add-to-cart`, `remove-from-cart`, - * `checkout-start`, `purchase-complete`, or `shopping-cart-page-view` events. - * - * Generated from protobuf field string cart_id = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCartId($var) - { - GPBUtil::checkString($var, True); - $this->cart_id = $var; - - return $this; - } - - /** - * Optional. A transaction represents the entire purchase transaction. - * Required for `purchase-complete` events. Optional for `checkout-start` - * events. Other event types should not set this field. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\PurchaseTransaction|null - */ - public function getPurchaseTransaction() - { - return $this->purchase_transaction; - } - - public function hasPurchaseTransaction() - { - return isset($this->purchase_transaction); - } - - public function clearPurchaseTransaction() - { - unset($this->purchase_transaction); - } - - /** - * Optional. A transaction represents the entire purchase transaction. - * Required for `purchase-complete` events. Optional for `checkout-start` - * events. Other event types should not set this field. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.PurchaseTransaction purchase_transaction = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\PurchaseTransaction $var - * @return $this - */ - public function setPurchaseTransaction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\PurchaseTransaction::class); - $this->purchase_transaction = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurchaseTransaction.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurchaseTransaction.php deleted file mode 100644 index 871a95215d5d..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurchaseTransaction.php +++ /dev/null @@ -1,251 +0,0 @@ -google.cloud.recommendationengine.v1beta1.PurchaseTransaction - */ -class PurchaseTransaction extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The transaction ID with a length limit of 128 bytes. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $id = ''; - /** - * Required. Total revenue or grand total associated with the transaction. - * This value include shipping, tax, or other adjustments to total revenue - * that you want to include as part of your revenue calculations. This field - * is not required if the event type is `refund`. - * - * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $revenue = 0.0; - /** - * Optional. All the taxes associated with the transaction. - * - * Generated from protobuf field map taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $taxes; - /** - * Optional. All the costs associated with the product. These can be - * manufacturing costs, shipping expenses not borne by the end user, or any - * other costs. - * Total product cost such that - * profit = revenue - (sum(taxes) + sum(costs)) - * If product_cost is not set, then - * profit = revenue - tax - shipping - sum(CatalogItem.costs). - * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost - * based profit *cannot* be calculated for this Transaction. - * - * Generated from protobuf field map costs = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $costs; - /** - * Required. Currency code. Use three-character ISO-4217 code. This field - * is not required if the event type is `refund`. - * - * Generated from protobuf field string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $currency_code = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $id - * Optional. The transaction ID with a length limit of 128 bytes. - * @type float $revenue - * Required. Total revenue or grand total associated with the transaction. - * This value include shipping, tax, or other adjustments to total revenue - * that you want to include as part of your revenue calculations. This field - * is not required if the event type is `refund`. - * @type array|\Google\Protobuf\Internal\MapField $taxes - * Optional. All the taxes associated with the transaction. - * @type array|\Google\Protobuf\Internal\MapField $costs - * Optional. All the costs associated with the product. These can be - * manufacturing costs, shipping expenses not borne by the end user, or any - * other costs. - * Total product cost such that - * profit = revenue - (sum(taxes) + sum(costs)) - * If product_cost is not set, then - * profit = revenue - tax - shipping - sum(CatalogItem.costs). - * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost - * based profit *cannot* be calculated for this Transaction. - * @type string $currency_code - * Required. Currency code. Use three-character ISO-4217 code. This field - * is not required if the event type is `refund`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The transaction ID with a length limit of 128 bytes. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Optional. The transaction ID with a length limit of 128 bytes. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Required. Total revenue or grand total associated with the transaction. - * This value include shipping, tax, or other adjustments to total revenue - * that you want to include as part of your revenue calculations. This field - * is not required if the event type is `refund`. - * - * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return float - */ - public function getRevenue() - { - return $this->revenue; - } - - /** - * Required. Total revenue or grand total associated with the transaction. - * This value include shipping, tax, or other adjustments to total revenue - * that you want to include as part of your revenue calculations. This field - * is not required if the event type is `refund`. - * - * Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param float $var - * @return $this - */ - public function setRevenue($var) - { - GPBUtil::checkFloat($var); - $this->revenue = $var; - - return $this; - } - - /** - * Optional. All the taxes associated with the transaction. - * - * Generated from protobuf field map taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getTaxes() - { - return $this->taxes; - } - - /** - * Optional. All the taxes associated with the transaction. - * - * Generated from protobuf field map taxes = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setTaxes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::FLOAT); - $this->taxes = $arr; - - return $this; - } - - /** - * Optional. All the costs associated with the product. These can be - * manufacturing costs, shipping expenses not borne by the end user, or any - * other costs. - * Total product cost such that - * profit = revenue - (sum(taxes) + sum(costs)) - * If product_cost is not set, then - * profit = revenue - tax - shipping - sum(CatalogItem.costs). - * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost - * based profit *cannot* be calculated for this Transaction. - * - * Generated from protobuf field map costs = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getCosts() - { - return $this->costs; - } - - /** - * Optional. All the costs associated with the product. These can be - * manufacturing costs, shipping expenses not borne by the end user, or any - * other costs. - * Total product cost such that - * profit = revenue - (sum(taxes) + sum(costs)) - * If product_cost is not set, then - * profit = revenue - tax - shipping - sum(CatalogItem.costs). - * If CatalogItem.cost is not specified for one of the items, CatalogItem.cost - * based profit *cannot* be calculated for this Transaction. - * - * Generated from protobuf field map costs = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setCosts($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::FLOAT); - $this->costs = $arr; - - return $this; - } - - /** - * Required. Currency code. Use three-character ISO-4217 code. This field - * is not required if the event type is `refund`. - * - * Generated from protobuf field string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCurrencyCode() - { - return $this->currency_code; - } - - /** - * Required. Currency code. Use three-character ISO-4217 code. This field - * is not required if the event type is `refund`. - * - * Generated from protobuf field string currency_code = 6 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCurrencyCode($var) - { - GPBUtil::checkString($var, True); - $this->currency_code = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsMetadata.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsMetadata.php deleted file mode 100644 index 8dbccb355655..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsMetadata.php +++ /dev/null @@ -1,112 +0,0 @@ -google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata - */ -class PurgeUserEventsMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The ID of the request / operation. - * - * Generated from protobuf field string operation_name = 1; - */ - protected $operation_name = ''; - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - */ - protected $create_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $operation_name - * The ID of the request / operation. - * @type \Google\Protobuf\Timestamp $create_time - * Operation create time. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * The ID of the request / operation. - * - * Generated from protobuf field string operation_name = 1; - * @return string - */ - public function getOperationName() - { - return $this->operation_name; - } - - /** - * The ID of the request / operation. - * - * Generated from protobuf field string operation_name = 1; - * @param string $var - * @return $this - */ - public function setOperationName($var) - { - GPBUtil::checkString($var, True); - $this->operation_name = $var; - - return $this; - } - - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Operation create time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php deleted file mode 100644 index 74043bb2aa2c..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsRequest.php +++ /dev/null @@ -1,219 +0,0 @@ -google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest - */ -class PurgeUserEventsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the event_store under which the events are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The filter string to specify the events to be deleted. Empty - * string filter is not allowed. This filter can also be used with - * ListUserEvents API to list events that will be deleted. The eligible fields - * for filtering are: - * * eventType - UserEvent.eventType field of type string. - * * eventTime - in ISO 8601 "zulu" format. - * * visitorId - field of type string. Specifying this will delete all events - * associated with a visitor. - * * userId - field of type string. Specifying this will delete all events - * associated with a user. - * Example 1: Deleting all events in a time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < - * "2012-04-23T18:30:43.511Z"` - * Example 2: Deleting specific eventType in time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * Example 3: Deleting all events for a specific visitor - * `visitorId = visitor1024` - * The filtering fields are assumed to have an implicit AND. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $filter = ''; - /** - * Optional. The default value is false. Override this flag to true to - * actually perform the purge. If the field is not set to true, a sampling of - * events to be deleted will be returned. - * - * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $force = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the event_store under which the events are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` - * @type string $filter - * Required. The filter string to specify the events to be deleted. Empty - * string filter is not allowed. This filter can also be used with - * ListUserEvents API to list events that will be deleted. The eligible fields - * for filtering are: - * * eventType - UserEvent.eventType field of type string. - * * eventTime - in ISO 8601 "zulu" format. - * * visitorId - field of type string. Specifying this will delete all events - * associated with a visitor. - * * userId - field of type string. Specifying this will delete all events - * associated with a user. - * Example 1: Deleting all events in a time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < - * "2012-04-23T18:30:43.511Z"` - * Example 2: Deleting specific eventType in time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * Example 3: Deleting all events for a specific visitor - * `visitorId = visitor1024` - * The filtering fields are assumed to have an implicit AND. - * @type bool $force - * Optional. The default value is false. Override this flag to true to - * actually perform the purge. If the field is not set to true, a sampling of - * events to be deleted will be returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the event_store under which the events are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the event_store under which the events are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The filter string to specify the events to be deleted. Empty - * string filter is not allowed. This filter can also be used with - * ListUserEvents API to list events that will be deleted. The eligible fields - * for filtering are: - * * eventType - UserEvent.eventType field of type string. - * * eventTime - in ISO 8601 "zulu" format. - * * visitorId - field of type string. Specifying this will delete all events - * associated with a visitor. - * * userId - field of type string. Specifying this will delete all events - * associated with a user. - * Example 1: Deleting all events in a time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < - * "2012-04-23T18:30:43.511Z"` - * Example 2: Deleting specific eventType in time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * Example 3: Deleting all events for a specific visitor - * `visitorId = visitor1024` - * The filtering fields are assumed to have an implicit AND. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Required. The filter string to specify the events to be deleted. Empty - * string filter is not allowed. This filter can also be used with - * ListUserEvents API to list events that will be deleted. The eligible fields - * for filtering are: - * * eventType - UserEvent.eventType field of type string. - * * eventTime - in ISO 8601 "zulu" format. - * * visitorId - field of type string. Specifying this will delete all events - * associated with a visitor. - * * userId - field of type string. Specifying this will delete all events - * associated with a user. - * Example 1: Deleting all events in a time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < - * "2012-04-23T18:30:43.511Z"` - * Example 2: Deleting specific eventType in time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * Example 3: Deleting all events for a specific visitor - * `visitorId = visitor1024` - * The filtering fields are assumed to have an implicit AND. - * - * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Optional. The default value is false. Override this flag to true to - * actually perform the purge. If the field is not set to true, a sampling of - * events to be deleted will be returned. - * - * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getForce() - { - return $this->force; - } - - /** - * Optional. The default value is false. Override this flag to true to - * actually perform the purge. If the field is not set to true, a sampling of - * events to be deleted will be returned. - * - * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setForce($var) - { - GPBUtil::checkBool($var); - $this->force = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsResponse.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsResponse.php deleted file mode 100644 index 2ebd0d0f92e4..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/PurgeUserEventsResponse.php +++ /dev/null @@ -1,107 +0,0 @@ -google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse - */ -class PurgeUserEventsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The total count of events purged as a result of the operation. - * - * Generated from protobuf field int64 purged_events_count = 1; - */ - protected $purged_events_count = 0; - /** - * A sampling of events deleted (or will be deleted) depending on the `force` - * property in the request. Max of 500 items will be returned. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; - */ - private $user_events_sample; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $purged_events_count - * The total count of events purged as a result of the operation. - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $user_events_sample - * A sampling of events deleted (or will be deleted) depending on the `force` - * property in the request. Max of 500 items will be returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * The total count of events purged as a result of the operation. - * - * Generated from protobuf field int64 purged_events_count = 1; - * @return int|string - */ - public function getPurgedEventsCount() - { - return $this->purged_events_count; - } - - /** - * The total count of events purged as a result of the operation. - * - * Generated from protobuf field int64 purged_events_count = 1; - * @param int|string $var - * @return $this - */ - public function setPurgedEventsCount($var) - { - GPBUtil::checkInt64($var); - $this->purged_events_count = $var; - - return $this; - } - - /** - * A sampling of events deleted (or will be deleted) depending on the `force` - * property in the request. Max of 500 items will be returned. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUserEventsSample() - { - return $this->user_events_sample; - } - - /** - * A sampling of events deleted (or will be deleted) depending on the `force` - * property in the request. Max of 500 items will be returned. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events_sample = 2; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUserEventsSample($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); - $this->user_events_sample = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php deleted file mode 100644 index a3c4899b1317..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UpdateCatalogItemRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest - */ -class UpdateCatalogItemRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Full resource name of catalog item, such as - * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. The catalog item to update/create. The 'catalog_item_id' field - * has to match that in the 'name'. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $catalog_item = null; - /** - * Optional. Indicates which fields in the provided 'item' to update. If not - * set, will by default update all fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; - */ - protected $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Full resource name of catalog item, such as - * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". - * @type \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $catalog_item - * Required. The catalog item to update/create. The 'catalog_item_id' field - * has to match that in the 'name'. - * @type \Google\Protobuf\FieldMask $update_mask - * Optional. Indicates which fields in the provided 'item' to update. If not - * set, will by default update all fields. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\CatalogService::initOnce(); - parent::__construct($data); - } - - /** - * Required. Full resource name of catalog item, such as - * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Full resource name of catalog item, such as - * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The catalog item to update/create. The 'catalog_item_id' field - * has to match that in the 'name'. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem|null - */ - public function getCatalogItem() - { - return $this->catalog_item; - } - - public function hasCatalogItem() - { - return isset($this->catalog_item); - } - - public function clearCatalogItem() - { - unset($this->catalog_item); - } - - /** - * Required. The catalog item to update/create. The 'catalog_item_id' field - * has to match that in the 'name'. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.CatalogItem catalog_item = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem $var - * @return $this - */ - public function setCatalogItem($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem::class); - $this->catalog_item = $var; - - return $this; - } - - /** - * Optional. Indicates which fields in the provided 'item' to update. If not - * set, will by default update all fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Optional. Indicates which fields in the provided 'item' to update. If not - * set, will by default update all fields. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 3; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent.php deleted file mode 100644 index 1d27319722d5..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent.php +++ /dev/null @@ -1,422 +0,0 @@ -google.cloud.recommendationengine.v1beta1.UserEvent - */ -class UserEvent extends \Google\Protobuf\Internal\Message -{ - /** - * Required. User event type. Allowed values are: - * * `add-to-cart` Products being added to cart. - * * `add-to-list` Items being added to a list (shopping list, favorites - * etc). - * * `category-page-view` Special pages such as sale or promotion pages - * viewed. - * * `checkout-start` User starting a checkout process. - * * `detail-page-view` Products detail page viewed. - * * `home-page-view` Homepage viewed. - * * `page-visit` Generic page visits not included in the event types above. - * * `purchase-complete` User finishing a purchase. - * * `refund` Purchased items being refunded or returned. - * * `remove-from-cart` Products being removed from cart. - * * `remove-from-list` Items being removed from a list. - * * `search` Product search. - * * `shopping-cart-page-view` User viewing a shopping cart. - * * `impression` List of items displayed. Used by Google Tag Manager. - * - * Generated from protobuf field string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $event_type = ''; - /** - * Required. User information. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_info = null; - /** - * Optional. User event detailed information common across different - * recommendation types. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $event_detail = null; - /** - * Optional. Retail product specific user event metadata. - * This field is required for the following event types: - * * `add-to-cart` - * * `add-to-list` - * * `category-page-view` - * * `checkout-start` - * * `detail-page-view` - * * `purchase-complete` - * * `refund` - * * `remove-from-cart` - * * `remove-from-list` - * * `search` - * This field is optional for the following event types: - * * `page-visit` - * * `shopping-cart-page-view` - note that 'product_event_detail' should be - * set for this unless the shopping cart is empty. - * This field is not allowed for the following event types: - * * `home-page-view` - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $product_event_detail = null; - /** - * Optional. Only required for ImportUserEvents method. Timestamp of user - * event created. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $event_time = null; - /** - * Optional. This field should *not* be set when using JavaScript pixel - * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $event_source = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $event_type - * Required. User event type. Allowed values are: - * * `add-to-cart` Products being added to cart. - * * `add-to-list` Items being added to a list (shopping list, favorites - * etc). - * * `category-page-view` Special pages such as sale or promotion pages - * viewed. - * * `checkout-start` User starting a checkout process. - * * `detail-page-view` Products detail page viewed. - * * `home-page-view` Homepage viewed. - * * `page-visit` Generic page visits not included in the event types above. - * * `purchase-complete` User finishing a purchase. - * * `refund` Purchased items being refunded or returned. - * * `remove-from-cart` Products being removed from cart. - * * `remove-from-list` Items being removed from a list. - * * `search` Product search. - * * `shopping-cart-page-view` User viewing a shopping cart. - * * `impression` List of items displayed. Used by Google Tag Manager. - * @type \Google\Cloud\RecommendationEngine\V1beta1\UserInfo $user_info - * Required. User information. - * @type \Google\Cloud\RecommendationEngine\V1beta1\EventDetail $event_detail - * Optional. User event detailed information common across different - * recommendation types. - * @type \Google\Cloud\RecommendationEngine\V1beta1\ProductEventDetail $product_event_detail - * Optional. Retail product specific user event metadata. - * This field is required for the following event types: - * * `add-to-cart` - * * `add-to-list` - * * `category-page-view` - * * `checkout-start` - * * `detail-page-view` - * * `purchase-complete` - * * `refund` - * * `remove-from-cart` - * * `remove-from-list` - * * `search` - * This field is optional for the following event types: - * * `page-visit` - * * `shopping-cart-page-view` - note that 'product_event_detail' should be - * set for this unless the shopping cart is empty. - * This field is not allowed for the following event types: - * * `home-page-view` - * @type \Google\Protobuf\Timestamp $event_time - * Optional. Only required for ImportUserEvents method. Timestamp of user - * event created. - * @type int $event_source - * Optional. This field should *not* be set when using JavaScript pixel - * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * Required. User event type. Allowed values are: - * * `add-to-cart` Products being added to cart. - * * `add-to-list` Items being added to a list (shopping list, favorites - * etc). - * * `category-page-view` Special pages such as sale or promotion pages - * viewed. - * * `checkout-start` User starting a checkout process. - * * `detail-page-view` Products detail page viewed. - * * `home-page-view` Homepage viewed. - * * `page-visit` Generic page visits not included in the event types above. - * * `purchase-complete` User finishing a purchase. - * * `refund` Purchased items being refunded or returned. - * * `remove-from-cart` Products being removed from cart. - * * `remove-from-list` Items being removed from a list. - * * `search` Product search. - * * `shopping-cart-page-view` User viewing a shopping cart. - * * `impression` List of items displayed. Used by Google Tag Manager. - * - * Generated from protobuf field string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getEventType() - { - return $this->event_type; - } - - /** - * Required. User event type. Allowed values are: - * * `add-to-cart` Products being added to cart. - * * `add-to-list` Items being added to a list (shopping list, favorites - * etc). - * * `category-page-view` Special pages such as sale or promotion pages - * viewed. - * * `checkout-start` User starting a checkout process. - * * `detail-page-view` Products detail page viewed. - * * `home-page-view` Homepage viewed. - * * `page-visit` Generic page visits not included in the event types above. - * * `purchase-complete` User finishing a purchase. - * * `refund` Purchased items being refunded or returned. - * * `remove-from-cart` Products being removed from cart. - * * `remove-from-list` Items being removed from a list. - * * `search` Product search. - * * `shopping-cart-page-view` User viewing a shopping cart. - * * `impression` List of items displayed. Used by Google Tag Manager. - * - * Generated from protobuf field string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setEventType($var) - { - GPBUtil::checkString($var, True); - $this->event_type = $var; - - return $this; - } - - /** - * Required. User information. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\UserInfo|null - */ - public function getUserInfo() - { - return $this->user_info; - } - - public function hasUserInfo() - { - return isset($this->user_info); - } - - public function clearUserInfo() - { - unset($this->user_info); - } - - /** - * Required. User information. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserInfo user_info = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\UserInfo $var - * @return $this - */ - public function setUserInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserInfo::class); - $this->user_info = $var; - - return $this; - } - - /** - * Optional. User event detailed information common across different - * recommendation types. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\EventDetail|null - */ - public function getEventDetail() - { - return $this->event_detail; - } - - public function hasEventDetail() - { - return isset($this->event_detail); - } - - public function clearEventDetail() - { - unset($this->event_detail); - } - - /** - * Optional. User event detailed information common across different - * recommendation types. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.EventDetail event_detail = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\EventDetail $var - * @return $this - */ - public function setEventDetail($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\EventDetail::class); - $this->event_detail = $var; - - return $this; - } - - /** - * Optional. Retail product specific user event metadata. - * This field is required for the following event types: - * * `add-to-cart` - * * `add-to-list` - * * `category-page-view` - * * `checkout-start` - * * `detail-page-view` - * * `purchase-complete` - * * `refund` - * * `remove-from-cart` - * * `remove-from-list` - * * `search` - * This field is optional for the following event types: - * * `page-visit` - * * `shopping-cart-page-view` - note that 'product_event_detail' should be - * set for this unless the shopping cart is empty. - * This field is not allowed for the following event types: - * * `home-page-view` - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\ProductEventDetail|null - */ - public function getProductEventDetail() - { - return $this->product_event_detail; - } - - public function hasProductEventDetail() - { - return isset($this->product_event_detail); - } - - public function clearProductEventDetail() - { - unset($this->product_event_detail); - } - - /** - * Optional. Retail product specific user event metadata. - * This field is required for the following event types: - * * `add-to-cart` - * * `add-to-list` - * * `category-page-view` - * * `checkout-start` - * * `detail-page-view` - * * `purchase-complete` - * * `refund` - * * `remove-from-cart` - * * `remove-from-list` - * * `search` - * This field is optional for the following event types: - * * `page-visit` - * * `shopping-cart-page-view` - note that 'product_event_detail' should be - * set for this unless the shopping cart is empty. - * This field is not allowed for the following event types: - * * `home-page-view` - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.ProductEventDetail product_event_detail = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\ProductEventDetail $var - * @return $this - */ - public function setProductEventDetail($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\ProductEventDetail::class); - $this->product_event_detail = $var; - - return $this; - } - - /** - * Optional. Only required for ImportUserEvents method. Timestamp of user - * event created. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEventTime() - { - return $this->event_time; - } - - public function hasEventTime() - { - return isset($this->event_time); - } - - public function clearEventTime() - { - unset($this->event_time); - } - - /** - * Optional. Only required for ImportUserEvents method. Timestamp of user - * event created. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEventTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->event_time = $var; - - return $this; - } - - /** - * Optional. This field should *not* be set when using JavaScript pixel - * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getEventSource() - { - return $this->event_source; - } - - /** - * Optional. This field should *not* be set when using JavaScript pixel - * or the Recommendations AI Tag. Defaults to `EVENT_SOURCE_UNSPECIFIED`. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent.EventSource event_source = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setEventSource($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent\EventSource::class); - $this->event_source = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent/EventSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent/EventSource.php deleted file mode 100644 index 32d9d868294a..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent/EventSource.php +++ /dev/null @@ -1,73 +0,0 @@ -google.cloud.recommendationengine.v1beta1.UserEvent.EventSource - */ -class EventSource -{ - /** - * Unspecified event source. - * - * Generated from protobuf enum EVENT_SOURCE_UNSPECIFIED = 0; - */ - const EVENT_SOURCE_UNSPECIFIED = 0; - /** - * The event is ingested via a javascript pixel or Recommendations AI Tag - * through automl datalayer or JS Macros. - * - * Generated from protobuf enum AUTOML = 1; - */ - const AUTOML = 1; - /** - * The event is ingested via Recommendations AI Tag through Enhanced - * Ecommerce datalayer. - * - * Generated from protobuf enum ECOMMERCE = 2; - */ - const ECOMMERCE = 2; - /** - * The event is ingested via Import user events API. - * - * Generated from protobuf enum BATCH_UPLOAD = 3; - */ - const BATCH_UPLOAD = 3; - - private static $valueToName = [ - self::EVENT_SOURCE_UNSPECIFIED => 'EVENT_SOURCE_UNSPECIFIED', - self::AUTOML => 'AUTOML', - self::ECOMMERCE => 'ECOMMERCE', - self::BATCH_UPLOAD => 'BATCH_UPLOAD', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(EventSource::class, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent_EventSource::class); - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventImportSummary.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventImportSummary.php deleted file mode 100644 index 5d66aa96e6e4..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventImportSummary.php +++ /dev/null @@ -1,106 +0,0 @@ -google.cloud.recommendationengine.v1beta1.UserEventImportSummary - */ -class UserEventImportSummary extends \Google\Protobuf\Internal\Message -{ - /** - * Count of user events imported with complete existing catalog information. - * - * Generated from protobuf field int64 joined_events_count = 1; - */ - protected $joined_events_count = 0; - /** - * Count of user events imported, but with catalog information not found - * in the imported catalog. - * - * Generated from protobuf field int64 unjoined_events_count = 2; - */ - protected $unjoined_events_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $joined_events_count - * Count of user events imported with complete existing catalog information. - * @type int|string $unjoined_events_count - * Count of user events imported, but with catalog information not found - * in the imported catalog. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * Count of user events imported with complete existing catalog information. - * - * Generated from protobuf field int64 joined_events_count = 1; - * @return int|string - */ - public function getJoinedEventsCount() - { - return $this->joined_events_count; - } - - /** - * Count of user events imported with complete existing catalog information. - * - * Generated from protobuf field int64 joined_events_count = 1; - * @param int|string $var - * @return $this - */ - public function setJoinedEventsCount($var) - { - GPBUtil::checkInt64($var); - $this->joined_events_count = $var; - - return $this; - } - - /** - * Count of user events imported, but with catalog information not found - * in the imported catalog. - * - * Generated from protobuf field int64 unjoined_events_count = 2; - * @return int|string - */ - public function getUnjoinedEventsCount() - { - return $this->unjoined_events_count; - } - - /** - * Count of user events imported, but with catalog information not found - * in the imported catalog. - * - * Generated from protobuf field int64 unjoined_events_count = 2; - * @param int|string $var - * @return $this - */ - public function setUnjoinedEventsCount($var) - { - GPBUtil::checkInt64($var); - $this->unjoined_events_count = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventInlineSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventInlineSource.php deleted file mode 100644 index 65b1597982a9..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventInlineSource.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.recommendationengine.v1beta1.UserEventInlineSource - */ -class UserEventInlineSource extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. A list of user events to import. Recommended max of 10k items. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $user_events; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $user_events - * Optional. A list of user events to import. Recommended max of 10k items. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\Import::initOnce(); - parent::__construct($data); - } - - /** - * Optional. A list of user events to import. Recommended max of 10k items. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUserEvents() - { - return $this->user_events; - } - - /** - * Optional. A list of user events to import. Recommended max of 10k items. - * - * Generated from protobuf field repeated .google.cloud.recommendationengine.v1beta1.UserEvent user_events = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\RecommendationEngine\V1beta1\UserEvent>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUserEvents($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); - $this->user_events = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventServiceGrpcClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventServiceGrpcClient.php deleted file mode 100644 index d3413e43cbfd..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEventServiceGrpcClient.php +++ /dev/null @@ -1,123 +0,0 @@ -_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/WriteUserEvent', - $argument, - ['\Google\Cloud\RecommendationEngine\V1beta1\UserEvent', 'decode'], - $metadata, $options); - } - - /** - * Writes a single user event from the browser. This uses a GET request to - * due to browser restriction of POST-ing to a 3rd party domain. - * - * This method is used only by the Recommendations AI JavaScript pixel. - * Users should not call this method directly. - * @param \Google\Cloud\RecommendationEngine\V1beta1\CollectUserEventRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CollectUserEvent(\Google\Cloud\RecommendationEngine\V1beta1\CollectUserEventRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/CollectUserEvent', - $argument, - ['\Google\Api\HttpBody', 'decode'], - $metadata, $options); - } - - /** - * Gets a list of user events within a time range, with potential filtering. - * @param \Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListUserEvents(\Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/ListUserEvents', - $argument, - ['\Google\Cloud\RecommendationEngine\V1beta1\ListUserEventsResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes permanently all user events specified by the filter provided. - * Depending on the number of events specified by the filter, this operation - * could take hours or days to complete. To test a filter, use the list - * command first. - * @param \Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function PurgeUserEvents(\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/PurgeUserEvents', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Bulk import of User events. Request processing might be - * synchronous. Events that already exist are skipped. - * Use this method for backfilling historical user events. - * - * Operation.response is of type ImportResponse. Note that it is - * possible for a subset of the items to be successfully inserted. - * Operation.metadata is of type ImportMetadata. - * @param \Google\Cloud\RecommendationEngine\V1beta1\ImportUserEventsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ImportUserEvents(\Google\Cloud\RecommendationEngine\V1beta1\ImportUserEventsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.recommendationengine.v1beta1.UserEventService/ImportUserEvents', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent_EventSource.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent_EventSource.php deleted file mode 100644 index a1a76c364d8e..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/UserEvent_EventSource.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.recommendationengine.v1beta1.UserInfo - */ -class UserInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A unique identifier for tracking visitors with a length limit of - * 128 bytes. - * For example, this could be implemented with a http cookie, which should be - * able to uniquely identify a visitor on a single device. This unique - * identifier should not change if the visitor log in/out of the website. - * Maximum length 128 bytes. Cannot be empty. - * - * Generated from protobuf field string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $visitor_id = ''; - /** - * Optional. Unique identifier for logged-in user with a length limit of 128 - * bytes. Required only for logged-in users. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $user_id = ''; - /** - * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or - * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be - * set when using the javascript pixel or if `direct_user_request` is set. - * Used to extract location information for personalization. - * - * Generated from protobuf field string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $ip_address = ''; - /** - * Optional. User agent as included in the HTTP header. UTF-8 encoded string - * with a length limit of 1 KiB. - * This should *not* be set when using the JavaScript pixel or if - * `directUserRequest` is set. - * - * Generated from protobuf field string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $user_agent = ''; - /** - * Optional. Indicates if the request is made directly from the end user - * in which case the user_agent and ip_address fields can be populated - * from the HTTP request. This should *not* be set when using the javascript - * pixel. This flag should be set only if the API request is made directly - * from the end user such as a mobile app (and not if a gateway or a server is - * processing and pushing the user events). - * - * Generated from protobuf field bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $direct_user_request = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $visitor_id - * Required. A unique identifier for tracking visitors with a length limit of - * 128 bytes. - * For example, this could be implemented with a http cookie, which should be - * able to uniquely identify a visitor on a single device. This unique - * identifier should not change if the visitor log in/out of the website. - * Maximum length 128 bytes. Cannot be empty. - * @type string $user_id - * Optional. Unique identifier for logged-in user with a length limit of 128 - * bytes. Required only for logged-in users. - * @type string $ip_address - * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or - * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be - * set when using the javascript pixel or if `direct_user_request` is set. - * Used to extract location information for personalization. - * @type string $user_agent - * Optional. User agent as included in the HTTP header. UTF-8 encoded string - * with a length limit of 1 KiB. - * This should *not* be set when using the JavaScript pixel or if - * `directUserRequest` is set. - * @type bool $direct_user_request - * Optional. Indicates if the request is made directly from the end user - * in which case the user_agent and ip_address fields can be populated - * from the HTTP request. This should *not* be set when using the javascript - * pixel. This flag should be set only if the API request is made directly - * from the end user such as a mobile app (and not if a gateway or a server is - * processing and pushing the user events). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEvent::initOnce(); - parent::__construct($data); - } - - /** - * Required. A unique identifier for tracking visitors with a length limit of - * 128 bytes. - * For example, this could be implemented with a http cookie, which should be - * able to uniquely identify a visitor on a single device. This unique - * identifier should not change if the visitor log in/out of the website. - * Maximum length 128 bytes. Cannot be empty. - * - * Generated from protobuf field string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getVisitorId() - { - return $this->visitor_id; - } - - /** - * Required. A unique identifier for tracking visitors with a length limit of - * 128 bytes. - * For example, this could be implemented with a http cookie, which should be - * able to uniquely identify a visitor on a single device. This unique - * identifier should not change if the visitor log in/out of the website. - * Maximum length 128 bytes. Cannot be empty. - * - * Generated from protobuf field string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setVisitorId($var) - { - GPBUtil::checkString($var, True); - $this->visitor_id = $var; - - return $this; - } - - /** - * Optional. Unique identifier for logged-in user with a length limit of 128 - * bytes. Required only for logged-in users. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getUserId() - { - return $this->user_id; - } - - /** - * Optional. Unique identifier for logged-in user with a length limit of 128 - * bytes. Required only for logged-in users. - * - * Generated from protobuf field string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setUserId($var) - { - GPBUtil::checkString($var, True); - $this->user_id = $var; - - return $this; - } - - /** - * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or - * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be - * set when using the javascript pixel or if `direct_user_request` is set. - * Used to extract location information for personalization. - * - * Generated from protobuf field string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getIpAddress() - { - return $this->ip_address; - } - - /** - * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or - * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be - * set when using the javascript pixel or if `direct_user_request` is set. - * Used to extract location information for personalization. - * - * Generated from protobuf field string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setIpAddress($var) - { - GPBUtil::checkString($var, True); - $this->ip_address = $var; - - return $this; - } - - /** - * Optional. User agent as included in the HTTP header. UTF-8 encoded string - * with a length limit of 1 KiB. - * This should *not* be set when using the JavaScript pixel or if - * `directUserRequest` is set. - * - * Generated from protobuf field string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getUserAgent() - { - return $this->user_agent; - } - - /** - * Optional. User agent as included in the HTTP header. UTF-8 encoded string - * with a length limit of 1 KiB. - * This should *not* be set when using the JavaScript pixel or if - * `directUserRequest` is set. - * - * Generated from protobuf field string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setUserAgent($var) - { - GPBUtil::checkString($var, True); - $this->user_agent = $var; - - return $this; - } - - /** - * Optional. Indicates if the request is made directly from the end user - * in which case the user_agent and ip_address fields can be populated - * from the HTTP request. This should *not* be set when using the javascript - * pixel. This flag should be set only if the API request is made directly - * from the end user such as a mobile app (and not if a gateway or a server is - * processing and pushing the user events). - * - * Generated from protobuf field bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getDirectUserRequest() - { - return $this->direct_user_request; - } - - /** - * Optional. Indicates if the request is made directly from the end user - * in which case the user_agent and ip_address fields can be populated - * from the HTTP request. This should *not* be set when using the javascript - * pixel. This flag should be set only if the API request is made directly - * from the end user such as a mobile app (and not if a gateway or a server is - * processing and pushing the user events). - * - * Generated from protobuf field bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setDirectUserRequest($var) - { - GPBUtil::checkBool($var); - $this->direct_user_request = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php b/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php deleted file mode 100644 index c13bd5bae366..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/proto/src/Google/Cloud/RecommendationEngine/V1beta1/WriteUserEventRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.cloud.recommendationengine.v1beta1.WriteUserEventRequest - */ -class WriteUserEventRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent eventStore resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. User event to write. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $user_event = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent eventStore resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * @type \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $user_event - * Required. User event to write. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Recommendationengine\V1Beta1\UserEventService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent eventStore resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent eventStore resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. User event to write. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEvent|null - */ - public function getUserEvent() - { - return $this->user_event; - } - - public function hasUserEvent() - { - return isset($this->user_event); - } - - public function clearUserEvent() - { - unset($this->user_event); - } - - /** - * Required. User event to write. - * - * Generated from protobuf field .google.cloud.recommendationengine.v1beta1.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\RecommendationEngine\V1beta1\UserEvent $var - * @return $this - */ - public function setUserEvent($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\RecommendationEngine\V1beta1\UserEvent::class); - $this->user_event = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php deleted file mode 100644 index 93c362ed9186..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/CatalogServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ -catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - * $catalogItem = new CatalogItem(); - * $response = $catalogServiceClient->createCatalogItem($formattedParent, $catalogItem); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class CatalogServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.CatalogService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $catalogNameTemplate; - - private static $catalogItemPathNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/catalog_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/catalog_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/catalog_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/catalog_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getCatalogNameTemplate() - { - if (self::$catalogNameTemplate == null) { - self::$catalogNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}'); - } - - return self::$catalogNameTemplate; - } - - private static function getCatalogItemPathNameTemplate() - { - if (self::$catalogItemPathNameTemplate == null) { - self::$catalogItemPathNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path}'); - } - - return self::$catalogItemPathNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'catalog' => self::getCatalogNameTemplate(), - 'catalogItemPath' => self::getCatalogItemPathNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a catalog - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * - * @return string The formatted catalog resource. - * - * @experimental - */ - public static function catalogName($project, $location, $catalog) - { - return self::getCatalogNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * catalog_item_path resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $catalogItemPath - * - * @return string The formatted catalog_item_path resource. - * - * @experimental - */ - public static function catalogItemPathName($project, $location, $catalog, $catalogItemPath) - { - return self::getCatalogItemPathNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'catalog_item_path' => $catalogItemPath, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - catalog: projects/{project}/locations/{location}/catalogs/{catalog} - * - catalogItemPath: projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'recommendationengine.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates a catalog item. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - * $catalogItem = new CatalogItem(); - * $response = $catalogServiceClient->createCatalogItem($formattedParent, $catalogItem); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * @param CatalogItem $catalogItem Required. The catalog item to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createCatalogItem($parent, $catalogItem, array $optionalArgs = []) - { - $request = new CreateCatalogItemRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCatalogItem($catalogItem); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateCatalogItem', CatalogItem::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a catalog item. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); - * $catalogServiceClient->deleteCatalogItem($formattedName); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteCatalogItem($name, array $optionalArgs = []) - { - $request = new DeleteCatalogItemRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteCatalogItem', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a specific catalog item. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); - * $response = $catalogServiceClient->getCatalogItem($formattedName); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Full resource name of catalog item, such as - * `projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id`. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getCatalogItem($name, array $optionalArgs = []) - { - $request = new GetCatalogItemRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetCatalogItem', CatalogItem::class, $optionalArgs, $request)->wait(); - } - - /** - * Bulk import of multiple catalog items. Request processing may be - * synchronous. No partial updating supported. Non-existing items will be - * created. - * - * Operation.response is of type ImportResponse. Note that it is - * possible for a subset of the items to be successfully updated. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - * $inputConfig = new InputConfig(); - * $operationResponse = $catalogServiceClient->importCatalogItems($formattedParent, $inputConfig); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $catalogServiceClient->importCatalogItems($formattedParent, $inputConfig); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $catalogServiceClient->resumeOperation($operationName, 'importCatalogItems'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. `projects/1234/locations/global/catalogs/default_catalog` - * @param InputConfig $inputConfig Required. The desired input location of the data. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency and used for request deduplication. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. - * @type ImportErrorsConfig $errorsConfig - * Optional. The desired location of errors incurred during the Import. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function importCatalogItems($parent, $inputConfig, array $optionalArgs = []) - { - $request = new ImportCatalogItemsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInputConfig($inputConfig); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['errorsConfig'])) { - $request->setErrorsConfig($optionalArgs['errorsConfig']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportCatalogItems', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets a list of catalog items. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedParent = $catalogServiceClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - * // Iterate over pages of elements - * $pagedResponse = $catalogServiceClient->listCatalogItems($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $catalogServiceClient->listCatalogItems($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent catalog resource name, such as - * `projects/*/locations/global/catalogs/default_catalog`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. A filter to apply on the list results. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listCatalogItems($parent, array $optionalArgs = []) - { - $request = new ListCatalogItemsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListCatalogItems', $optionalArgs, ListCatalogItemsResponse::class, $request); - } - - /** - * Updates a catalog item. Partial updating is supported. Non-existing - * items will be created. - * - * Sample code: - * ``` - * $catalogServiceClient = new CatalogServiceClient(); - * try { - * $formattedName = $catalogServiceClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); - * $catalogItem = new CatalogItem(); - * $response = $catalogServiceClient->updateCatalogItem($formattedName, $catalogItem); - * } finally { - * $catalogServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Full resource name of catalog item, such as - * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id". - * @param CatalogItem $catalogItem Required. The catalog item to update/create. The 'catalog_item_id' field - * has to match that in the 'name'. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Optional. Indicates which fields in the provided 'item' to update. If not - * set, will by default update all fields. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\CatalogItem - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateCatalogItem($name, $catalogItem, array $optionalArgs = []) - { - $request = new UpdateCatalogItemRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setCatalogItem($catalogItem); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateCatalogItem', CatalogItem::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php deleted file mode 100644 index fcc5d51fa854..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionApiKeyRegistryGapicClient.php +++ /dev/null @@ -1,469 +0,0 @@ -eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - * $predictionApiKeyRegistration = new PredictionApiKeyRegistration(); - * $response = $predictionApiKeyRegistryClient->createPredictionApiKeyRegistration($formattedParent, $predictionApiKeyRegistration); - * } finally { - * $predictionApiKeyRegistryClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class PredictionApiKeyRegistryGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $eventStoreNameTemplate; - - private static $predictionApiKeyRegistrationNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/prediction_api_key_registry_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/prediction_api_key_registry_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/prediction_api_key_registry_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/prediction_api_key_registry_rest_client_config.php', - ], - ], - ]; - } - - private static function getEventStoreNameTemplate() - { - if (self::$eventStoreNameTemplate == null) { - self::$eventStoreNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}'); - } - - return self::$eventStoreNameTemplate; - } - - private static function getPredictionApiKeyRegistrationNameTemplate() - { - if (self::$predictionApiKeyRegistrationNameTemplate == null) { - self::$predictionApiKeyRegistrationNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}'); - } - - return self::$predictionApiKeyRegistrationNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'eventStore' => self::getEventStoreNameTemplate(), - 'predictionApiKeyRegistration' => self::getPredictionApiKeyRegistrationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a event_store - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $eventStore - * - * @return string The formatted event_store resource. - * - * @experimental - */ - public static function eventStoreName($project, $location, $catalog, $eventStore) - { - return self::getEventStoreNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'event_store' => $eventStore, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * prediction_api_key_registration resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $eventStore - * @param string $predictionApiKeyRegistration - * - * @return string The formatted prediction_api_key_registration resource. - * - * @experimental - */ - public static function predictionApiKeyRegistrationName($project, $location, $catalog, $eventStore, $predictionApiKeyRegistration) - { - return self::getPredictionApiKeyRegistrationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'event_store' => $eventStore, - 'prediction_api_key_registration' => $predictionApiKeyRegistration, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - eventStore: projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store} - * - predictionApiKeyRegistration: projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'recommendationengine.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Register an API key for use with predict method. - * - * Sample code: - * ``` - * $predictionApiKeyRegistryClient = new PredictionApiKeyRegistryClient(); - * try { - * $formattedParent = $predictionApiKeyRegistryClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - * $predictionApiKeyRegistration = new PredictionApiKeyRegistration(); - * $response = $predictionApiKeyRegistryClient->createPredictionApiKeyRegistration($formattedParent, $predictionApiKeyRegistration); - * } finally { - * $predictionApiKeyRegistryClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * @param PredictionApiKeyRegistration $predictionApiKeyRegistration Required. The prediction API key registration. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\PredictionApiKeyRegistration - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createPredictionApiKeyRegistration($parent, $predictionApiKeyRegistration, array $optionalArgs = []) - { - $request = new CreatePredictionApiKeyRegistrationRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPredictionApiKeyRegistration($predictionApiKeyRegistration); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreatePredictionApiKeyRegistration', PredictionApiKeyRegistration::class, $optionalArgs, $request)->wait(); - } - - /** - * Unregister an apiKey from using for predict method. - * - * Sample code: - * ``` - * $predictionApiKeyRegistryClient = new PredictionApiKeyRegistryClient(); - * try { - * $formattedName = $predictionApiKeyRegistryClient->predictionApiKeyRegistrationName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PREDICTION_API_KEY_REGISTRATION]'); - * $predictionApiKeyRegistryClient->deletePredictionApiKeyRegistration($formattedName); - * } finally { - * $predictionApiKeyRegistryClient->close(); - * } - * ``` - * - * @param string $name Required. The API key to unregister including full resource path. - * `projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deletePredictionApiKeyRegistration($name, array $optionalArgs = []) - { - $request = new DeletePredictionApiKeyRegistrationRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeletePredictionApiKeyRegistration', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * List the registered apiKeys for use with predict method. - * - * Sample code: - * ``` - * $predictionApiKeyRegistryClient = new PredictionApiKeyRegistryClient(); - * try { - * $formattedParent = $predictionApiKeyRegistryClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - * // Iterate over pages of elements - * $pagedResponse = $predictionApiKeyRegistryClient->listPredictionApiKeyRegistrations($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $predictionApiKeyRegistryClient->listPredictionApiKeyRegistrations($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $predictionApiKeyRegistryClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent placement resource name such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listPredictionApiKeyRegistrations($parent, array $optionalArgs = []) - { - $request = new ListPredictionApiKeyRegistrationsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListPredictionApiKeyRegistrations', $optionalArgs, ListPredictionApiKeyRegistrationsResponse::class, $request); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php deleted file mode 100644 index 44331dd823aa..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/PredictionServiceGapicClient.php +++ /dev/null @@ -1,454 +0,0 @@ -placementName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PLACEMENT]'); - * $userEvent = new UserEvent(); - * // Iterate over pages of elements - * $pagedResponse = $predictionServiceClient->predict($formattedName, $userEvent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $predictionServiceClient->predict($formattedName, $userEvent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class PredictionServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.PredictionService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $placementNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/prediction_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/prediction_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/prediction_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/prediction_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getPlacementNameTemplate() - { - if (self::$placementNameTemplate == null) { - self::$placementNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}'); - } - - return self::$placementNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'placement' => self::getPlacementNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a placement - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $eventStore - * @param string $placement - * - * @return string The formatted placement resource. - * - * @experimental - */ - public static function placementName($project, $location, $catalog, $eventStore, $placement) - { - return self::getPlacementNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'event_store' => $eventStore, - 'placement' => $placement, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - placement: projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'recommendationengine.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Makes a recommendation prediction. If using API Key based authentication, - * the API Key must be registered using the - * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry] - * service. [Learn more](/recommendations-ai/docs/setting-up#register-key). - * - * Sample code: - * ``` - * $predictionServiceClient = new PredictionServiceClient(); - * try { - * $formattedName = $predictionServiceClient->placementName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PLACEMENT]'); - * $userEvent = new UserEvent(); - * // Iterate over pages of elements - * $pagedResponse = $predictionServiceClient->predict($formattedName, $userEvent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $predictionServiceClient->predict($formattedName, $userEvent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $predictionServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Full resource name of the format: - * `{name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}` - * The id of the recommendation engine placement. This id is used to identify - * the set of models that will be used to make the prediction. - * - * We currently support three placements with the following IDs by default: - * - * * `shopping_cart`: Predicts items frequently bought together with one or - * more catalog items in the same shopping session. Commonly displayed after - * `add-to-cart` events, on product detail pages, or on the shopping cart - * page. - * - * * `home_page`: Predicts the next product that a user will most likely - * engage with or purchase based on the shopping or viewing history of the - * specified `userId` or `visitorId`. For example - Recommendations for you. - * - * * `product_detail`: Predicts the next product that a user will most likely - * engage with or purchase. The prediction is based on the shopping or - * viewing history of the specified `userId` or `visitorId` and its - * relevance to a specified `CatalogItem`. Typically used on product detail - * pages. For example - More items like this. - * - * * `recently_viewed_default`: Returns up to 75 items recently viewed by the - * specified `userId` or `visitorId`, most recent ones first. Returns - * nothing if neither of them has viewed any items yet. For example - - * Recently viewed. - * - * The full list of available placements can be seen at - * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard - * @param UserEvent $userEvent Required. Context about the user, what they are looking at and what action - * they took to trigger the predict request. Note that this user event detail - * won't be ingested to userEvent logs. Thus, a separate userEvent write - * request is required for event logging. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filter for restricting prediction results. Accepts values for - * tags and the `filterOutOfStockItems` flag. - * - * * Tag expressions. Restricts predictions to items that match all of the - * specified tags. Boolean operators `OR` and `NOT` are supported if the - * expression is enclosed in parentheses, and must be separated from the - * tag values by a space. `-"tagA"` is also supported and is equivalent to - * `NOT "tagA"`. Tag values must be double quoted UTF-8 encoded strings - * with a size limit of 1 KiB. - * - * * filterOutOfStockItems. Restricts predictions to items that do not have a - * stockState value of OUT_OF_STOCK. - * - * Examples: - * - * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") - * * filterOutOfStockItems tag=(-"promotional") - * * filterOutOfStockItems - * @type bool $dryRun - * Optional. Use dryRun mode for this prediction query. If set to true, a - * dummy model will be used that returns arbitrary catalog items. - * Note that the dryRun mode should only be used for testing the API, or if - * the model is not ready. - * @type array $params - * Optional. Additional domain specific parameters for the predictions. - * - * Allowed values: - * - * * `returnCatalogItem`: Boolean. If set to true, the associated catalogItem - * object will be returned in the - * `PredictResponse.PredictionResult.itemMetadata` object in the method - * response. - * * `returnItemScore`: Boolean. If set to true, the prediction 'score' - * corresponding to each returned item will be set in the `metadata` - * field in the prediction response. The given 'score' indicates the - * probability of an item being clicked/purchased given the user's context - * and history. - * @type array $labels - * Optional. The labels for the predict request. - * - * * Label keys can contain lowercase letters, digits and hyphens, must start - * with a letter, and must end with a letter or digit. - * * Non-zero label values can contain lowercase letters, digits and hyphens, - * must start with a letter, and must end with a letter or digit. - * * No more than 64 labels can be associated with a given request. - * - * See https://goo.gl/xmQnxf for more information on and examples of labels. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function predict($name, $userEvent, array $optionalArgs = []) - { - $request = new PredictRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setUserEvent($userEvent); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['dryRun'])) { - $request->setDryRun($optionalArgs['dryRun']); - } - - if (isset($optionalArgs['params'])) { - $request->setParams($optionalArgs['params']); - } - - if (isset($optionalArgs['labels'])) { - $request->setLabels($optionalArgs['labels']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('Predict', $optionalArgs, PredictResponse::class, $request); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php deleted file mode 100644 index 412eb6dfa2cd..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/Gapic/UserEventServiceGapicClient.php +++ /dev/null @@ -1,728 +0,0 @@ -eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - * $userEvent = 'user_event'; - * $response = $userEventServiceClient->collectUserEvent($formattedParent, $userEvent); - * } finally { - * $userEventServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - */ -class UserEventServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.recommendationengine.v1beta1.UserEventService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'recommendationengine.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $eventStoreNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/user_event_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/user_event_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/user_event_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/user_event_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getEventStoreNameTemplate() - { - if (self::$eventStoreNameTemplate == null) { - self::$eventStoreNameTemplate = new PathTemplate('projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}'); - } - - return self::$eventStoreNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'eventStore' => self::getEventStoreNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a event_store - * resource. - * - * @param string $project - * @param string $location - * @param string $catalog - * @param string $eventStore - * - * @return string The formatted event_store resource. - * - * @experimental - */ - public static function eventStoreName($project, $location, $catalog, $eventStore) - { - return self::getEventStoreNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'catalog' => $catalog, - 'event_store' => $eventStore, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - eventStore: projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'recommendationengine.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Writes a single user event from the browser. This uses a GET request to - * due to browser restriction of POST-ing to a 3rd party domain. - * - * This method is used only by the Recommendations AI JavaScript pixel. - * Users should not call this method directly. - * - * Sample code: - * ``` - * $userEventServiceClient = new UserEventServiceClient(); - * try { - * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - * $userEvent = 'user_event'; - * $response = $userEventServiceClient->collectUserEvent($formattedParent, $userEvent); - * } finally { - * $userEventServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent eventStore name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * @param string $userEvent Required. URL encoded UserEvent proto. - * @param array $optionalArgs { - * Optional. - * - * @type string $uri - * Optional. The url including cgi-parameters but excluding the hash fragment. - * The URL must be truncated to 1.5K bytes to conservatively be under the 2K - * bytes. This is often more useful than the referer url, because many - * browsers only send the domain for 3rd party requests. - * @type int $ets - * Optional. The event timestamp in milliseconds. This prevents browser - * caching of otherwise identical get requests. The name is abbreviated to - * reduce the payload bytes. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Api\HttpBody - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function collectUserEvent($parent, $userEvent, array $optionalArgs = []) - { - $request = new CollectUserEventRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setUserEvent($userEvent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['uri'])) { - $request->setUri($optionalArgs['uri']); - } - - if (isset($optionalArgs['ets'])) { - $request->setEts($optionalArgs['ets']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CollectUserEvent', HttpBody::class, $optionalArgs, $request)->wait(); - } - - /** - * Bulk import of User events. Request processing might be - * synchronous. Events that already exist are skipped. - * Use this method for backfilling historical user events. - * - * Operation.response is of type ImportResponse. Note that it is - * possible for a subset of the items to be successfully inserted. - * Operation.metadata is of type ImportMetadata. - * - * Sample code: - * ``` - * $userEventServiceClient = new UserEventServiceClient(); - * try { - * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - * $inputConfig = new InputConfig(); - * $operationResponse = $userEventServiceClient->importUserEvents($formattedParent, $inputConfig); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $userEventServiceClient->importUserEvents($formattedParent, $inputConfig); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $userEventServiceClient->resumeOperation($operationName, 'importUserEvents'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $userEventServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store` - * @param InputConfig $inputConfig Required. The desired input location of the data. - * @param array $optionalArgs { - * Optional. - * - * @type string $requestId - * Optional. Unique identifier provided by client, within the ancestor - * dataset scope. Ensures idempotency for expensive long running operations. - * Server-generated if unspecified. Up to 128 characters long. This is - * returned as google.longrunning.Operation.name in the response. Note that - * this field must not be set if the desired input config is - * catalog_inline_source. - * @type ImportErrorsConfig $errorsConfig - * Optional. The desired location of errors incurred during the Import. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function importUserEvents($parent, $inputConfig, array $optionalArgs = []) - { - $request = new ImportUserEventsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setInputConfig($inputConfig); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - if (isset($optionalArgs['errorsConfig'])) { - $request->setErrorsConfig($optionalArgs['errorsConfig']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportUserEvents', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets a list of user events within a time range, with potential filtering. - * - * Sample code: - * ``` - * $userEventServiceClient = new UserEventServiceClient(); - * try { - * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - * // Iterate over pages of elements - * $pagedResponse = $userEventServiceClient->listUserEvents($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $userEventServiceClient->listUserEvents($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $userEventServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent eventStore resource name, such as - * `projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * Optional. Filtering expression to specify restrictions over - * returned events. This is a sequence of terms, where each term applies some - * kind of a restriction to the returned user events. Use this expression to - * restrict results to a specific time range, or filter events by eventType. - * eg: eventTime > "2012-04-23T18:25:43.511Z" eventsMissingCatalogItems - * eventTime<"2012-04-23T18:25:43.511Z" eventType=search - * - * We expect only 3 types of fields: - * - * * eventTime: this can be specified a maximum of 2 times, once with a - * less than operator and once with a greater than operator. The - * eventTime restrict should result in one contiguous valid eventTime - * range. - * - * * eventType: only 1 eventType restriction can be specified. - * - * * eventsMissingCatalogItems: specififying this will restrict results - * to events for which catalog items were not found in the catalog. The - * default behavior is to return only those events for which catalog - * items were found. - * - * Some examples of valid filters expressions: - * - * * Example 1: eventTime > "2012-04-23T18:25:43.511Z" - * eventTime < "2012-04-23T18:30:43.511Z" - * * Example 2: eventTime > "2012-04-23T18:25:43.511Z" - * eventType = detail-page-view - * * Example 3: eventsMissingCatalogItems - * eventType = search eventTime < "2018-04-23T18:30:43.511Z" - * * Example 4: eventTime > "2012-04-23T18:25:43.511Z" - * * Example 5: eventType = search - * * Example 6: eventsMissingCatalogItems - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listUserEvents($parent, array $optionalArgs = []) - { - $request = new ListUserEventsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListUserEvents', $optionalArgs, ListUserEventsResponse::class, $request); - } - - /** - * Deletes permanently all user events specified by the filter provided. - * Depending on the number of events specified by the filter, this operation - * could take hours or days to complete. To test a filter, use the list - * command first. - * - * Sample code: - * ``` - * $userEventServiceClient = new UserEventServiceClient(); - * try { - * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - * $filter = 'filter'; - * $operationResponse = $userEventServiceClient->purgeUserEvents($formattedParent, $filter); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $userEventServiceClient->purgeUserEvents($formattedParent, $filter); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $userEventServiceClient->resumeOperation($operationName, 'purgeUserEvents'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $userEventServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the event_store under which the events are - * created. The format is - * `projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}` - * @param string $filter Required. The filter string to specify the events to be deleted. Empty - * string filter is not allowed. This filter can also be used with - * ListUserEvents API to list events that will be deleted. The eligible fields - * for filtering are: - * * eventType - UserEvent.eventType field of type string. - * * eventTime - in ISO 8601 "zulu" format. - * * visitorId - field of type string. Specifying this will delete all events - * associated with a visitor. - * * userId - field of type string. Specifying this will delete all events - * associated with a user. - * Example 1: Deleting all events in a time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventTime < - * "2012-04-23T18:30:43.511Z"` - * Example 2: Deleting specific eventType in time range. - * `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view"` - * Example 3: Deleting all events for a specific visitor - * `visitorId = visitor1024` - * The filtering fields are assumed to have an implicit AND. - * @param array $optionalArgs { - * Optional. - * - * @type bool $force - * Optional. The default value is false. Override this flag to true to - * actually perform the purge. If the field is not set to true, a sampling of - * events to be deleted will be returned. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function purgeUserEvents($parent, $filter, array $optionalArgs = []) - { - $request = new PurgeUserEventsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setFilter($filter); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('PurgeUserEvents', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Writes a single user event. - * - * Sample code: - * ``` - * $userEventServiceClient = new UserEventServiceClient(); - * try { - * $formattedParent = $userEventServiceClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - * $userEvent = new UserEvent(); - * $response = $userEventServiceClient->writeUserEvent($formattedParent, $userEvent); - * } finally { - * $userEventServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent eventStore resource name, such as - * `projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store`. - * @param UserEvent $userEvent Required. User event to write. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\RecommendationEngine\V1beta1\UserEvent - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function writeUserEvent($parent, $userEvent, array $optionalArgs = []) - { - $request = new WriteUserEventRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setUserEvent($userEvent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('WriteUserEvent', UserEvent::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionApiKeyRegistryClient.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionApiKeyRegistryClient.php deleted file mode 100644 index 9a6b6c3e0d46..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/PredictionApiKeyRegistryClient.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.CatalogService' => [ - 'ImportCatalogItems' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\ImportCatalogItemsResponse', - 'metadataReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\ImportMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListCatalogItems' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCatalogItems', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php deleted file mode 100644 index a9d3f6981fa1..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/catalog_service_rest_client_config.php +++ /dev/null @@ -1,113 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.CatalogService' => [ - 'CreateCatalogItem' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems', - 'body' => 'catalog_item', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteCatalogItem' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetCatalogItem' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ImportCatalogItems' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListCatalogItems' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateCatalogItem' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}', - 'body' => 'catalog_item', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_client_config.json b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_client_config.json deleted file mode 100644 index deb13af32bda..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_client_config.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "interfaces": { - "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreatePredictionApiKeyRegistration": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeletePredictionApiKeyRegistration": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListPredictionApiKeyRegistrations": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php deleted file mode 100644 index 489c66c61dfc..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_descriptor_config.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry' => [ - 'ListPredictionApiKeyRegistrations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getPredictionApiKeyRegistrations', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php deleted file mode 100644 index f1e73ffe52d3..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_api_key_registry_rest_client_config.php +++ /dev/null @@ -1,78 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry' => [ - 'CreatePredictionApiKeyRegistration' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeletePredictionApiKeyRegistration' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListPredictionApiKeyRegistrations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_client_config.json b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_client_config.json deleted file mode 100644 index 3368352e1f6a..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_client_config.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "interfaces": { - "google.cloud.recommendationengine.v1beta1.PredictionService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "Predict": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php deleted file mode 100644 index 52e2175fe76c..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_descriptor_config.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.PredictionService' => [ - 'Predict' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getResults', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php deleted file mode 100644 index ef637277dd5a..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/prediction_service_rest_client_config.php +++ /dev/null @@ -1,56 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.PredictionService' => [ - 'Predict' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_client_config.json b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_client_config.json deleted file mode 100644 index 5f920c6228a8..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_client_config.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "interfaces": { - "google.cloud.recommendationengine.v1beta1.UserEventService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CollectUserEvent": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ImportUserEvents": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListUserEvents": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "PurgeUserEvents": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "WriteUserEvent": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php deleted file mode 100644 index 886947166e6f..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_descriptor_config.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.UserEventService' => [ - 'ImportUserEvents' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\ImportUserEventsResponse', - 'metadataReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\ImportMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'PurgeUserEvents' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsResponse', - 'metadataReturnType' => '\Google\Cloud\RecommendationEngine\V1beta1\PurgeUserEventsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListUserEvents' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getUserEvents', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php b/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php deleted file mode 100644 index 47e11b7d1505..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/src/V1beta1/resources/user_event_service_rest_client_config.php +++ /dev/null @@ -1,102 +0,0 @@ - [ - 'google.cloud.recommendationengine.v1beta1.UserEventService' => [ - 'CollectUserEvent' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collect', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ImportUserEvents' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:import', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListUserEvents' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PurgeUserEvents' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:purge', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'WriteUserEvent' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write', - 'body' => 'user_event', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/operations/*}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*}/operations', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*}/operations', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php deleted file mode 100644 index 1f2a0f2c7b2e..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/CatalogServiceClientTest.php +++ /dev/null @@ -1,584 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** - * @return CatalogServiceClient - */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CatalogServiceClient($options); - } - - /** - * @test - */ - public function createCatalogItemTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $id = 'id3355'; - $title = 'title110371416'; - $description = 'description-1724546052'; - $languageCode = 'languageCode-412800396'; - $itemGroupId = 'itemGroupId894431879'; - $expectedResponse = new CatalogItem(); - $expectedResponse->setId($id); - $expectedResponse->setTitle($title); - $expectedResponse->setDescription($description); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setItemGroupId($itemGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $catalogItem = new CatalogItem(); - $catalogItemId = 'catalogItemId-1850269433'; - $catalogItem->setId($catalogItemId); - $catalogItemCategoryHierarchies = []; - $catalogItem->setCategoryHierarchies($catalogItemCategoryHierarchies); - $catalogItemTitle = 'catalogItemTitle244020972'; - $catalogItem->setTitle($catalogItemTitle); - $response = $gapicClient->createCatalogItem($formattedParent, $catalogItem); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/CreateCatalogItem', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getCatalogItem(); - $this->assertProtobufEquals($catalogItem, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createCatalogItemExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $catalogItem = new CatalogItem(); - $catalogItemId = 'catalogItemId-1850269433'; - $catalogItem->setId($catalogItemId); - $catalogItemCategoryHierarchies = []; - $catalogItem->setCategoryHierarchies($catalogItemCategoryHierarchies); - $catalogItemTitle = 'catalogItemTitle244020972'; - $catalogItem->setTitle($catalogItemTitle); - try { - $gapicClient->createCatalogItem($formattedParent, $catalogItem); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteCatalogItemTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); - $gapicClient->deleteCatalogItem($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/DeleteCatalogItem', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteCatalogItemExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); - try { - $gapicClient->deleteCatalogItem($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getCatalogItemTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $id = 'id3355'; - $title = 'title110371416'; - $description = 'description-1724546052'; - $languageCode = 'languageCode-412800396'; - $itemGroupId = 'itemGroupId894431879'; - $expectedResponse = new CatalogItem(); - $expectedResponse->setId($id); - $expectedResponse->setTitle($title); - $expectedResponse->setDescription($description); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setItemGroupId($itemGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); - $response = $gapicClient->getCatalogItem($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/GetCatalogItem', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getCatalogItemExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); - try { - $gapicClient->getCatalogItem($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function importCatalogItemsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importCatalogItemsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportCatalogItemsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importCatalogItemsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $inputConfig = new InputConfig(); - $response = $gapicClient->importCatalogItems($formattedParent, $inputConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/ImportCatalogItems', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInputConfig(); - $this->assertProtobufEquals($inputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importCatalogItemsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** - * @test - */ - public function importCatalogItemsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importCatalogItemsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $inputConfig = new InputConfig(); - $response = $gapicClient->importCatalogItems($formattedParent, $inputConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importCatalogItemsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** - * @test - */ - public function listCatalogItemsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $catalogItemsElement = new CatalogItem(); - $catalogItems = [ - $catalogItemsElement, - ]; - $expectedResponse = new ListCatalogItemsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCatalogItems($catalogItems); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - $response = $gapicClient->listCatalogItems($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCatalogItems()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/ListCatalogItems', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listCatalogItemsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->catalogName('[PROJECT]', '[LOCATION]', '[CATALOG]'); - try { - $gapicClient->listCatalogItems($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateCatalogItemTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $id = 'id3355'; - $title = 'title110371416'; - $description = 'description-1724546052'; - $languageCode = 'languageCode-412800396'; - $itemGroupId = 'itemGroupId894431879'; - $expectedResponse = new CatalogItem(); - $expectedResponse->setId($id); - $expectedResponse->setTitle($title); - $expectedResponse->setDescription($description); - $expectedResponse->setLanguageCode($languageCode); - $expectedResponse->setItemGroupId($itemGroupId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); - $catalogItem = new CatalogItem(); - $catalogItemId = 'catalogItemId-1850269433'; - $catalogItem->setId($catalogItemId); - $catalogItemCategoryHierarchies = []; - $catalogItem->setCategoryHierarchies($catalogItemCategoryHierarchies); - $catalogItemTitle = 'catalogItemTitle244020972'; - $catalogItem->setTitle($catalogItemTitle); - $response = $gapicClient->updateCatalogItem($formattedName, $catalogItem); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.CatalogService/UpdateCatalogItem', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getCatalogItem(); - $this->assertProtobufEquals($catalogItem, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateCatalogItemExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->catalogItemPathName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[CATALOG_ITEM_PATH]'); - $catalogItem = new CatalogItem(); - $catalogItemId = 'catalogItemId-1850269433'; - $catalogItem->setId($catalogItemId); - $catalogItemCategoryHierarchies = []; - $catalogItem->setCategoryHierarchies($catalogItemCategoryHierarchies); - $catalogItemTitle = 'catalogItemTitle244020972'; - $catalogItem->setTitle($catalogItemTitle); - try { - $gapicClient->updateCatalogItem($formattedName, $catalogItem); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php deleted file mode 100644 index 9f865b52aa15..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionApiKeyRegistryClientTest.php +++ /dev/null @@ -1,272 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** - * @return PredictionApiKeyRegistryClient - */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PredictionApiKeyRegistryClient($options); - } - - /** - * @test - */ - public function createPredictionApiKeyRegistrationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $apiKey = 'apiKey-800085318'; - $expectedResponse = new PredictionApiKeyRegistration(); - $expectedResponse->setApiKey($apiKey); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $predictionApiKeyRegistration = new PredictionApiKeyRegistration(); - $response = $gapicClient->createPredictionApiKeyRegistration($formattedParent, $predictionApiKeyRegistration); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/CreatePredictionApiKeyRegistration', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPredictionApiKeyRegistration(); - $this->assertProtobufEquals($predictionApiKeyRegistration, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function createPredictionApiKeyRegistrationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $predictionApiKeyRegistration = new PredictionApiKeyRegistration(); - try { - $gapicClient->createPredictionApiKeyRegistration($formattedParent, $predictionApiKeyRegistration); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deletePredictionApiKeyRegistrationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->predictionApiKeyRegistrationName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PREDICTION_API_KEY_REGISTRATION]'); - $gapicClient->deletePredictionApiKeyRegistration($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/DeletePredictionApiKeyRegistration', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deletePredictionApiKeyRegistrationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->predictionApiKeyRegistrationName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PREDICTION_API_KEY_REGISTRATION]'); - try { - $gapicClient->deletePredictionApiKeyRegistration($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listPredictionApiKeyRegistrationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $predictionApiKeyRegistrationsElement = new PredictionApiKeyRegistration(); - $predictionApiKeyRegistrations = [ - $predictionApiKeyRegistrationsElement, - ]; - $expectedResponse = new ListPredictionApiKeyRegistrationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPredictionApiKeyRegistrations($predictionApiKeyRegistrations); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $response = $gapicClient->listPredictionApiKeyRegistrations($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPredictionApiKeyRegistrations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/ListPredictionApiKeyRegistrations', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listPredictionApiKeyRegistrationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - try { - $gapicClient->listPredictionApiKeyRegistrations($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php deleted file mode 100644 index ee4ad4689b44..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/PredictionServiceClientTest.php +++ /dev/null @@ -1,163 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** - * @return PredictionServiceClient - */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new PredictionServiceClient($options); - } - - /** - * @test - */ - public function predictTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $recommendationToken = 'recommendationToken-1973883405'; - $dryRun2 = true; - $nextPageToken = ''; - $resultsElement = new PredictionResult(); - $results = [ - $resultsElement, - ]; - $expectedResponse = new PredictResponse(); - $expectedResponse->setRecommendationToken($recommendationToken); - $expectedResponse->setDryRun($dryRun2); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setResults($results); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->placementName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PLACEMENT]'); - $userEvent = new UserEvent(); - $userEventEventType = 'userEventEventType341658661'; - $userEvent->setEventType($userEventEventType); - $userEventUserInfo = new UserInfo(); - $userInfoVisitorId = 'userInfoVisitorId-1297088752'; - $userEventUserInfo->setVisitorId($userInfoVisitorId); - $userEvent->setUserInfo($userEventUserInfo); - $response = $gapicClient->predict($formattedName, $userEvent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getResults()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.PredictionService/Predict', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualRequestObject->getUserEvent(); - $this->assertProtobufEquals($userEvent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function predictExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->placementName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]', '[PLACEMENT]'); - $userEvent = new UserEvent(); - $userEventEventType = 'userEventEventType341658661'; - $userEvent->setEventType($userEventEventType); - $userEventUserInfo = new UserInfo(); - $userInfoVisitorId = 'userInfoVisitorId-1297088752'; - $userEventUserInfo->setVisitorId($userInfoVisitorId); - $userEvent->setUserInfo($userEventUserInfo); - try { - $gapicClient->predict($formattedName, $userEvent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php b/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php deleted file mode 100644 index 4399337b46c5..000000000000 --- a/owl-bot-staging/RecommendationEngine/v1beta1/tests/Unit/V1beta1/UserEventServiceClientTest.php +++ /dev/null @@ -1,554 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** - * @return UserEventServiceClient - */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new UserEventServiceClient($options); - } - - /** - * @test - */ - public function collectUserEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $contentType = 'contentType831846208'; - $data = '-86'; - $expectedResponse = new HttpBody(); - $expectedResponse->setContentType($contentType); - $expectedResponse->setData($data); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $userEvent = 'userEvent1921940774'; - $response = $gapicClient->collectUserEvent($formattedParent, $userEvent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/CollectUserEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getUserEvent(); - $this->assertProtobufEquals($userEvent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function collectUserEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $userEvent = 'userEvent1921940774'; - try { - $gapicClient->collectUserEvent($formattedParent, $userEvent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function importUserEventsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importUserEventsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new ImportUserEventsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importUserEventsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $inputConfig = new InputConfig(); - $response = $gapicClient->importUserEvents($formattedParent, $inputConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/ImportUserEvents', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getInputConfig(); - $this->assertProtobufEquals($inputConfig, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importUserEventsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** - * @test - */ - public function importUserEventsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importUserEventsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $inputConfig = new InputConfig(); - $response = $gapicClient->importUserEvents($formattedParent, $inputConfig); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importUserEventsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** - * @test - */ - public function listUserEventsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $userEventsElement = new UserEvent(); - $userEvents = [ - $userEventsElement, - ]; - $expectedResponse = new ListUserEventsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setUserEvents($userEvents); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $response = $gapicClient->listUserEvents($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getUserEvents()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/ListUserEvents', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listUserEventsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - try { - $gapicClient->listUserEvents($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function purgeUserEventsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/purgeUserEventsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $purgedEventsCount = 310774833; - $expectedResponse = new PurgeUserEventsResponse(); - $expectedResponse->setPurgedEventsCount($purgedEventsCount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/purgeUserEventsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->purgeUserEvents($formattedParent, $filter); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/PurgeUserEvents', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getFilter(); - $this->assertProtobufEquals($filter, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeUserEventsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** - * @test - */ - public function purgeUserEventsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/purgeUserEventsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $filter = 'filter-1274492040'; - $response = $gapicClient->purgeUserEvents($formattedParent, $filter); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/purgeUserEventsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** - * @test - */ - public function writeUserEventTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $eventType = 'eventType984376767'; - $expectedResponse = new UserEvent(); - $expectedResponse->setEventType($eventType); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $userEvent = new UserEvent(); - $userEventEventType = 'userEventEventType341658661'; - $userEvent->setEventType($userEventEventType); - $userEventUserInfo = new UserInfo(); - $userInfoVisitorId = 'userInfoVisitorId-1297088752'; - $userEventUserInfo->setVisitorId($userInfoVisitorId); - $userEvent->setUserInfo($userEventUserInfo); - $response = $gapicClient->writeUserEvent($formattedParent, $userEvent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.recommendationengine.v1beta1.UserEventService/WriteUserEvent', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getUserEvent(); - $this->assertProtobufEquals($userEvent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function writeUserEventExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->eventStoreName('[PROJECT]', '[LOCATION]', '[CATALOG]', '[EVENT_STORE]'); - $userEvent = new UserEvent(); - $userEventEventType = 'userEventEventType341658661'; - $userEvent->setEventType($userEventEventType); - $userEventUserInfo = new UserInfo(); - $userInfoVisitorId = 'userInfoVisitorId-1297088752'; - $userEventUserInfo->setVisitorId($userInfoVisitorId); - $userEvent->setUserInfo($userEventUserInfo); - try { - $gapicClient->writeUserEvent($formattedParent, $userEvent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}